{"version":3,"sources":["components/NavMenu.tsx","components/Layout.tsx","components/Projects.tsx","components/Blog.tsx","components/HtmlPostRepo.tsx","components/BlogPost.tsx","registerServiceWorker.ts","index.tsx","store/configureStore.ts","App.tsx"],"names":["NavMenu","state","isOpen","toggle","_this","setState","react","Navbar","className","light","Container","NavbarBrand","tag","Link","to","NavbarToggler","onClick","this","Collapse","navbar","NavItem","NavLink","React","Layout","props","NavMenu_NavMenu","children","Projects","Projects_Project","title","description","imgUrl","downloadUrl","githubUrl","Project","src","alt","href","Blog","console","log","BlogPostsIndex","map","post","Blog_BlogPostCard","date","Date","postId","BlogPostCard","toLocaleDateString","year","month","day","concat","formatDate","HtmlPostRepo","Object","classCallCheck","createClass","key","value","BlogPost","possibleConstructorReturn","getPrototypeOf","call","markdown","Prism","highlightAll","_this2","htmlPostRepoArticle","fetch","match","params","then","res","text","argumentExceptions","nlogQuickStart","react_markdown_default","a","source","isLocalhost","Boolean","window","location","hostname","registerValidSW","swUrl","navigator","serviceWorker","register","registration","onupdatefound","installingWorker","installing","onstatechange","controller","catch","error","baseUrl","document","getElementsByTagName","getAttribute","history","createBrowserHistory","basename","store","initialState","middleware","thunk","routerMiddleware","rootReducer","combineReducers","router","connectRouter","enhancers","windowIfDefined","__REDUX_DEVTOOLS_EXTENSION__","push","createStore","compose","apply","applyMiddleware","configureStore","ReactDOM","es","esm","Route","path","component","exact","getElementById","URL","process","toString","origin","addEventListener","response","contentType","headers","get","status","indexOf","ready","unregister","reload","checkValidServiceWorker","registerServiceWorker"],"mappings":"6TAKqBA,oNACZC,MAAQ,CACbC,QAAQ,KA0BFC,OAAS,WACfC,EAAKC,SAAS,CACZH,QAASE,EAAKH,MAAMC,kFAxBtB,OACEI,EAAA,4BACEA,EAAA,cAACC,EAAA,EAAD,CAAQC,UAAU,sEAAsEC,OAAK,GAC3FH,EAAA,cAACI,EAAA,EAAD,KACEJ,EAAA,cAACK,EAAA,EAAD,CAAaC,IAAKC,IAAMC,GAAG,KAA3B,kB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AWtG,IACnCrB,EAAA,cAACyH,EAAA,EAAD,CAAOG,OAAK,EAACF,KAAK,IAAIC,UAAW3F,IACjChC,EAAA,cAACyH,EAAA,EAAD,CAAOG,OAAK,EAACF,KAAK,qBAAqBC,UAAWpE,MFQ1C,QAGRuC,SAAS+B,eAAe,SDJb,WACX,GAA6C,kBAAmB3C,UAAW,CAIvE,GADkB,IAAI4C,IADVC,GACmBlD,OAAOC,SAASkD,YACjCC,SAAWpD,OAAOC,SAASmD,OAIrC,OAGJpD,OAAOqD,iBAAiB,OAAQ,WAC5B,IAAMjD,EAAK,GAAAlC,OAAMgF,GAAN,sBAEPpD,EAwChB,SAAiCM,GAE7BjB,MAAMiB,GACDd,KAAK,SAAAgE,GAEF,IAAMC,EAAcD,EAASE,QAAQC,IAAI,gBACjB,MAApBH,EAASI,QAAmBH,IAAsD,IAAvCA,EAAYI,QAAQ,cAE/DtD,UAAUC,cAAcsD,MAAMtE,KAAK,SAAAkB,GAC/BA,EAAaqD,aAAavE,KAAK,WAC3BU,OAAOC,SAAS6D,aAKxB3D,EAAgBC,KAGvBU,MAAM,WACH1D,QAAQC,IAAI,mEAzDR0G,CAAwB3D,GAGxBD,EAAgBC,MCdhC4D","file":"static/js/main.8d4eadeb.chunk.js","sourcesContent":["import * as React from 'react';\r\nimport { Collapse, Container, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap';\r\nimport { Link } from 'react-router-dom';\r\nimport './NavMenu.css';\r\n\r\nexport default class NavMenu extends React.PureComponent<{}, { isOpen: boolean }> {\r\n public state = {\r\n isOpen: false\r\n };\r\n\r\n public render() {\r\n return (\r\n
\r\n \r\n \r\n sasioglu.co.uk\r\n \r\n \r\n
    \r\n \r\n Projects\r\n \r\n \r\n Blog\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n );\r\n }\r\n\r\n private toggle = () => {\r\n this.setState({\r\n isOpen: !this.state.isOpen\r\n });\r\n }\r\n}\r\n","import * as React from 'react';\r\nimport { Container } from 'reactstrap';\r\nimport NavMenu from './NavMenu';\r\n\r\nexport default (props: { children?: React.ReactNode }) => (\r\n \r\n \r\n \r\n {props.children}\r\n \r\n \r\n);\r\n","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router';\r\n\r\n\r\ntype ProjectProps = {\r\n title: string,\r\n description?: string,\r\n imgUrl: string,\r\n downloadUrl?: string,\r\n githubUrl: string,\r\n}\r\n\r\nclass Projects extends React.PureComponent {\r\n public render() {\r\n return (\r\n \r\n

Projects

\r\n \r\n
\r\n );\r\n }\r\n};\r\n\r\nclass Project extends React.PureComponent {\r\n public render() {\r\n return (\r\n \r\n
  • \r\n {this.props.title}\r\n
    \r\n

    {this.props.title}

    \r\n

    {this.props.description}

    \r\n\r\n
    \r\n Download\r\n Github\r\n
    \r\n
    \r\n
  • \r\n
    \r\n );\r\n }\r\n};\r\n\r\nexport default Projects;\r\n","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { Link } from \"react-router-dom\";\r\n\r\nimport BlogPostsIndex from \"../assets/BlogPostsIndex.json\"\r\n\r\ntype BlogPostCardProps = {\r\n title: string,\r\n date: Date,\r\n postId: string,\r\n}\r\n\r\ntype BlogPostIndexItem = {\r\n title: string,\r\n date: string,\r\n postId: string,\r\n postType: string,\r\n}\r\n\r\n\r\nclass Blog extends React.PureComponent {\r\n public render() {\r\n console.log(BlogPostsIndex);\r\n return (\r\n \r\n

    Blog

    \r\n \r\n
    \r\n);\r\n}\r\n};\r\n\r\nclass BlogPostCard extends React.PureComponent {\r\n\r\n formatDate(date: Date) {\r\n const dateOptions = { year: 'numeric', month: 'short', day: 'numeric' };\r\n return date.toLocaleDateString('en-gb', dateOptions);\r\n }\r\n\r\n public render() {\r\n return (\r\n \r\n
    \r\n

    {this.props.title}

    \r\n

    {this.formatDate(this.props.date)}

    \r\n \r\n\r\n\r\n
    \r\n
    \r\n );\r\n }\r\n};\r\n\r\nexport default Blog;\r\n","import * as React from 'react';\r\n\r\nimport 'bootstrap/dist/css/bootstrap.css';\r\nimport \"prismjs/themes/prism-okaidia.css\";\r\n\r\nexport class HtmlPostRepo {\r\n public static argumentExceptions() {\r\n return (\r\n
    \r\n

    ArgumentException Best Practices

    \r\n 30 Jun 2015\r\n
    \r\n
    \r\n The ArgumentException (and its derived types) are probably[1] the most commonly thrown exceptions in .NET after Exception itself, but they're often used incorrectly, and the MDSN guidelines are somewhat vague.\r\n\r\n

    \r\n There are three types of ArgumentException in .NET; the ArgumentException itself and its two derived types ArgumentNullException and ArgumentOutOfRangeException. Let's explore.\r\n\r\n
    \r\n\r\n

    ArgumentNullException

    \r\n
    \r\n The ArgumentNullException is usually thrown right at the start of a method, as part of a precondition check. If possible, parameters should be checked in signature order to aid discoverability and debugging.\r\n

    \r\n A less common use for the ArgumentNullException is to notify the caller when a method was just about to call into another method with a null argument, generated from a caller-provided parameter. The caveat of course being that you need to know somehow that it's invalid to pass null to the inner method. But if you can guarantee this, you benefit from being able to throw earlier, and with a more meaningful message.\r\n\r\n\r\n
    \r\n\r\n\r\n
    \r\n\r\n
    \r\n
    Argument vs. Parameter
    \r\n
    \r\n The generally accepted convention which .NET follows[2] is to call the things being passed into a method the arguments, and the things within a method parameters.\r\n
    \r\n
    \r\n
    \r\n\r\n

    ArgumentOutOfRangeException

    \r\n
    \r\n The ArgumentOutOfRangeException should be thrown whenever a parameter is not null, but still out of the range of acceptable values. A constructor that takes a string message should always be used, and include a description of the valid range of values.\r\n

    \r\n Like the ArgumentNullException, when calling the single string constructor the parameter name should be passed in, and the created exception will have the friendly message "Specified argument was out of the range of valid values. Parameter name: foo".\r\n
    \r\n\r\n

    ArgumentException

    \r\n
    \r\n ArgumentException is the concrete base class of the other two. It should only be used when one of the more specific types are not appropriate, which is usually when two or more arguments are not compatible with each other.\r\n
    \r\n
    It should not be used with a single string parameter denoting a parameter name (e.g. throw new ArgumentException("foo")), as this violates the signature (public ArgumentException(string message)), by providing no message with details of the issue.\r\n\r\n\r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n\r\n\r\n
    \r\n [1] At least according to GitHub: Exception has 4.3m usages, ArgumentException (all varieties) has 1.84m, InvalidOperationException has 460k.\r\n
    \r\n [2] The Main method signature being the obvious exception.\r\n
    \r\n\r\n\r\n
    \r\n );\r\n }\r\n\r\n public static nlogQuickStart() {\r\n return (\r\n
    \r\n

    NLog (really) quick start

    \r\n 23 May 2015\r\n
    \r\n

    Why NLog?

    \r\n
    \r\n It's powerful, actively developed, has decent documentation, a wide user base and supports Silverlight and Windows Phone. It might take an extra 5 minutes setting up the base config, but it's worth it.
    \r\n \r\n

    3 Step Setup

    \r\n\r\n
    \r\n
      \r\n \r\n

    1. 1. Install using NuGet
    2. \r\n

    3. 2. Add the following to your App.config inside the <configuration> element
    4. \r\n\r\n
      \r\n              \r\n{`\r\n    
      \r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n`}\r\n \r\n
      \r\n \r\n
      \r\n\r\n
      \r\n
      Exception: \"Only one <configSections> element allowed per config file and if present must be the first child of the root\"
      \r\n
      \r\n\r\n If you get this exception, make sure the <configsection> is at the top of the file, just under <configuration>.\r\n
      \r\n
      \r\n
      \r\n\r\n This config is set up to create a log file at C:/Temp/log.txt, and append to it. As this just creates one ever expanding file, it's only really useful for debugging. See instructions below on configuring NLog to create a new timestamped log file on each application launch.\r\n

      \r\n\r\n
    5. 3. Now all you have to do is get the Logger object and log from it

      \r\n
      \r\n{`Logger _logger = LogManager.GetLogger(\"log\");\r\n_logger.Error(\"Foo\");\r\n_logger.Info(\"Bar\");\r\n// etc...`}
      \r\n

      \r\n \r\n
    6. \r\n \r\n
    \r\n
    \r\n\r\n

    Optional Config

    \r\n
      \r\n
    1. \r\n
      \r\n

      Fresh log file per application launch, named by creation timestamp

      \r\n
      {``}
      \r\n
      \r\n
    2. \r\n\r\n
    3. \r\n
      \r\n

      Exception support with stacktrace (also note the bonus {\"${longdate}\"} to get timestamped log lines)

      \r\n
      {\"\"}\r\n              \r\n              
      \r\n
      \r\n{`Exception e = ...\r\n_logger.Error(\"Uh oh: \", e);`}
      \r\n
      \r\n
    4. \r\n
    5. \r\n
      \r\n

      Log to %AppData%/YourAppName (no need to create this beforehand)

      \r\n
      {\"\"}\r\n              \r\n              
      \r\n
      \r\n
    6. \r\n
    7. \r\n
      \r\n

      Specify minimum logging level of warning

      \r\n
      <logger name=\"log\" writeTo=\"log\" minlevel=\"Warning\"/>
      \r\n
      \r\n
    8. \r\n
    9. \r\n
      \r\n

      Class specific config

      \r\n
      \r\n{`\r\n\r\n\r\n`}\r\n                        
      \r\n
      Logger _logger = LogManager.GetCurrentClassLogger();\r\n                
      \r\n\r\n
      \r\n
    10. \r\n
    11. \r\n
      \r\n

      Enable Visual Studio intellisense

      \r\n Download\r\n http://www.nlog-project.org/schemas/NLog.xsd somewhere (\r\n C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Xml\\Schemas is a good place). \r\n Go to App.config properties -> Schemas -> Add NLog.xsd.\r\n
      \r\n
    12. \r\n
    \r\n
    \r\n\r\n

    Putting it all together

    \r\n
    \r\n
    \r\n{`\r\n    \r\n        
    \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n`}
    \r\n
    \r\n\r\n

    Dependency bundling

    \r\n If you're using a dependency bundler such as Fody/Costura you'll need to define the config programatically on startup:

    \r\n
    \r\n{`var config = new LoggingConfiguration();\r\n\r\nvar target      = new FileTarget();\r\ntarget.Name     = \"log\";\r\ntarget.FileName = @\"\\${specialfolder:folder=ApplicationData}/YourAppName/log_\\${cached:\\${longdate}:cached=true}.txt\";\r\ntarget.Layout   = @\"\\${longdate} \\${message} \\${exception:format=tostring}\";\r\nconfig.AddTarget(\"log\", target);\r\n\r\nvar rule = new LoggingRule(\"*\", LogLevel.Trace, target);\r\nconfig.LoggingRules.Add(rule);\r\n\r\nLogManager.Configuration = config;`}\r\n        
    \r\n
    \r\n

    More @ Github docs

    \r\n

    \r\n\r\n
    \r\n );\r\n }\r\n};\r\n","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { HtmlPostRepo } from \"./HtmlPostRepo\";\r\n\r\nimport Prism from \"prismjs\";\r\nimport \"prismjs/components/prism-csharp\";\r\nimport ReactMarkdown from 'react-markdown';\r\n\r\n\r\ntype BlogPostCardProps = {\r\n title: string,\r\n description: string,\r\n date: Date,\r\n}\r\n\r\ntype MarkdownState = {\r\n markdown: string\r\n}\r\n\r\nclass BlogPost extends React.Component, MarkdownState> {\r\n constructor(props: RouteComponentProps<{ postId: string }>) {\r\n super(props);\r\n this.state = { markdown: 'loading...' };\r\n }\r\n\r\n public componentDidMount() {\r\n Prism.highlightAll();\r\n }\r\n\r\n public componentDidUpdate() {\r\n Prism.highlightAll();\r\n }\r\n\r\n public componentWillMount() {\r\n if (!this.htmlPostRepoArticle()) {\r\n // Get the contents from the Markdown file and put them in the React state, so we can reference it in render() below.\r\n fetch(`\\/posts\\/${this.props.match.params.postId}.md`).then(res => res.text()).then(text => {\r\n console.log(text);\r\n this.setState({ markdown: text });\r\n });\r\n }\r\n }\r\n\r\n public render() {\r\n if (this.props.match.params.postId === \"argument-exception-best-practices\") {\r\n return HtmlPostRepo.argumentExceptions();\r\n }\r\n if (this.props.match.params.postId === \"nlog-quick-start\") {\r\n return HtmlPostRepo.nlogQuickStart();\r\n }\r\n //const { markdown } = this.state;\r\n return ();\r\n }\r\n\r\n public htmlPostRepoArticle() : boolean {\r\n return this.props.match.params.postId === \"argument-exception-best-practices\" ||\r\n this.props.match.params.postId === \"nlog-quick-start\";\r\n }\r\n};\r\n\r\nexport default BlogPost;\r\n","// In production, we register a service worker to serve assets from local cache.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on the \"N+1\" visit to a page, since previously\r\n// cached resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\r\n// This link also includes instructions on opting out of this behavior.\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.1/8 is considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n )\r\n);\r\n\r\nexport default function register() {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const url = process.env.PUBLIC_URL as string;\r\n const publicUrl = new URL(url, window.location.toString());\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Lets check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl);\r\n } else {\r\n // Is not local host. Just register service worker\r\n registerValidSW(swUrl);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl: string) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing as ServiceWorker;\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the old content will have been purged and\r\n // the fresh content will have been added to the cache.\r\n // It's the perfect time to display a \"New content is\r\n // available; please refresh.\" message in your web app.\r\n console.log('New content is available; please refresh.');\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch(error => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl: string) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl)\r\n .then(response => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get('content-type');\r\n if (response.status === 404 || (contentType && contentType.indexOf('javascript') === -1)) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl);\r\n }\r\n })\r\n .catch(() => {\r\n console.log('No internet connection found. App is running in offline mode.');\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister();\r\n });\r\n }\r\n}\r\n","import 'bootstrap/dist/css/bootstrap.css';\r\n\r\nimport * as React from 'react';\r\nimport * as ReactDOM from 'react-dom';\r\nimport { Provider } from 'react-redux';\r\nimport { ConnectedRouter } from 'connected-react-router';\r\nimport { createBrowserHistory } from 'history';\r\nimport configureStore from './store/configureStore';\r\nimport App from './App';\r\nimport registerServiceWorker from './registerServiceWorker';\r\n\r\n// Create browser history to use in the Redux store\r\nconst baseUrl = document.getElementsByTagName('base')[0].getAttribute('href') as string;\r\nconst history = createBrowserHistory({ basename: baseUrl });\r\n\r\n// Get the application-wide store instance, prepopulating with state from the server where available.\r\nconst store = configureStore(history);\r\n\r\nReactDOM.render(\r\n \r\n \r\n \r\n \r\n ,\r\n document.getElementById('root'));\r\n\r\nregisterServiceWorker();\r\n","import { applyMiddleware, combineReducers, compose, createStore } from 'redux';\r\nimport thunk from 'redux-thunk';\r\nimport { connectRouter, routerMiddleware } from 'connected-react-router';\r\nimport { History } from 'history';\r\n\r\nexport default function configureStore(history: History, initialState?: {}) {\r\n const middleware = [\r\n thunk,\r\n routerMiddleware(history)\r\n ];\r\n\r\n const rootReducer = combineReducers({\r\n // ...reducers,\r\n router: connectRouter(history)\r\n });\r\n\r\n const enhancers = [];\r\n const windowIfDefined = typeof window === 'undefined' ? null : window as any;\r\n if (windowIfDefined && windowIfDefined.__REDUX_DEVTOOLS_EXTENSION__) {\r\n enhancers.push(windowIfDefined.__REDUX_DEVTOOLS_EXTENSION__());\r\n }\r\n\r\n return createStore(\r\n rootReducer,\r\n initialState,\r\n compose(applyMiddleware(...middleware), ...enhancers)\r\n );\r\n}\r\n","import * as React from 'react';\r\nimport { Route } from 'react-router';\r\nimport Layout from './components/Layout';\r\nimport Projects from './components/Projects';\r\nimport Blog from './components/Blog';\r\nimport BlogPost from './components/BlogPost';\r\n\r\nimport './custom.css'\r\n\r\nexport default () => (\r\n \r\n \r\n \r\n \r\n \r\n);\r\n"],"sourceRoot":""}