{
    "version": "https://jsonfeed.org/version/1",
    "title": "Adam Jahnke ☕️🏍 (adamyonk)",
    "home_page_url": "https://adamyonk.com",
    "feed_url": "https://adamyonk.com/feed.json",
    "author": {
        "name": "Adam Jahnke"
    },
    "items": [
        {
            "id": "674f0efc-2b42-5642-9131-e0d185cbfad7",
            "content_html": "<p>I've found a lot of value in demoing work as a person who works on a\ndistributed team. It helps to communicate outwards the things you're working on\nand it encourages teams to celebrate accomplishments. Video demos are great\nbecause you can explain in plain language the thing you're demonstrating, and\nit gives some warmth to what could, in our field, be a\npretty technical and cold bunch of information.</p>\n<p>There are surely more automatic options for this, but I wanted a way to record\na screencast with a small video of myself picture-in-picture-style without\nhaving to buy or download any apps. It turns out, the macOS screenshot utility\nand QuickTime make it somewhat easy.</p>\n<p>First, open up QuickTime player and start a <em>New Movie Recording</em>.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto;  max-width: 568px;\"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/a94e1111f3afc171a9d3cf76908c685c/0e1a6/file.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 125.35211267605635%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAZCAYAAAAxFw7TAAAACXBIWXMAABYlAAAWJQFJUiTwAAADeklEQVQ4y62VyU4bQRCGeQk4ICGEWA6AxL7vq83i3djyyuLdOEa2sUlELomUEwhMFuWQKBKaY3JLohwi5bkQM+5K/Q02Y2fICUsl90x3f131V1dN0/efv5ue6vfj15+7gdPpNvkDoa/pdOY6Fk8qyVRa4bESiyeUTCarJJIpJRKNK4eZZ0qU/3mt4vcHlUQipRQKx9ep9OE3m91hrpEDgfDpyfNTuri4orOzCzo/v6Ty1Ts5viy/pXL5box3eC6WXlAuX6RXr9/Qp89f6P2Hj+Tx+l7WgMPDw8ezs7N0cHBwE4lEVK/XqyYSCTUajar7+/tqLBZT9/b21GQyKZ9HR0dVk8mkut1utVAo3PAc9ff3F2vAgYGB0szMDPGEFgwGBRvxRgqHw7Szs0MMp0DAT7u7u5TNZmltbY3YCfyLfD6vAdjb21uqAUdGRkrw0G63a06nU1itVoKxp2SxWMjv95PL7Saek2O8Gx8fJ94jeI3G+whO1YAcQmlhYYE2Nzc1s9ksVlZWyOVy0dzcHPGcNADGxsakTU5OEiKanp4WvE5zOBwEp2rAwcHBEk/KkHO5nIAnrCf5fD65cWpqSgInJiZqBjC/kyFDor6+vgfg0NCQ1DAQCGjxeFwgJIQLKPTDBszrofdjcXR0pG1vb9cDqx5yErRUKgVdKJ1OUygUkomowvQGKIcp1tfXZciGSeGTZFJ4EWGRzWbDOxkydMO/3uAh66xBczhVA7Iepfn5eWLTeIEA/F4jafDeyNhzsbq6qsEBPrBeQyxYXFzUeIEAvBpWY6gNJoH397KkrxQJXFpa0paXl4VeM31mG60K5D31Ies9BBALoEs1dF1W67LMd1fwvUVUxkCGQGAJZLjh/dMDeR7RQHcCwxAID+EdoMiskWc6fQWbhoPrNKwCoSF7JrOMxBgBGy+2IRDxw22+yBpfZOHxeGR1bG1t4fI+mhSucZkUNJJ/KgWZ5f4nSw+VAiAuNdrUY9cGlcJXRgLrKoVPKsJDdA5uCOggqGexsbEhEBa6ipGxJEigyl2qPssoPQAZcMsnVljHCntQYViF9XnUGFjhfbdIIEdyok+K9JDbv2wKaKIQGolqrN+qYQ5h86dANl7W8OET0NHR0dbd3W1pbm62trS0WFtbW638bO3q6vqv9fT0WNvb26V1dna2SRgX9pN9lzmJTX8BnXrDE+jHdJYAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"file\"\n        title=\"file\"\n        src=\"/static/a94e1111f3afc171a9d3cf76908c685c/0e1a6/file.png\"\n        srcset=\"/static/a94e1111f3afc171a9d3cf76908c685c/9ec3c/file.png 200w,\n/static/a94e1111f3afc171a9d3cf76908c685c/c7805/file.png 400w,\n/static/a94e1111f3afc171a9d3cf76908c685c/0e1a6/file.png 568w\"\n        sizes=\"(max-width: 568px) 100vw, 568px\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n<p>Then, select <em>View > Float on Top</em>.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto;  max-width: 490px;\"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/971dcc113e039a7b7a1e599834aab1b8/719ca/view.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 183.265306122449%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAlCAYAAABCr8kFAAAACXBIWXMAABYlAAAWJQFJUiTwAAAFIElEQVRIx61WW09rRRQ+hASeTTBBHgn3Oy23bgr0Am2hLbcQ7nB6OUKh7W4jiAETNDE5OcZEPUcfNP4hnwzxxb/icbP38vuGPaWboomJTVZmOrPmm7W+dZn9IhQKvfi/fsvLyw8Tn8/34dTUVDkQCFSmp6fNvr4+0+/3m/hvjo2NmZOTk+bIyIjJPegp4dyV8szMzKfA6K0hj4+PB6AkGxsbcnV1JZVKRQ4PD6VarUqxWJTLy0spFAqCw2IYhhJcpoRrCwsLMjo6+nENcHBwMAAr3mPjfnV11Uqn01Y0GrVWVlYs/qdwDh0LABYutwBmzc/PWzjz5+zsrAwPD2drgAMDAwaU73kzgBwKFJ1wOOwEg0FHr8E1B4AOdGvrsVjMwlyGhoZyNUCgG1i05+bm6AYP1FzTQte4TjepFwwqXe5Zi4uLAg7zNUCgGyDfTqVSks1mnJOTE9na2pKDgwPFZS6Xk+PjYymBz/W1NQHnAmvV2s3NjcVznZ2dj4C4xUgmU3YmkxXTrDhmpSqZbE5OTk7l/LzINTktnMl5sSSHR8eSXl1TwnmhcGbt7u7D6vlHwGRq1SiWKvYXX34lb9/96Hz/9gf59rt38ubNN/L69dfy08+/yCcXVwAtSqlclUr1QszKhZrjnHX12eeys7v/COjz+Y1YPG6Ti1Ao7ESiUQmHIxKJRJESIVmKxSSRWJZ4PKEkFourkfrYt5Jw2TBmvRz6/T4bUZNMJuPs7+8r/iivXuUFFaB4Y64yMBz5P51OMVdVUHp6evKeKE9MTNg8mM1mHQbi5cuMbG9v8wJBHioQRprCgKCSAJiWUqlkLS0tSX9//yMgygoW+u01RDCfzzt7e3tydHQkZ2dnwoizUhKJhALRoEgTWV9fl9vbW2tnZ0e6u7vz9ZXCxLaZoEzmSCTCUQnnXK+3UOck15nY1ANGIyATFt2HVaKAtNBFDaSBCUj9eDz+PCAUbdYkLQSooE4JrgT81tzVgBypz5qnDgLrjTKDQmvAo0Oy2Xn0uLm5yYMet3kBrGMQVVDQDxqjTOLRphwooTpMFRCmEOeMON2sB2QQsWfxnCfKbrdRLsNKxSFdpsXkiRzRLTYDnYc6KNiz3PbldRnKKspsWwTRHFKZFxCUc7fDqJE67IkckehelwlIAPDhMMGZ/eSG7hCQka5vZwTnGnQUh8hlLyATm4dZKeVymRUgHK+vr1VgWGo6ulrII9qcxeA0lB4y304mkyooBOJbQlDe/hyYBkQGWEhu6e3t9ZYezFfNAVF12FxpFUuQa0/dre/ifGvoWUMe4qeizPeCESQIrSD5DBb3nnJIbvkENASFlcI8ZHQRED4+4gZIJS9d4h5d5GUUt0pUUJgBnrSpbw7MQ4LpXOSc+ajLkMC67LiObOBT2gjIWqYrbA6623DUoLT2oaOHaoCcM7EbAOufUb63miP3v5rXi17jyMTmxQ0capfBl0NreCstIocEZsfR/OnSo/VINcWhpzloQJdoR3NFUBLPg641SpgBupbZvp4NCjmkAktPc+VGUfHJCxht7pES10KHDZZ6TzkMAOwvWGgj7/iNc4+5kufm0L3HBWoO/fe8HJWWq0/soP4so0VsDrSIrunPtnrhOl0nv/wMYVCAcVoDxIvVB9J/hdu/48Adbr7D/A5r/yoAvoP+bzDmD9CW0O5yaG5qavqgubn5I8zbKZi3t7a2tre0tPyjuLo80wZp6ejoeLAQJeX5Vm5ra/vP39ddXV1q/BsmDAMN9eNyCgAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"view\"\n        title=\"view\"\n        src=\"/static/971dcc113e039a7b7a1e599834aab1b8/719ca/view.png\"\n        srcset=\"/static/971dcc113e039a7b7a1e599834aab1b8/9ec3c/view.png 200w,\n/static/971dcc113e039a7b7a1e599834aab1b8/c7805/view.png 400w,\n/static/971dcc113e039a7b7a1e599834aab1b8/719ca/view.png 490w\"\n        sizes=\"(max-width: 490px) 100vw, 490px\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n<p>Hit ⇧⌘5 to open the screenshot utility and select whole screen or screen\nselection. Be sure to open the <em>Options</em> menu and ensure there is a microphone\nselected.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto;  max-width: 800px;\"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/336df57fe7722935c641a72f290a80b4/8e724/util.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 62.5%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAYAAACpUE5eAAAACXBIWXMAABYlAAAWJQFJUiTwAAACIklEQVQ4y31STW/TQBD1lapIlNqJv+21nfgjTpy0dr5IGkSaRgkHiOBAJJAQEhKnSogTB47AhQsHfkAP/M7HzjYxaVo4PI1nvfN25s2T8uIETy4GGI1GCMMQQRDAtm0YhgHTNAUsyxI5YwxRFMH3fXG3VqshjELU67Uyl9I0QbvTRLPZFBcrlYpAtVq9BTpXFKWMf/9RjQLHcSCFcQLHZXB4V3SgqmqJbcHu2b9A92gyiTprpCniOEar1RJIeb6NNIamabeI78oFYZZlaLfbSJKkBJHHSSwI6VvX9ZJgt+td0pKQCEjoRqNRCk4I/EAsyHXdG8XU7X87dF0bLtfO5pukbVKBruowNB0qv6RwsWkBvV4P4/EYNBFtfL/LkjAImCB0LE5qXttjH7IsYzabYbVaoSgKYSVVrYrHNW3TNScUW46iOpjH4PkeGB/PYx487xrkOxqZbDIcDjGfz5HnuXjk4bF8E7IC0+IdGoa+8dHdoFEUpYLJZILFYolutwfm2DhthhgWGfJ2KmJWN5EEnHAr6lbsEqTNxrSyfIzz6RTr9RqL5VPEXKbVtIv3Ly/w89tnfPn0AZevuvh6uYSkKLIQfR+6YUM3XViOD5vj7PE5nj1/gf5wBN+xUAQWkuoRfv34jt9XVzhrmfj4+hEkMjBZhiKZnLxHyIsBTvI+Wp0CWaeLzmmfxxxBPQLj26wc3IPz4BCDvMDbN++gHB5AP7qPP6WbcD5hk10yAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"util\"\n        title=\"util\"\n        src=\"/static/336df57fe7722935c641a72f290a80b4/8ff1e/util.png\"\n        srcset=\"/static/336df57fe7722935c641a72f290a80b4/9ec3c/util.png 200w,\n/static/336df57fe7722935c641a72f290a80b4/c7805/util.png 400w,\n/static/336df57fe7722935c641a72f290a80b4/8ff1e/util.png 800w,\n/static/336df57fe7722935c641a72f290a80b4/6ff5e/util.png 1200w,\n/static/336df57fe7722935c641a72f290a80b4/2f950/util.png 1600w,\n/static/336df57fe7722935c641a72f290a80b4/8e724/util.png 2880w\"\n        sizes=\"(max-width: 800px) 100vw, 800px\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n<p>Record!</p>",
            "url": "https://adamyonk.com/posts/2018/12/29/screencasting-using-quicktime",
            "title": "Screencasting Using QuickTime",
            "date_modified": "2018-12-29T16:13:31.000Z"
        },
        {
            "id": "afe916b1-1136-5ffd-8533-c35514e9e4aa",
            "content_html": "<p>Rails is great, webpack is great, abstractions are not always great.</p>\n<p>I'm going to start this from a pretty vanilla Rails 5 setup, I started with <code class=\"language-text\">rails new webpacked --webpack</code>.</p>\n<p>Also, for this to work, you'll need webpack > 4.3.0.</p>\n<h2>Remove the webpacker things</h2>\n<p>Remove <code class=\"language-text\">sass-rails</code>, <code class=\"language-text\">uglifier</code>, <code class=\"language-text\">coffee-rails</code>, <code class=\"language-text\">turbolinks</code>, <code class=\"language-text\">webpacker</code> from Gemfile.</p>\n<p>Remove <code class=\"language-text\">config.webpacker.check_yarn_integrity</code> settings in config/envronments.</p>\n<p>Change <code class=\"language-text\">javascript_pack_tag</code> and <code class=\"language-text\">stylesheet_pack_tag</code> to <code class=\"language-text\">javascript_include_tag</code> and <code class=\"language-text\">stylesheet_link_tag</code>.</p>\n<p>Then:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">$ <span class=\"token function\">rm</span> -r bin/webpack config/webpack* public/packs\n$ bundle\n$ <span class=\"token function\">yarn</span> uninstall @rails/webpacker webpack-dev-server</code></pre></div>\n<h2>Disable sprockets</h2>\n<div class=\"gatsby-highlight has-highlighted-lines\" data-language=\"ruby\"><pre class=\"language-ruby\"><code class=\"language-ruby\"><span class=\"token comment\"># config/environments/development.rb</span>\n<span class=\"token constant\">Rails</span><span class=\"token punctuation\">.</span>application<span class=\"token punctuation\">.</span>configure <span class=\"token keyword\">do</span>\n  …\n<span class=\"gatsby-highlight-code-line\">  config<span class=\"token punctuation\">.</span>assets<span class=\"token punctuation\">.</span>compile <span class=\"token operator\">=</span> <span class=\"token keyword\">false</span></span>  …\n<span class=\"token keyword\">end</span></code></pre></div>\n<h2>Install dependencies</h2>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">$ <span class=\"token function\">mkdir</span> public/assets\n$ <span class=\"token function\">touch</span> public/assets/.keep\n$ <span class=\"token function\">yarn</span> <span class=\"token function\">add</span> --dev webpack webpack-<span class=\"token punctuation\">{</span>cli,dev-server<span class=\"token punctuation\">}</span></code></pre></div>\n<p>Check <code class=\"language-text\">/public/assets</code> into git, then Add <code class=\"language-text\">/public/assets</code> to your <code class=\"language-text\">.gitignore</code>. This is where we're going to build assets to for production.</p>\n<h2>Add build scripts</h2>\n<div class=\"gatsby-highlight has-highlighted-lines\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token comment\">// package.json</span>\n<span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"name\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"webpacked\"</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"private\"</span><span class=\"token operator\">:</span> <span class=\"token boolean\">true</span><span class=\"token punctuation\">,</span>\n<span class=\"gatsby-highlight-code-line\">  <span class=\"token property\">\"scripts\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span></span><span class=\"gatsby-highlight-code-line\">    <span class=\"token property\">\"server\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"webpack-dev-server\"</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">    <span class=\"token property\">\"precompile\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"rm -r public/assets/* &amp;&amp; NODE_ENV=production webpack\"</span></span><span class=\"gatsby-highlight-code-line\">  <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span></span>  <span class=\"token property\">\"dependencies\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"devDependencies\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token property\">\"webpack\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"^4.5.0\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token property\">\"webpack-cli\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"^2.0.13\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token property\">\"webpack-dev-server\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"^3.1.1\"</span>\n  <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<h2>Add a simple webpack config</h2>\n<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token comment\">// webpack.config.js</span>\n<span class=\"token keyword\">const</span> <span class=\"token constant\">DIR</span> <span class=\"token operator\">=</span> <span class=\"token function\">require</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"path\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">.</span><span class=\"token function\">resolve</span><span class=\"token punctuation\">(</span>__dirname<span class=\"token punctuation\">)</span>\n<span class=\"token keyword\">const</span> <span class=\"token constant\">PROD</span> <span class=\"token operator\">=</span> process<span class=\"token punctuation\">.</span>env<span class=\"token punctuation\">.</span><span class=\"token constant\">NODE_ENV</span> <span class=\"token operator\">===</span> <span class=\"token string\">\"production\"</span>\n\nmodule<span class=\"token punctuation\">.</span>exports <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span>\n  entry<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span>\n    application<span class=\"token punctuation\">:</span> <span class=\"token template-string\"><span class=\"token template-punctuation string\">`</span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span><span class=\"token constant\">DIR</span><span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token string\">/app/assets/javascripts/application.js</span><span class=\"token template-punctuation string\">`</span></span><span class=\"token punctuation\">,</span>\n  <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n  mode<span class=\"token punctuation\">:</span> <span class=\"token constant\">PROD</span> <span class=\"token operator\">?</span> <span class=\"token string\">\"production\"</span> <span class=\"token punctuation\">:</span> <span class=\"token string\">\"development\"</span><span class=\"token punctuation\">,</span>\n  output<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span>\n    chunkFilename<span class=\"token punctuation\">:</span> <span class=\"token string\">\"[name].js\"</span><span class=\"token punctuation\">,</span>\n    filename<span class=\"token punctuation\">:</span> <span class=\"token string\">\"[name].js\"</span><span class=\"token punctuation\">,</span>\n    path<span class=\"token punctuation\">:</span> <span class=\"token template-string\"><span class=\"token template-punctuation string\">`</span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span><span class=\"token constant\">DIR</span><span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token string\">public/assets/</span><span class=\"token template-punctuation string\">`</span></span><span class=\"token punctuation\">,</span>\n  <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n  resolve<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span>\n    extensions<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span><span class=\"token string\">\".js\"</span><span class=\"token punctuation\">,</span> <span class=\"token string\">\".json\"</span><span class=\"token punctuation\">,</span> <span class=\"token string\">\".css\"</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n    modules<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span><span class=\"token string\">\"node_modules\"</span><span class=\"token punctuation\">,</span> <span class=\"token template-string\"><span class=\"token template-punctuation string\">`</span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span><span class=\"token constant\">DIR</span><span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token string\">/app/assets</span><span class=\"token template-punctuation string\">`</span></span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n  <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>Now start the wepback dev server:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">$ <span class=\"token function\">yarn</span> server\nℹ ｢wds｣: Project is running at http://localhost:8080/\nℹ ｢wds｣: webpack output is served from /\nℹ ｢wdm｣: Hash: ee01dba8920628636a4e\nℹ ｢wdm｣: Compiled successfully.</code></pre></div>\n<p>Go to <a href=\"http://localhost:8080/application.js\">http://localhost:8080/application.js</a> and you should be able to see the compiled webpack bundle.</p>\n<h2>Compile CSS</h2>\n<p>Add the necessary webpack loaders:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">$ <span class=\"token function\">yarn</span> <span class=\"token function\">add</span> -D <span class=\"token punctuation\">{</span>file,extract,css,postcss<span class=\"token punctuation\">}</span>-loader cssnano</code></pre></div>\n<p>And then set up a rule for them:</p>\n<div class=\"gatsby-highlight has-highlighted-lines\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token comment\">// webpack.config.js</span>\nmodule<span class=\"token punctuation\">.</span>exports <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span>\n  …\n<span class=\"gatsby-highlight-code-line\">  module<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span></span><span class=\"gatsby-highlight-code-line\">    rules<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span></span><span class=\"gatsby-highlight-code-line\">      <span class=\"token punctuation\">{</span></span><span class=\"gatsby-highlight-code-line\">        test<span class=\"token punctuation\">:</span> <span class=\"token regex\">/\\.css/</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">        use<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span></span><span class=\"gatsby-highlight-code-line\">          <span class=\"token punctuation\">{</span></span><span class=\"gatsby-highlight-code-line\">            loader<span class=\"token punctuation\">:</span> <span class=\"token string\">\"file-loader\"</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">            options<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span></span><span class=\"gatsby-highlight-code-line\">              name<span class=\"token punctuation\">:</span> <span class=\"token string\">\"[name].css\"</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">            <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">          <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">          <span class=\"token punctuation\">{</span> loader<span class=\"token punctuation\">:</span> <span class=\"token string\">\"extract-loader\"</span> <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">          <span class=\"token punctuation\">{</span> loader<span class=\"token punctuation\">:</span> <span class=\"token string\">\"css-loader\"</span> <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">          <span class=\"token punctuation\">{</span></span><span class=\"gatsby-highlight-code-line\">            loader<span class=\"token punctuation\">:</span> <span class=\"token string\">\"postcss-loader\"</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">            options<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span></span><span class=\"gatsby-highlight-code-line\">              ident<span class=\"token punctuation\">:</span> <span class=\"token string\">\"postcss\"</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">              <span class=\"token function-variable function\">plugins</span><span class=\"token punctuation\">:</span> <span class=\"token parameter\">loader</span> <span class=\"token operator\">=></span> <span class=\"token punctuation\">[</span></span><span class=\"gatsby-highlight-code-line\">                <span class=\"token function\">require</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"cssnano\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span></span><span class=\"gatsby-highlight-code-line\">                  discardComments<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span> removeAll<span class=\"token punctuation\">:</span> <span class=\"token boolean\">true</span> <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">                <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">              <span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">            <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">          <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">        <span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">      <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">    <span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">  <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span></span>  …\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span></code></pre></div>\n<p>Now, in your JavaScript files, you can require stylesheets like so:</p>\n<div class=\"gatsby-highlight has-highlighted-lines\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token comment\">// app/assets/javascripts/application.js</span>\n<span class=\"gatsby-highlight-code-line\"><span class=\"token function\">require</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"stylesheets/application.css\"</span><span class=\"token punctuation\">)</span></span>\nconsole<span class=\"token punctuation\">.</span><span class=\"token function\">log</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"Hello from application.js!\"</span><span class=\"token punctuation\">)</span></code></pre></div>\n<h2>Tell Rails where to find assets from webpack-dev-server</h2>\n<p>Now if you load up your site, you're probably seeing something like:\n<code class=\"language-text\">Sprockets::Rails::Helper::AssetNotFound in Welcome#index</code></p>\n<p>Add this helper to <code class=\"language-text\">app/helpers/application_helper.rb</code>:</p>\n<div class=\"gatsby-highlight has-highlighted-lines\" data-language=\"ruby\"><pre class=\"language-ruby\"><code class=\"language-ruby\"><span class=\"token comment\"># app/helpers/application_helper.rb</span>\n<span class=\"token keyword\">module</span> <span class=\"token constant\">ApplicationHelper</span>\n<span class=\"gatsby-highlight-code-line\">  <span class=\"token keyword\">def</span> <span class=\"token method-definition\"><span class=\"token function\">webpack_asset_url</span></span><span class=\"token punctuation\">(</span>name<span class=\"token punctuation\">)</span></span><span class=\"gatsby-highlight-code-line\">    <span class=\"token string\">\"http://localhost:8080/<span class=\"token interpolation\"><span class=\"token delimiter tag\">#{</span>name<span class=\"token delimiter tag\">}</span></span>\"</span></span><span class=\"gatsby-highlight-code-line\">  <span class=\"token keyword\">end</span></span><span class=\"token keyword\">end</span></code></pre></div>\n<p>Then wrap the paths of any assets you're including in that helper, and don't forget the extensions:</p>\n<div class=\"gatsby-highlight has-highlighted-lines\" data-language=\"html\"><pre class=\"language-html\"><code class=\"language-html\"><span class=\"token comment\">&lt;!-- app/views/layouts/application.html.erb --></span>\n<span class=\"token doctype\">&lt;!DOCTYPE html></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>html</span><span class=\"token punctuation\">></span></span>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>head</span><span class=\"token punctuation\">></span></span>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>title</span><span class=\"token punctuation\">></span></span>Webpacked<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>title</span><span class=\"token punctuation\">></span></span>\n    &lt;%= csrf_meta_tags %> &lt;%= stylesheet_link_tag\n    webpack_asset_url('application.css'), media: 'all' %> &lt;%=\n<span class=\"gatsby-highlight-code-line\">    javascript_include_tag webpack_asset_url('application.js') %></span><span class=\"gatsby-highlight-code-line\">  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>head</span><span class=\"token punctuation\">></span></span></span>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>body</span><span class=\"token punctuation\">></span></span>\n    &lt;%= yield %>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>body</span><span class=\"token punctuation\">></span></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>html</span><span class=\"token punctuation\">></span></span></code></pre></div>\n<h2>Building for production</h2>\n<p>But wait, production! We need to tell Rails to serve the static assets in production:</p>\n<div class=\"gatsby-highlight has-highlighted-lines\" data-language=\"ruby\"><pre class=\"language-ruby\"><code class=\"language-ruby\"><span class=\"token comment\"># app/helpers/application_helper.rb</span>\n<span class=\"token keyword\">module</span> <span class=\"token constant\">ApplicationHelper</span>\n  <span class=\"token keyword\">def</span> <span class=\"token method-definition\"><span class=\"token function\">webpack_asset_url</span></span><span class=\"token punctuation\">(</span>name<span class=\"token punctuation\">)</span>\n<span class=\"gatsby-highlight-code-line\">    <span class=\"token keyword\">if</span> <span class=\"token constant\">Rails</span><span class=\"token punctuation\">.</span>env<span class=\"token punctuation\">.</span>production<span class=\"token operator\">?</span></span><span class=\"gatsby-highlight-code-line\">      <span class=\"token string\">\"/assets/<span class=\"token interpolation\"><span class=\"token delimiter tag\">#{</span>name<span class=\"token delimiter tag\">}</span></span>\"</span></span><span class=\"gatsby-highlight-code-line\">    <span class=\"token keyword\">else</span></span><span class=\"gatsby-highlight-code-line\">      <span class=\"token string\">\"http://localhost:8080/<span class=\"token interpolation\"><span class=\"token delimiter tag\">#{</span>name<span class=\"token delimiter tag\">}</span></span>\"</span></span><span class=\"gatsby-highlight-code-line\">    <span class=\"token keyword\">end</span></span>  <span class=\"token keyword\">end</span>\n<span class=\"token keyword\">end</span></code></pre></div>\n<p>You can test this by precompiling the assets and then restarting your Rails server in production mode:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">$ <span class=\"token function\">yarn</span> precompile <span class=\"token operator\">&amp;&amp;</span> <span class=\"token punctuation\">\\</span>\n  <span class=\"token assign-left variable\">RAILS_ENV</span><span class=\"token operator\">=</span>production <span class=\"token punctuation\">\\</span>\n  <span class=\"token assign-left variable\">RAILS_SERVE_STATIC_FILES</span><span class=\"token operator\">=</span>true <span class=\"token punctuation\">\\</span>\n  <span class=\"token assign-left variable\">SECRET_KEY_BASE</span><span class=\"token operator\">=</span>hi <span class=\"token punctuation\">\\</span>\n  bin/rails server</code></pre></div>\n<h2>Fingerprinting assets</h2>\n<p>But wait, asset fingerprinting! Change the output filename for CSS and entrypoints:</p>\n<div class=\"gatsby-highlight has-highlighted-lines\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token comment\">// webpack.config.js</span>\nmodule<span class=\"token punctuation\">.</span>exports <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span>\n  …\n  module<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span>\n    rules<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span>\n      <span class=\"token punctuation\">{</span>\n        test<span class=\"token punctuation\">:</span> <span class=\"token regex\">/\\.css/</span><span class=\"token punctuation\">,</span>\n        use<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span>\n          <span class=\"token punctuation\">{</span>\n            loader<span class=\"token punctuation\">:</span> <span class=\"token string\">\"file-loader\"</span><span class=\"token punctuation\">,</span>\n            options<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span>\n<span class=\"gatsby-highlight-code-line\">              name<span class=\"token punctuation\">:</span> <span class=\"token constant\">PROD</span> <span class=\"token operator\">?</span> <span class=\"token string\">\"[name]-[hash].css\"</span> <span class=\"token punctuation\">:</span> <span class=\"token string\">\"[name].css\"</span><span class=\"token punctuation\">,</span></span>            <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n          <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n          <span class=\"token punctuation\">{</span> loader<span class=\"token punctuation\">:</span> <span class=\"token string\">\"extract-loader\"</span> <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n          <span class=\"token punctuation\">{</span> loader<span class=\"token punctuation\">:</span> <span class=\"token string\">\"css-loader\"</span> <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n          <span class=\"token punctuation\">{</span>\n            loader<span class=\"token punctuation\">:</span> <span class=\"token string\">\"postcss-loader\"</span><span class=\"token punctuation\">,</span>\n            options<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span>\n              ident<span class=\"token punctuation\">:</span> <span class=\"token string\">\"postcss\"</span><span class=\"token punctuation\">,</span>\n              <span class=\"token function-variable function\">plugins</span><span class=\"token punctuation\">:</span> <span class=\"token parameter\">loader</span> <span class=\"token operator\">=></span> <span class=\"token punctuation\">[</span>\n                <span class=\"token function\">require</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"cssnano\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span>\n                  discardComments<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span> removeAll<span class=\"token punctuation\">:</span> <span class=\"token boolean\">true</span> <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n                <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">,</span>\n              <span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n            <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n          <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n        <span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n      <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n    <span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n  <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n  output<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span>\n<span class=\"gatsby-highlight-code-line\">    chunkFilename<span class=\"token punctuation\">:</span> <span class=\"token constant\">PROD</span> <span class=\"token operator\">?</span> <span class=\"token string\">\"[name]-[contenthash].js\"</span> <span class=\"token punctuation\">:</span> <span class=\"token string\">\"[name].js\"</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">    filename<span class=\"token punctuation\">:</span> <span class=\"token constant\">PROD</span> <span class=\"token operator\">?</span> <span class=\"token string\">\"[name]-[contenthash].js\"</span> <span class=\"token punctuation\">:</span> <span class=\"token string\">\"[name].js\"</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">    hashDigestLength<span class=\"token punctuation\">:</span> <span class=\"token number\">32</span><span class=\"token punctuation\">,</span></span>    path<span class=\"token punctuation\">:</span> <span class=\"token template-string\"><span class=\"token template-punctuation string\">`</span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${</span><span class=\"token constant\">DIR</span><span class=\"token interpolation-punctuation punctuation\">}</span></span><span class=\"token string\">public/assets/</span><span class=\"token template-punctuation string\">`</span></span><span class=\"token punctuation\">,</span>\n  <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span>\n  …\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>Now we need to tell Rails about these hashes somehow. First, we'll add the webpack-manifest-plugin (when building for production) to output a JSON map of the names of chunks to their hashed names:</p>\n<div class=\"gatsby-highlight has-highlighted-lines\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token comment\">// webpack.config.js</span>\nmodule<span class=\"token punctuation\">.</span>exports <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span>\n  …\n<span class=\"gatsby-highlight-code-line\">  plugins<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span></span><span class=\"gatsby-highlight-code-line\">    <span class=\"token constant\">PROD</span> <span class=\"token operator\">&amp;&amp;</span> <span class=\"token keyword\">new</span> <span class=\"token punctuation\">(</span><span class=\"token function\">require</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"webpack-manifest-plugin\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span></span><span class=\"gatsby-highlight-code-line\">  <span class=\"token punctuation\">]</span><span class=\"token punctuation\">.</span><span class=\"token function\">filter</span><span class=\"token punctuation\">(</span>Boolean<span class=\"token punctuation\">)</span><span class=\"token punctuation\">,</span></span>  …\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span></code></pre></div>\n<p>If you <code class=\"language-text\">yarn precompile</code> again, you should see it output a file like this, in addition to the other chunks:</p>\n<div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token comment\">// public/assets/manifest.json</span>\n<span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"application.css\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"application-4cf6c42fe4e9a27ee5a758dcf37091f7.css\"</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"application.js\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"application-5689a742f9b3cb6758a6b35164a98ade.js\"</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>Now let's update the Rails helper to get everything sorted out:</p>\n<div class=\"gatsby-highlight has-highlighted-lines\" data-language=\"ruby\"><pre class=\"language-ruby\"><code class=\"language-ruby\"><span class=\"token comment\"># app/helpers/application_helper.rb</span>\n<span class=\"token keyword\">module</span> <span class=\"token constant\">ApplicationHelper</span>\n  <span class=\"token keyword\">def</span> <span class=\"token method-definition\"><span class=\"token function\">webpack_asset_url</span></span><span class=\"token punctuation\">(</span>name<span class=\"token punctuation\">)</span>\n    <span class=\"token keyword\">if</span> <span class=\"token constant\">Rails</span><span class=\"token punctuation\">.</span>env<span class=\"token punctuation\">.</span>production<span class=\"token operator\">?</span>\n<span class=\"gatsby-highlight-code-line\">      <span class=\"token string\">\"/assets/<span class=\"token interpolation\"><span class=\"token delimiter tag\">#{</span>webpack_fingerprint_for<span class=\"token punctuation\">(</span>name<span class=\"token punctuation\">)</span><span class=\"token delimiter tag\">}</span></span>\"</span></span>    <span class=\"token keyword\">else</span>\n      <span class=\"token string\">\"http://localhost:8080/<span class=\"token interpolation\"><span class=\"token delimiter tag\">#{</span>name<span class=\"token delimiter tag\">}</span></span>\"</span>\n    <span class=\"token keyword\">end</span>\n  <span class=\"token keyword\">end</span>\n\n<span class=\"gatsby-highlight-code-line\">  <span class=\"token keyword\">def</span> <span class=\"token method-definition\"><span class=\"token function\">webpack_fingerprint_for</span></span><span class=\"token punctuation\">(</span>name<span class=\"token punctuation\">)</span></span><span class=\"gatsby-highlight-code-line\">    <span class=\"token variable\">@chunk_manifest</span> <span class=\"token operator\">||</span><span class=\"token operator\">=</span> <span class=\"token constant\">JSON</span><span class=\"token punctuation\">.</span>parse<span class=\"token punctuation\">(</span><span class=\"token builtin\">File</span><span class=\"token punctuation\">.</span>read<span class=\"token punctuation\">(</span><span class=\"token string\">'public/assets/manifest.json'</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span></span><span class=\"gatsby-highlight-code-line\">    <span class=\"token keyword\">if</span> <span class=\"token variable\">@chunk_manifest</span><span class=\"token punctuation\">[</span>name<span class=\"token punctuation\">]</span><span class=\"token punctuation\">.</span><span class=\"token keyword\">nil</span><span class=\"token operator\">?</span></span><span class=\"gatsby-highlight-code-line\">      logger<span class=\"token punctuation\">.</span>error <span class=\"token string\">\"chunk_manifest_missing name=<span class=\"token interpolation\"><span class=\"token delimiter tag\">#{</span>name<span class=\"token delimiter tag\">}</span></span>\"</span></span><span class=\"gatsby-highlight-code-line\">      logger<span class=\"token punctuation\">.</span>error <span class=\"token variable\">@chunk_manifest</span><span class=\"token punctuation\">.</span>inspect</span><span class=\"gatsby-highlight-code-line\">    <span class=\"token keyword\">end</span></span><span class=\"gatsby-highlight-code-line\">    <span class=\"token variable\">@chunk_manifest</span><span class=\"token punctuation\">[</span>name<span class=\"token punctuation\">]</span></span><span class=\"gatsby-highlight-code-line\">  <span class=\"token keyword\">end</span></span><span class=\"token keyword\">end</span></code></pre></div>\n<p>You might have to restart the Rails server again, but now you should see it loading the fingerprinted assets! Now wherever you run <code class=\"language-text\">rake assets:precompile</code> during your deployment process, replace it with <code class=\"language-text\">yarn precompile</code>.</p>\n<h2>Separate the webpack runtime</h2>\n<p>For better caching, it's smart to separate the webpack runtime from your application's JavaScript:</p>\n<div class=\"gatsby-highlight has-highlighted-lines\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token comment\">// webpack.config.js</span>\nmodule<span class=\"token punctuation\">.</span>exports <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span>\n  …\n<span class=\"gatsby-highlight-code-line\">  optimization<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span></span><span class=\"gatsby-highlight-code-line\">    runtimeChunk<span class=\"token punctuation\">:</span> <span class=\"token string\">\"single\"</span><span class=\"token punctuation\">,</span></span><span class=\"gatsby-highlight-code-line\">  <span class=\"token punctuation\">}</span><span class=\"token punctuation\">,</span></span>  …\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span></code></pre></div>\n<p>Then just include that <code class=\"language-text\">runtime</code> chunk before any other JavaScript:</p>\n<div class=\"gatsby-highlight has-highlighted-lines\" data-language=\"html\"><pre class=\"language-html\"><code class=\"language-html\"><span class=\"token comment\">&lt;!-- app/views/layouts/application.html.erb --></span>\n<span class=\"token doctype\">&lt;!DOCTYPE html></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>html</span><span class=\"token punctuation\">></span></span>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>head</span><span class=\"token punctuation\">></span></span>\n    <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>title</span><span class=\"token punctuation\">></span></span>Webpacked<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>title</span><span class=\"token punctuation\">></span></span>\n    &lt;%= csrf_meta_tags %> &lt;%= stylesheet_link_tag\n    webpack_asset_url('application.css'), media: 'all' %> &lt;%=\n    javascript_include_tag webpack_asset_url('runtime.js') %> &lt;%=\n<span class=\"gatsby-highlight-code-line\">    javascript_include_tag webpack_asset_url('application.js') %></span>  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>head</span><span class=\"token punctuation\">></span></span>\n\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>body</span><span class=\"token punctuation\">></span></span>\n    &lt;%= yield %>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>body</span><span class=\"token punctuation\">></span></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>html</span><span class=\"token punctuation\">></span></span></code></pre></div>",
            "url": "https://adamyonk.com/posts/2018/04/04/rails-webpack-webpacker",
            "title": "Rails + webpack - webpacker",
            "date_modified": "2018-04-04T21:06:50.000Z"
        },
        {
            "id": "9eacdb74-bf82-5f55-8657-ee459cc23527",
            "content_html": "<p>I just fixed an issue where a dependency (lodash) was leaking out as a global\nin a CoffeeScript project. The solution to that was to use\n<a href=\"https://lodash.com/docs/4.17.5#noConflict\"><code class=\"language-text\">_.noConflict</code></a>, but over the years\nof this project's life, developers had started accidentally using lodash utils\nwithout actually requiring lodash in the file.</p>\n<p>Unfortunately, the <code class=\"language-text\">coffeelint</code> tool doesn't seem to have a <code class=\"language-text\">no-undef</code> rule\nsimilar to eslint, so these sort of fell through the cracks. I came up with\nthis method to check our source code for missing requires:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">$ ag <span class=\"token string\">'_[.( ]'</span> coffee --files-with-matches <span class=\"token operator\">|</span> <span class=\"token punctuation\">\\</span>\n  <span class=\"token function\">xargs</span> ag <span class=\"token string\">'(?s).*lodash.*'</span> --files-without-matches</code></pre></div>\n<p>And for a bonus, just flip the matchers to check for files with extraneous\nrequires:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">$ ag <span class=\"token string\">'_[.( ]'</span> coffee --files-without-matches <span class=\"token operator\">|</span> <span class=\"token punctuation\">\\</span>\n  <span class=\"token function\">xargs</span> ag <span class=\"token string\">'(?s).*lodash.*'</span> --files-with-matches</code></pre></div>",
            "url": "https://adamyonk.com/posts/2018/04/06/coffeescript-dependency-checking",
            "title": "CoffeeScript Dependency Checking",
            "date_modified": "2018-04-04T21:06:49.000Z"
        },
        {
            "id": "68250486-046c-5bb4-83bc-cf968a18e862",
            "content_html": "<p>After hearing lots of stories about the large performance\nimprovements of the webpack 4 beta, when the final release came out, I was\neager to migrate our project from v3.</p>\n<p>webpack’s configuration can be difficult to understand anyway, and\nunfortunately, the webpack team was <a href=\"https://twitter.com/TheLarkInn/status/968235747219161088\">trying to hit a\ndeadline</a> and was\nunable to write any migration documentation before the v4 release. Lucky for\nyou, we decided to push through anyway, and we took notes!</p>\n<p>For more info about the release, check out:</p>\n<ul>\n<li>The <a href=\"https://medium.com/webpack/webpack-4-released-today-6cdb994702d4\">webpack 4 announcement\npost</a> on\nMedium</li>\n<li>The <a href=\"https://github.com/webpack/webpack/releases/tag/v4.0.0\">v4.0.0 tag release\nnotes</a> on GitHub</li>\n</ul>\n<h2>Upgrade node to 8.9.4</h2>\n<p>To get the best performance out of v4, <a href=\"https://twitter.com/wSokra/status/967852475918274561\">@wSokra\nsays</a> use at least node\n8.9.4.</p>\n<h2>Upgrade webpack</h2>\n<p>webpack’s core functionality and CLI code have been split into two repos now:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">$ <span class=\"token function\">npm</span> i -D webpack webpack-cli</code></pre></div>\n<h2>Use a mode</h2>\n<p>You may see an error like: <code class=\"language-text\">The &#39;mode&#39; option has not been set. Set &#39;mode&#39; option to &#39;development&#39; or &#39;production&#39; to enable defaults for this environment.</code></p>\n<p>In v4, you have to set a mode in your config:</p>\n<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token punctuation\">{</span>\n  mode<span class=\"token punctuation\">:</span> <span class=\"token string\">\"production\"</span><span class=\"token punctuation\">,</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>It can also be set when invoked from CLI:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">$ webpack --mode production</code></pre></div>\n<h2>Change CommonsChunkPlugin to splitChunks</h2>\n<p>You may see an error like: <code class=\"language-text\">Error: webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks instead.</code></p>\n<blockquote>\n<p>The CommonsChunkPlugin is an opt-in feature that creates a separate file\n(known as a chunk), consisting of common modules shared between multiple entry\npoints.</p>\n</blockquote>\n<p>This functionality has moved from the CommonsChunkPlugin to the\n<code class=\"language-text\">optimization.splitChunks</code> setting.</p>\n<p>Previously in v3, we used runtime and vendor chunks like so:</p>\n<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token punctuation\">{</span>\n  plugins<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span>\n    <span class=\"token keyword\">new</span> <span class=\"token class-name\">webpack<span class=\"token punctuation\">.</span>optimize<span class=\"token punctuation\">.</span>CommonsChunkPlugin</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span>\n      name<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span><span class=\"token string\">\"runtime\"</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n      minChunks<span class=\"token punctuation\">:</span> <span class=\"token number\">Infinity</span><span class=\"token punctuation\">,</span>\n    <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">,</span>\n    <span class=\"token keyword\">new</span> <span class=\"token class-name\">webpack<span class=\"token punctuation\">.</span>optimize<span class=\"token punctuation\">.</span>CommonsChunkPlugin</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span>\n      name<span class=\"token punctuation\">:</span> <span class=\"token string\">\"vendor\"</span><span class=\"token punctuation\">,</span>\n      <span class=\"token function-variable function\">minChunks</span><span class=\"token punctuation\">:</span> <span class=\"token punctuation\">(</span><span class=\"token parameter\"><span class=\"token punctuation\">{</span> resource <span class=\"token punctuation\">}</span></span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token regex\">/node_modules/</span><span class=\"token punctuation\">.</span><span class=\"token function\">test</span><span class=\"token punctuation\">(</span>resource<span class=\"token punctuation\">)</span><span class=\"token punctuation\">,</span>\n    <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">,</span>\n  <span class=\"token punctuation\">]</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>In v4, this roughly translates to:</p>\n<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token punctuation\">{</span>\n  optimization<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span>\n    runtimeChunk<span class=\"token punctuation\">:</span> <span class=\"token string\">\"single\"</span><span class=\"token punctuation\">,</span> <span class=\"token comment\">// enable \"runtime\" chunk</span>\n    splitChunks<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span>\n      cacheGroups<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span>\n        vendor<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span>\n          test<span class=\"token punctuation\">:</span> <span class=\"token regex\">/[\\\\/]node_modules[\\\\/]/</span><span class=\"token punctuation\">,</span>\n          name<span class=\"token punctuation\">:</span> <span class=\"token string\">\"vendor\"</span><span class=\"token punctuation\">,</span>\n          chunks<span class=\"token punctuation\">:</span> <span class=\"token string\">\"all\"</span>\n        <span class=\"token punctuation\">}</span>\n      <span class=\"token punctuation\">}</span>\n    <span class=\"token punctuation\">}</span>\n  <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>More information about the new <code class=\"language-text\">optimization.splitChunks</code> option can be found\n<a href=\"https://gist.github.com/sokra/1522d586b8e5c0f5072d7565c2bee693\">here</a>.</p>\n<h2>Get rid of ModuleConcatenationPlugin</h2>\n<p>Also known as \"scope hoisting\". It is now on by default in production mode.</p>\n<h2>Change UglifyJsPlugin</h2>\n<p>You may see an error like: <code class=\"language-text\">Error: webpack.optimize.UglifyJsPlugin has been removed, please use config.optimization.minimize instead.</code></p>\n<p>v4 now handles dead code elimination internally. Both it and minimization are\non by default in production mode, but to continue tuning Uglify settings, add\n<a href=\"https://www.npmjs.com/package/uglifyjs-webpack-plugin\">uglifyjs-webpack-plugin</a>:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">$ <span class=\"token function\">npm</span> i -D uglifyjs-webpack-plugin</code></pre></div>\n<p>And in the <code class=\"language-text\">optimization.minimizer</code> section:</p>\n<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token keyword\">const</span> UglifyJsPlugin <span class=\"token operator\">=</span> <span class=\"token function\">require</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"uglifyjs-webpack-plugin\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token punctuation\">{</span>\n  optimization<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span>\n    minimizer<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span>\n      <span class=\"token keyword\">new</span> <span class=\"token class-name\">UglifyJSPlugin</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">{</span>\n        sourceMap<span class=\"token punctuation\">:</span> <span class=\"token boolean\">true</span><span class=\"token punctuation\">,</span>\n        uglifyOptions<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">{</span>\n          …\n        <span class=\"token punctuation\">}</span>\n      <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span>\n    <span class=\"token punctuation\">]</span>\n  <span class=\"token punctuation\">}</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<h2>Upgrade loaders</h2>\n<p>You may see an error like: <code class=\"language-text\">Module build failed: TypeError: Cannot read property &#39;eslint&#39; of undefined</code></p>\n<p>This happened for us with eslint-loader and file-loader. Just upgrade the loaders:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">$ <span class=\"token function\">npm</span> i -D eslint-loader file-loader</code></pre></div>",
            "url": "https://adamyonk.com/posts/2018/04/02/webpack-3-to-4",
            "title": "Migrating from webpack 3 to 4",
            "date_modified": "2018-04-02T21:06:49.000Z"
        },
        {
            "id": "917f5eae-04c0-5a92-80d5-eead101b3928",
            "content_html": "<ul>\n<li>Since Chrome's \"Bookmark All Tabs…\" shortcut defaults to ⇧⌘D (the same as Safari's \"Add to Reading List\"), change it to something else: <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto;  max-width: 800px;\"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/14ff0fb008182a7bd0d2295a23d86ace/27b78/1.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 86.97604790419162%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAARCAYAAADdRIy+AAAACXBIWXMAABYlAAAWJQFJUiTwAAACV0lEQVQ4y41Ui46qQAzl/3/Mu6y6KCIgyENBBeUV31Hp7Sk7Rm9usmty0nFoT087ndEcx32Y5oRWq1WbZRmlaUpRFJHv+zSfz8lja5ommZOJ7AGz2Uy+bbdbQsxms6HdbifQQLBcLltYJpWPsAiI45iSRURxFEqSJEkoYT8Qrddr2YNN05VYQMvzvMWCiURh0zSSyXEcJg0oTmIhjKOYwhAEGzqdTlTXDQtJRKEkSrq1BkWTiUX9fp9QOgjrupbSkcj4Mkj/0Gk4GNJ4bIqqCORBKNWgEpBxlbRescJiV1Dvo8fOI1EAIjgvFgtxRBD6hnVVV1QUBVVVJUmR/Hg80uFwECBWy7OcwihgskCCuAXSw+820H6/p7IsnxZk6JnremIfj4e04Hw6d4RbJnD8mIzRmGauK4GAKl0pApAEfQq4gsHgS3p8v9+eKiFEK7I1/YkacoIlLbj51+uV2raVg4HaMAy7MfHnTBTICUNp09Ric04AHzUdGhz6Q268/km9Xo8sayqqABCjpPv9/mb/BfxQdtdDVuG5DqF0kKBUOKAE2N/+LpdLRwiZ5/Pl7SOyoo+32+2/il4B1W8KUTtOV036K6BeXa2foOZWCNF027Z5FFy5IbDqv2VZslbAd1jsYz2dTiUec/skxAnqui6HghtjGAYP+lgGGqQAgjzPE6g9tYaf3JRvwtae2jQajVqGZFWBGAd1TxGgIHvL5LmGxUMihFk3Ry3uJAjkyXohRG/SJO3sD0C1Gg9wi3Epi1JZGVgA/9U7p4C5Rb8AKMNjAVFl1VDO78JfjdPpnANQIIcAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"1\"\n        title=\"1\"\n        src=\"/static/14ff0fb008182a7bd0d2295a23d86ace/8ff1e/1.png\"\n        srcset=\"/static/14ff0fb008182a7bd0d2295a23d86ace/9ec3c/1.png 200w,\n/static/14ff0fb008182a7bd0d2295a23d86ace/c7805/1.png 400w,\n/static/14ff0fb008182a7bd0d2295a23d86ace/8ff1e/1.png 800w,\n/static/14ff0fb008182a7bd0d2295a23d86ace/6ff5e/1.png 1200w,\n/static/14ff0fb008182a7bd0d2295a23d86ace/27b78/1.png 1336w\"\n        sizes=\"(max-width: 800px) 100vw, 800px\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></li>\n<li>Create a new Automator \"Service\": <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto;  max-width: 800px;\"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/d40edf238f36485f7e62690bac825bc9/9a004/2.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 68.35016835016835%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAOCAYAAAAvxDzwAAAACXBIWXMAABYlAAAWJQFJUiTwAAACi0lEQVQ4y2VUSW/TYBDNbwcOXDggLkgVByS4NOLCDYmqIKFSRKqipkmatHa8L0mTOF7iJbYf8740ES2WRt/kW968eTOTjm44rWXZCIKgdRwHT811Xei6jtFoBMuyYNv2I3ONKTy5w7ue56Hz4+wnzs/P216vh/F4LI81tU4mkwcbw5hOd2BipmmqALSp7Ot3d2qlGYaBzs1o0F5e9CSa0wbhDI7rwbLJxBHWvvgOlssV1us1TGEUzmYoyxJ1vUWWZbIfq7O9dSo5dB0LaZYiL0ps8gKGKem6PvidnJ5JurdYrSK8ffcZv35fy70c7z8eY2qY2Gw2EnAp5ytlnfWmhO2FSJNYDnPkciH0fSzu7xXg1XCEhTBMNwmOvhyhP71CnuXodj/B9wPFkkBRFD0AxhluJjqapkZZVEjiFGUDVE2Ltm0hG5AcIR4WlYeiyfDv54gMg8EAYRjuUi4ExJP0+JjpR6LJm9saH8waaBvcnnzFvQguv/Di2UsMr4eo6gbPX72GbtrI0hTz+fzAsrMR3WwpRCJMSD+SKH+8CH0/QlPXGGoafCkW/dNv3+EHgRAucNztSsr+/ynnUgT2YdM0qKqtEr8pc7RVgaIQy3NlFD+Jd0Hpp8JMEXgA4qoYhrNI+szEYrGQjRVcKdBFX5N+s0SXmdKJcig9n/jb7fYAeKiyJR2uaWzmXSMT5Ko/VFPAzqfYnudzklRVQ1mp2b7CZMu+jONY+R1G4iN2+nw2l0pF6hH1SZJEVY7suUbR+pAaAQiUixxVVSmfqwLkHHKUCMLL+66nT9A8p2aZYrTXjgw1TVfnjwB5gVGoB4uwFhAynsmIkWkQSnpz6rNUQagTJ4N/GpxdAvIdMbj+BdsjFz1GleBPAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"2\"\n        title=\"2\"\n        src=\"/static/d40edf238f36485f7e62690bac825bc9/8ff1e/2.png\"\n        srcset=\"/static/d40edf238f36485f7e62690bac825bc9/9ec3c/2.png 200w,\n/static/d40edf238f36485f7e62690bac825bc9/c7805/2.png 400w,\n/static/d40edf238f36485f7e62690bac825bc9/8ff1e/2.png 800w,\n/static/d40edf238f36485f7e62690bac825bc9/6ff5e/2.png 1200w,\n/static/d40edf238f36485f7e62690bac825bc9/2f950/2.png 1600w,\n/static/d40edf238f36485f7e62690bac825bc9/9a004/2.png 1782w\"\n        sizes=\"(max-width: 800px) 100vw, 800px\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></li>\n<li>\n<p>Name it \"Add to Safari Reading List\" and add a \"Run AppleScript\" action with the following AppleScript, and don't forget to use \"Google Chrome Canary\" and or \"Safari Technology Preview\" instead if you prefer them:</p>\n<div class=\"gatsby-highlight\" data-language=\"applescript\"><pre class=\"language-applescript\"><code class=\"language-applescript\"><span class=\"token keyword\">tell</span> <span class=\"token class builtin\">application</span> <span class=\"token string\">\"Google Chrome\"</span>\n  <span class=\"token keyword\">set</span> pageUrl <span class=\"token keyword\">to</span> <span class=\"token keyword\">get</span> URL <span class=\"token keyword\">of</span> active tab <span class=\"token keyword\">of</span> <span class=\"token keyword\">first</span> window\n<span class=\"token keyword\">end</span> <span class=\"token keyword\">tell</span>\n<span class=\"token keyword\">tell</span> <span class=\"token class builtin\">application</span> <span class=\"token string\">\"Safari\"</span> <span class=\"token keyword\">to</span> add reading <span class=\"token class builtin\">list</span> item pageUrl</code></pre></div>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto;  max-width: 800px;\"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/d114020aa1277da5e54146bac0d26fb9/9a004/3.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 68.35016835016835%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAOCAYAAAAvxDzwAAAACXBIWXMAAAsSAAALEgHS3X78AAACLklEQVQ4y4VTa2/bMAz0//9XQ7tPwYZhXepHE8ePPOwkTeK3ZDu+8Zi1G4IWk3GgJFIn8ig7T348LcMIu912Wq/XSNMUtMRyucTz/Bmu62I+n8N9dnWeJMktZrNBIvtJHL+fcb48fMXD4+M0m83g+74GLxZLRFGkAbEEB0EgvkAv4D4v5V7gu/B+Peklq9VK9xzPnU8/vn/j4Wmz3eHnXII8Tw9tJIM4TjQDHnoj2+/3YtfwAw+uR7h6GX1Oby02aYKmadAZi5cwxj7PcDge0HUdrPhzISAZKyBZ3dQaX1UViqJ4B9dO0Vqk20wWpRIkMfXZiKY7HI9HNG2L8/mMsihRXAr0tsc0Trher/hoOEXZwAtCCRgleEAoDVpI+nmeo65qVHWF6ljhFJ5QbktUmWS1lmwySeDSwZSd2vbc4jpe4RjTi1ZbTNMEY4xotkKWZajrWrMw1sA0Bs2xQZ0LucDWFrayQmZu80bmhcHYj3Ba0S0VwlrqLwWanejEcnkJNRyGAZN84zjqHgfX94M+p+uMPJVUs7GiT/CyQLpOsZWO8wkdDgeUZYnX11dFK5pS667tbvYOTr6/IFrFGkzxsyzXjvV9rwHs3Ol0egdjPsKb30n+/BG3x+urs22b2zMSQhIzK1qW/xlYBeMc1s6ORqtILcvkYepGUDcr6/4/ICmtEvIXC8NQ3x5vItgkdppZDkOvpB9l9m/mSvj30KDP5j6gaQ1OBctv1f8ZyEH7G4Q5JKrW7ncTAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"3\"\n        title=\"3\"\n        src=\"/static/d114020aa1277da5e54146bac0d26fb9/8ff1e/3.png\"\n        srcset=\"/static/d114020aa1277da5e54146bac0d26fb9/9ec3c/3.png 200w,\n/static/d114020aa1277da5e54146bac0d26fb9/c7805/3.png 400w,\n/static/d114020aa1277da5e54146bac0d26fb9/8ff1e/3.png 800w,\n/static/d114020aa1277da5e54146bac0d26fb9/6ff5e/3.png 1200w,\n/static/d114020aa1277da5e54146bac0d26fb9/2f950/3.png 1600w,\n/static/d114020aa1277da5e54146bac0d26fb9/9a004/3.png 1782w\"\n        sizes=\"(max-width: 800px) 100vw, 800px\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n</li>\n<li>Enable the service and set the shortcut to ⇧⌘D: <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto;  max-width: 800px;\"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/3d39d506310d3f9bf93d6ac6e9800164/27b78/4.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 86.97604790419162%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAARCAYAAADdRIy+AAAACXBIWXMAABYlAAAWJQFJUiTwAAACyElEQVQ4y4VU227aQBDl/z8j71WjKq2ah9JcpEAQlISLDRiMAd/BNgQIELBP9wwYJWqrWjqa2dmd2TPjmS00m8200WjCcZwsCAJMbBuWZcEwDPT7fZimCU1ro9VqyZrgHu3T6RSe59IXs9lMULBVgMlkktHoui64Ho/Hois7ut0e2m0Ng8Hgw14uCfp6nicohGGYUfF9P1O6OJEF2VrWCNXqL5TLFfR6BkajEQaKmTp7usARnQHpR58CDUynVquhXq/j6ekJjUZDsWoLOp2OpMgzmqaJLdcpdV0/MxeG0SxC6bGERrOhWPTkQBzH6rYQ8/kcM1Unph1FEfb7PTabDbbb7Qfsdjus12thWgiVozUaqnQsuYkH+CVJgnkyx3BoSXoM9K8vTVPZl4BTVbenVge3d/eqVmUxkg3pv25eEScRXPUneant2njbvyHNUhyyg5IHHNID9uke682JYRR4KA3naBsWLHOgGO7kRtf28BKtMbUjGG0TsT/H9uUNyP5C8aDMKrEjw2kIrdNThe9D13Qx8jM9A5fdC3wZXeA+ukJtW0R9e4PH1TVuF5coJp8EN8lnPCy/4WF2Dd8NpG1g9DrSpPwZi8VCAvqxC+2lhur0BsXeFe7M7yh2r/Cz/xXl4Adar2U0VyW0VmW0lo/Qkio810eBjbnZbP8o8nKxFH0RLjHQTXijAJGfYLfaH9POU6dUpsMmO6bMPuTfzTv91OTHKfAI1bSODcd1EKryBGEg9iD0RXJvPFE96J8mhc55/3W7XWlkSq51vXNubq7ZzNQpc537PM8xPQcc9AeoVCoolUpq1KrnaeEI8jDBSzkxRG7LdZ47TwpnmH/3+fk5UziPGjEcDqUcpwfkjPe2XHLOJSAHWjlmnAYGoHwfkIV21CMg8j9gtgX1hmWcjDiKcyntQ3Cdv3M52F5MjyAzvp0kFScLhOpd+A3ZWN5slNQj4wAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"4\"\n        title=\"4\"\n        src=\"/static/3d39d506310d3f9bf93d6ac6e9800164/8ff1e/4.png\"\n        srcset=\"/static/3d39d506310d3f9bf93d6ac6e9800164/9ec3c/4.png 200w,\n/static/3d39d506310d3f9bf93d6ac6e9800164/c7805/4.png 400w,\n/static/3d39d506310d3f9bf93d6ac6e9800164/8ff1e/4.png 800w,\n/static/3d39d506310d3f9bf93d6ac6e9800164/6ff5e/4.png 1200w,\n/static/3d39d506310d3f9bf93d6ac6e9800164/27b78/4.png 1336w\"\n        sizes=\"(max-width: 800px) 100vw, 800px\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></li>\n</ul>",
            "url": "https://adamyonk.com/posts/2017/05/10/send-chrome-tab-to-safari-reading-list",
            "title": "Send Chrome tab to Safari Reading List",
            "date_modified": "2017-05-10T17:12:33.962Z"
        },
        {
            "id": "5cd04d7f-2648-5301-8130-970e69211d0e",
            "content_html": "<p>I was recently trying to pull data off of an iMac for a friend, but didn't have any Macs around with FireWire ports to get at the iMac HD in target disk mode<sup><a name=\"1-ref\"></a><a href=\"#1\">1</a></sup>. This method does require an external hard drive.</p>\n<p>Start up your Mac in single-user mode<sup><a name=\"2-ref\"></a><a href=\"#2\">2</a></sup>, then run the following commands<sup><a name=\"3-ref\"></a><a href=\"#3\">3</a></sup>:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token comment\"># Check the filesystem</span>\n/sbin/fsck -y\n\n<span class=\"token comment\"># Mount the root volume</span>\n<span class=\"token function\">mount</span> -uw /\n\n<span class=\"token comment\"># Create mount destination</span>\n<span class=\"token function\">mkdir</span> /Volumes/backup\n\n<span class=\"token comment\"># Get a list of available drives</span>\n<span class=\"token function\">df</span> -h\n\n<span class=\"token comment\"># Plug in USB backup drive, look for new drive name</span>\n<span class=\"token function\">df</span> -h\n\n<span class=\"token comment\"># Mount the drive with the name you got from last step. Probably looks</span>\n<span class=\"token comment\"># something like /dev/rdisk2s2. Note the rdisk / disk name difference.</span>\n<span class=\"token function\">mount</span> -t hfs /dev/disk2s2 /Volumes/backup\n\n<span class=\"token comment\"># rsync data to your backup</span>\n<span class=\"token function\">rsync</span> -ahz /Users/you/ /Volumes/backup/</code></pre></div>\n<p><sup><a name=\"1\"></a><a href=\"#1-ref\">1</a></sup>Share files between two computers with target disk mode: <a href=\"https://support.apple.com/en-us/HT201462\">https://support.apple.com/en-us/HT201462</a></p>\n<p><sup><a name=\"2\"></a><a href=\"#2-ref\">2</a></sup>How to start up your Mac in single-user or verbose mode: <a href=\"https://support.apple.com/en-us/HT201573\">https://support.apple.com/en-us/HT201573</a></p>\n<p><sup><a name=\"3\"></a><a href=\"#3-ref\">3</a></sup>Mount USB Memory Sticks in single user mode: <a href=\"http://hints.macworld.com/article.php?story=20030714194313542\">http://hints.macworld.com/article.php?story=20030714194313542</a></p>",
            "url": "https://adamyonk.com/posts/2016/03/14/recover-data-from-a-mac-without-target-disk-mode",
            "title": "Recover Data from a Mac without Target Disk Mode",
            "date_modified": "2016-03-14T14:17:28.000Z"
        },
        {
            "id": "a74563df-eb71-5a45-92a1-1a4de32246d3",
            "content_html": "<p>It's no fun to have to clean up git history after a botched command line merge of a GitHub pull request. I love to live life in the shell, and I don't want to open a new browser tab just to click <a href=\"https://github.com/blog/843-the-merge-button\">The Merge Button</a>, so sometimes I'm stubborn and I don't. And sometimes I waste a lot of time cleaning up the mess that happens when I try to do all of that with an outdated master branch.</p>\n<p>With some prodding and direction from my good friend <a href=\"https://github.com/pengwynn\">pengwynn</a>, I put together a script based on the new-to-me <a href=\"https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button\">Merge Button API Route</a>. So, go forth and merge with glee, in safety, and without leaving our beloved shell. ❤️</p>\n<p>See <code class=\"language-text\">git-merge-pr</code> below or <a href=\"https://github.com/adamyonk/dotfiles/blob/master/bin/git-merge-pr\">grab it from my dotfiles</a>!</p>\n<h2>git-merge-pr</h2>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token shebang important\">#!/usr/bin/env bash</span>\n\n<span class=\"token comment\"># Contributors:</span>\n<span class=\"token comment\">#   Adam Jahnke - http://github.com/adamyonk</span>\n<span class=\"token comment\">#   Wynn Netherland - http://github.com/pengwynn</span>\n\n<span class=\"token comment\">#/</span>\n<span class=\"token comment\">#/ Usage:</span>\n<span class=\"token comment\">#/   git merge-pr [&lt;branch>|&lt;pr>]</span>\n<span class=\"token comment\">#/</span>\n<span class=\"token comment\">#/ Looks up the most recent pull requst based on &lt;branch>, &lt;pr>, or the current</span>\n<span class=\"token comment\">#/ branch, and tries to merge it using the merge API (like the Merge Button).</span>\n<span class=\"token comment\">#/</span>\n<span class=\"token comment\">#/ Requirements:</span>\n<span class=\"token comment\">#/   - $GITHUB_TOKEN environment variable</span>\n<span class=\"token comment\">#/   - jq https://stedolan.github.io/jq/</span>\n<span class=\"token comment\">#/</span>\n\n<span class=\"token builtin class-name\">set</span> -e\n\n<span class=\"token keyword\">if</span> <span class=\"token punctuation\">[</span><span class=\"token punctuation\">[</span> <span class=\"token string\">\"<span class=\"token variable\">$1</span>\"</span> <span class=\"token operator\">==</span> <span class=\"token string\">\"--help\"</span> <span class=\"token operator\">||</span> <span class=\"token string\">\"<span class=\"token variable\">$1</span>\"</span> <span class=\"token operator\">==</span> <span class=\"token string\">'-h'</span> <span class=\"token punctuation\">]</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">;</span> <span class=\"token keyword\">then</span>\n  <span class=\"token function\">grep</span> ^<span class=\"token comment\">#/ \"$0\" | cut -c4-</span>\n  <span class=\"token builtin class-name\">exit</span>\n<span class=\"token keyword\">fi</span>\n\n<span class=\"token keyword\">if</span> <span class=\"token punctuation\">[</span><span class=\"token punctuation\">[</span> -z <span class=\"token string\">\"<span class=\"token variable\">$GITHUB_TOKEN</span>\"</span> <span class=\"token punctuation\">]</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">;</span> <span class=\"token keyword\">then</span>\n  <span class=\"token builtin class-name\">echo</span> <span class=\"token string\">\"Please export \\<span class=\"token variable\">$GITHUB_TOKEN</span>\"</span>\n  <span class=\"token builtin class-name\">exit</span> <span class=\"token number\">1</span>\n<span class=\"token keyword\">fi</span>\n\n<span class=\"token keyword\">if</span> <span class=\"token punctuation\">[</span><span class=\"token punctuation\">[</span> -z <span class=\"token string\">\"<span class=\"token variable\"><span class=\"token variable\">$(</span><span class=\"token function\">which</span> jq<span class=\"token variable\">)</span></span>\"</span> <span class=\"token punctuation\">]</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">;</span> <span class=\"token keyword\">then</span>\n  <span class=\"token builtin class-name\">echo</span> <span class=\"token string\">\"Please install jq: https://stedolan.github.io/jq/\"</span>\n  <span class=\"token builtin class-name\">exit</span> <span class=\"token number\">1</span>\n<span class=\"token keyword\">fi</span>\n\n<span class=\"token assign-left variable\">remote_url</span><span class=\"token operator\">=</span><span class=\"token variable\"><span class=\"token variable\">$(</span><span class=\"token function\">git</span> config --get remote.origin.url<span class=\"token variable\">)</span></span>\n<span class=\"token assign-left variable\">owner_repo</span><span class=\"token operator\">=</span><span class=\"token variable\"><span class=\"token variable\">$(</span><span class=\"token builtin class-name\">echo</span> $remote_url <span class=\"token operator\">|</span> <span class=\"token function\">sed</span> -En <span class=\"token string\">'s_^(git@|https://)?github.com(:|/)(.*)/(.*)(.git)?_<span class=\"token entity\" title=\"\\3\">\\3</span> <span class=\"token entity\" title=\"\\4\">\\4</span>_p'</span><span class=\"token variable\">)</span></span>\n<span class=\"token assign-left variable\">owner</span><span class=\"token operator\">=</span><span class=\"token variable\"><span class=\"token variable\">$(</span><span class=\"token builtin class-name\">echo</span> $owner_repo <span class=\"token operator\">|</span> <span class=\"token function\">sed</span> <span class=\"token string\">'s_ .*__'</span><span class=\"token variable\">)</span></span>\n<span class=\"token assign-left variable\">repo</span><span class=\"token operator\">=</span><span class=\"token variable\"><span class=\"token variable\">$(</span><span class=\"token builtin class-name\">echo</span> $owner_repo <span class=\"token operator\">|</span> <span class=\"token function\">sed</span> <span class=\"token string\">'s_.* __; s_.git<span class=\"token variable\">$__</span>'</span><span class=\"token variable\">)</span></span>\n<span class=\"token assign-left variable\">branch</span><span class=\"token operator\">=</span><span class=\"token variable\">${1<span class=\"token operator\">:-</span>\"$(git symbolic-ref HEAD | sed 's_refs<span class=\"token operator\">/</span>heads<span class=\"token operator\">/</span>__')\"}</span>\n<span class=\"token assign-left variable\">endpoint</span><span class=\"token operator\">=</span><span class=\"token string\">\"https://api.github.com/repos/<span class=\"token variable\">$owner</span>/<span class=\"token variable\">$repo</span>/pulls\"</span>\n<span class=\"token assign-left variable\">auth</span><span class=\"token operator\">=</span><span class=\"token string\">\"Authorization: token <span class=\"token variable\">$GITHUB_TOKEN</span>\"</span>\n\n<span class=\"token comment\"># Check if $1 is actually a pull request number</span>\n<span class=\"token keyword\">if</span> <span class=\"token variable\"><span class=\"token variable\">$(</span><span class=\"token builtin class-name\">test</span> <span class=\"token operator\">!</span> -z $1 <span class=\"token operator\">&amp;&amp;</span> <span class=\"token builtin class-name\">echo</span> $1 <span class=\"token operator\">|</span> <span class=\"token function\">grep</span> --silent <span class=\"token string\">'^\\d*$'</span><span class=\"token variable\">)</span></span><span class=\"token punctuation\">;</span> <span class=\"token keyword\">then</span>\n  <span class=\"token assign-left variable\">pull</span><span class=\"token operator\">=</span><span class=\"token variable\">$1</span>\n<span class=\"token keyword\">else</span>\n  <span class=\"token comment\"># Get the first matching pull request for $branch</span>\n  <span class=\"token comment\"># https://developer.github.com/v3/pulls/#list-pull-requests</span>\n  <span class=\"token assign-left variable\">pull</span><span class=\"token operator\">=</span><span class=\"token variable\"><span class=\"token variable\">$(</span><span class=\"token function\">curl</span> --silent --header <span class=\"token string\">\"<span class=\"token variable\">$auth</span>\"</span><span class=\"token punctuation\">\\</span>\n    <span class=\"token string\">\"<span class=\"token variable\">$endpoint</span>?head=<span class=\"token variable\">$owner</span>:<span class=\"token variable\">$branch</span>\"</span><span class=\"token punctuation\">\\</span>\n    <span class=\"token operator\">|</span> jq <span class=\"token string\">'.[0].number'</span><span class=\"token variable\">)</span></span>\n<span class=\"token keyword\">fi</span>\n\n<span class=\"token comment\"># Try to merge</span>\n<span class=\"token comment\"># https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button</span>\n<span class=\"token keyword\">if</span> <span class=\"token punctuation\">[</span><span class=\"token punctuation\">[</span> <span class=\"token string\">\"<span class=\"token variable\">$pull</span>\"</span> <span class=\"token operator\">!=</span> <span class=\"token string\">\"null\"</span> <span class=\"token punctuation\">]</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">;</span> <span class=\"token keyword\">then</span>\n  <span class=\"token assign-left variable\">response</span><span class=\"token operator\">=</span><span class=\"token variable\"><span class=\"token variable\">$(</span><span class=\"token function\">curl</span> --silent --request PUT --data <span class=\"token string\">\"{}\"</span> --header <span class=\"token string\">\"<span class=\"token variable\">$auth</span>\"</span><span class=\"token punctuation\">\\</span>\n    <span class=\"token string\">\"<span class=\"token variable\">$endpoint</span>/<span class=\"token variable\">$pull</span>/merge\"</span><span class=\"token punctuation\">\\</span>\n    <span class=\"token operator\">|</span> jq <span class=\"token string\">'.message'</span><span class=\"token punctuation\">\\</span>\n    <span class=\"token operator\">|</span> <span class=\"token function\">sed</span> <span class=\"token string\">'s_\"__g'</span><span class=\"token variable\">)</span></span>\n\n  <span class=\"token keyword\">if</span> <span class=\"token operator\">!</span> <span class=\"token punctuation\">[</span><span class=\"token punctuation\">[</span> <span class=\"token string\">\"<span class=\"token variable\">$response</span>\"</span> <span class=\"token operator\">=</span>~ <span class=\"token string\">\"success\"</span> <span class=\"token punctuation\">]</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">;</span> <span class=\"token keyword\">then</span>\n    <span class=\"token assign-left variable\">response</span><span class=\"token operator\">=</span><span class=\"token string\">\"<span class=\"token variable\">$response</span><span class=\"token entity\" title=\"\\n\">\\n</span>https://github.com/<span class=\"token variable\">$owner</span>/<span class=\"token variable\">$repo</span>/pull/<span class=\"token variable\">$pull</span>\"</span>\n  <span class=\"token keyword\">fi</span>\n<span class=\"token keyword\">else</span>\n  <span class=\"token assign-left variable\">response</span><span class=\"token operator\">=</span><span class=\"token string\">\"Couldn't find an open pull request based on <span class=\"token variable\">$branch</span>.\"</span>\n<span class=\"token keyword\">fi</span>\n\n<span class=\"token builtin class-name\">echo</span> -e <span class=\"token string\">\"<span class=\"token entity\" title=\"\\n\">\\n</span><span class=\"token variable\">$response</span>\"</span></code></pre></div>",
            "url": "https://adamyonk.com/posts/2016/03/08/github-merge-button-from-cli",
            "title": "GitHub Merge Button from CLI",
            "date_modified": "2016-03-08T18:42:39.000Z"
        },
        {
            "id": "92460975-9cdd-51cf-bbe9-4c71d0b6c74c",
            "content_html": "<blockquote>\n<p>The faith that changes the life and connects to God is best conveyed by the word \"trust.\" Imagine you are on a high cliff and you lose your footing and begin to fall. Just beside you as you fall is a branch sticking out of the very edge of the cliff. It is your only hope and it is more than strong enough to support your weight. How can it save you? If your mind is filled with intellectual certainty that the branch can support you, but you don't actually reach out and grab it, you are lost. If your mind is instead filled with doubts and uncertainty that the branch can hold you, but you reach out and grab it anyway, you will be saved. Why? It is not the strength of your faith but the object of your faith that actually saves you. Strong faith in a weak branch is fatally inferior to weak faith in a strong branch.</p>\n</blockquote>\n<blockquote>\n<p>This means you don't have to wait for all doubts and fears to go away to take hold of Christ. Don't make the mistake of thinking that you have to banish all misgivings in order to meet God. That would turn your faith into one more way to be your own Savior. Working on the quality and purity of your commitment would become a way to merit salvation and put God in your debt. It is not the depth and purtity of your heart but the work of Jesus Christ on our behalf that saves us.</p>\n</blockquote>\n<p>– Tim Keller, <em>The Reason for God</em></p>",
            "url": "https://adamyonk.com/posts/2016/02/03/trust",
            "title": "Trust",
            "date_modified": "2016-02-03T17:08:05.000Z"
        },
        {
            "id": "a70042a6-5b08-574f-929a-1967da039206",
            "content_html": "<p>I was recently setting up a Jekyll site that had the JavaScript and CSS compiled using Webpack. The compiled bundle should be parsed by Liquid, so it needed to somehow have the YAML triple-dashes prepended to it. Luckily, there is a Webpack plugin for just such an occasion! In <code class=\"language-text\">webpack.config.js</code>:</p>\n<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token keyword\">var</span> webpack <span class=\"token operator\">=</span> <span class=\"token function\">require</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"webpack\"</span><span class=\"token punctuation\">)</span>\n\nmodule<span class=\"token punctuation\">.</span>exports <span class=\"token operator\">=</span> <span class=\"token punctuation\">{</span>\n  plugins<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span><span class=\"token keyword\">new</span> <span class=\"token class-name\">webpack<span class=\"token punctuation\">.</span>BannerPlugin</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"---\\n---\\n\\n\"</span><span class=\"token punctuation\">,</span> <span class=\"token punctuation\">{</span> raw<span class=\"token punctuation\">:</span> <span class=\"token boolean\">true</span> <span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>The <code class=\"language-javascript\"><span class=\"token punctuation\">{</span> raw<span class=\"token punctuation\">:</span> <span class=\"token boolean\">true</span> <span class=\"token punctuation\">}</span></code> bit in the options is important, otherwise <code class=\"language-text\">BannerPlugin</code> will output the passed string as a comment and Liquid won't know about it.</p>\n<p>When Jekyll picks up my built bundle to compile it into <code class=\"language-text\">/_site</code>, it will now have the triple-dashes prepended to the file. I use the <code class=\"language-text\">style-loader</code> with Webpack so that I can <code class=\"language-text\">require</code> styles in my JavaScript and have them written to the document <code class=\"language-text\">&lt;head&gt;</code>. So now I'll be able to use Liquid tags for things like this:</p>\n<div class=\"gatsby-highlight\" data-language=\"scss\"><pre class=\"language-scss\"><code class=\"language-scss\"><span class=\"token selector\">.site-header </span><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">background-image</span><span class=\"token punctuation\">:</span> <span class=\"token url\">url</span><span class=\"token punctuation\">(</span><span class=\"token selector\">\"</span><span class=\"token punctuation\">{</span><span class=\"token punctuation\">{</span> <span class=\"token string\">'/images/logo.jpg'</span> | <span class=\"token property\">prepend</span><span class=\"token punctuation\">:</span> site.baseurl <span class=\"token punctuation\">}</span><span class=\"token punctuation\">}</span>\"<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>To read about the options for <code class=\"language-text\">BannerPlugin</code> and to see all of the available Webpack plugins, head over to the <a href=\"https://webpack.github.io/docs/list-of-plugins.html#bannerplugin\">List of Plugins</a> page in the docs.</p>",
            "url": "https://adamyonk.com/posts/2015/10/12/jekyll-and-webpack",
            "title": "Jekyll and Webpack",
            "date_modified": "2015-10-12T15:30:00.000Z"
        },
        {
            "id": "e92c4064-582a-5659-817d-d4b0bf6c8915",
            "content_html": "<p>Writing about something as subjective as coffee is difficult. So don't take this as anything more than my personal opinion and preferences on coffee. I tried to boil the categories down to my favorite three items at varying price points. This post is mainly about gear, I may write something more along the lines of brewing how-tos in the future.</p>\n<h2>Brewing Methods</h2>\n<p>I think the biggest differentiator between these brewing methods is the filter weight and how that affects the taste of the coffee. The difference between these three in terms of all of the ways that coffee is made in the world is minimal, but when only considering what is generally referred to as 'pour over' coffee, there are significant differences. Chemex filters are the most dense and therefore make the cleanest cup of coffee. On the other side of the scale would be V60 filters which are the lightest and therefore give the cup more body and robustness. I'd say that Wave filters are somewhere in between, but closer to V60 filters. I should note that while all of these list the capacity in cups, for some reason 'cup' means ~5 ounces in coffee. So, for example, the V60 sizes would really make about 1, 2, or 3 'regular' 10-12 ounce cups.</p>\n<table>\n  <tr>\n    <th></th>\n    <th>Capacity</th>\n    <th>Filter price</th>\n    <th>Price</th>\n  </tr>\n  <tr>\n    <td>Hario V60</td>\n    <td>2, 4, or 6 cups</td>\n    <td>6-8¢/filter</td>\n    <td><a href='http://amzn.com/B000P4D5HG'>$16-$30</a></td>\n  </tr>\n  <tr>\n    <td>Kalita Wave</td>\n    <td>4 cups</td>\n    <td>15¢/filter</td>\n    <td><a href='http://amzn.com/B000X1AM0Y'>$32</a></td>\n  </tr>\n  <tr>\n    <td>Chemex</td>\n    <td>3, 6, or 8 cups</td>\n    <td>11¢/filter</td>\n    <td><a href='http://amzn.com/B0036YFTO4'>$35-$65</a></td>\n  </tr>\n</table>\n<h2>Grinders</h2>\n<p>There are generally two types of grinders; blade grinders and burr grinders. Blade grinders chop at the coffee beans and as a result don't keep a consistent coarseness of grind. Burr grinders on the other hand, crush the coffee, which is a much more consistent and controllable method. Within the realm of burr grinders, there are wheel burrs and conical burrs and conical burrs are better. All of the grinders that I have listed below are conical burr grinders. The glaring differences are the size of the burr (bigger is better) and electric versus manual. Manual grinders work great, but if you're making more than a few cups of coffee at a time, they can be tiring and time consuming to operate.</p>\n<table>\n  <tr>\n    <th></th>\n    <th>Type</th>\n    <th>Price</th>\n  </tr>\n  <tr>\n    <td>Hario Ceramic Mill</td>\n    <td>manual</td>\n    <td><a href='http://amzn.com/B001802PIQ'>$38</a></td>\n  </tr>\n  <tr>\n    <td>Baratza Encore</td>\n    <td>electric</td>\n    <td><a href='http://amzn.com/B00LW8122Y'>$130</a></td>\n  </tr>\n  <tr>\n    <td>Baratza Preciso</td>\n    <td>electric</td>\n    <td><a href='http://amzn.com/B003JFCRN6'>$300</a></td>\n  </tr>\n</table>\n<h2>Scales &#x26; Timers</h2>\n<p>An accurate food scale and a timer are the foundation that consistently good coffee is built on. You have to be able to replicate your parameters once you find the perfect balance with your coffee of choice. Below are a range of scales that vary in features – while a built-in timer is not absolutely necessary (any timer will do), it is quite convenient.</p>\n<table>\n  <tr>\n    <th></th>\n    <th>Features</th>\n    <th>Price</th>\n  </tr>\n  <tr>\n    <td>American Weight Scale</td>\n    <td>basic scale</td>\n    <td><a href='http://amzn.com/B001RF3XJ2'>$23</a></td>\n  </tr>\n  <tr>\n    <td>Hario Scale/Timer</td>\n    <td>built-in timer</td>\n    <td><a href='http://amzn.com/B009GPJMOU'>$44</a></td>\n  </tr>\n  <tr>\n    <td>Acaia Pearl</td>\n    <td>built-in timer, iPhone app</td>\n    <td><a href='http://acaia.co/products/acaia-pearl'>$130</a></td>\n  </tr>\n</table>\n<h2>Kettles</h2>\n<p>The stand-out feature in a kettle is a goose-neck spout. It allows for very accurate and controlled pouring. Below are a range of kettles that, again, vary in features. Like tea, the temperature of water is very important in the brewing of coffee. The variable temperature model rises above the rest for this reason.</p>\n<table>\n  <tr>\n    <th></th>\n    <th>Features</th>\n    <th>Price</th>\n  </tr>\n  <tr>\n    <td>Bonavita Stovetop Kettle</td>\n    <td>stovetop</td>\n    <td><a href='http://amzn.com/B005YR0IBU'>$35</a></td>\n  </tr>\n  <tr>\n    <td>Bonavita Electric Kettle</td>\n    <td>electric</td>\n    <td><a href='http://amzn.com/B005YR0GDA'>$50</a></td>\n  </tr>\n  <tr>\n    <td>Bonavita Variable Temp Kettle</td>\n    <td>electric, temp display & presets, holds temp</td>\n    <td><a href='http://amzn.com/B005YR0F40'>$85</a></td>\n  </tr>\n</table>\n<h2>Accessories</h2>\n<p>The Chemex has the benefit of being its own serving vessel, but for the V60 and Wave, a vessel is needed to capture the coffee. While not absolutely necessary (a mason jar will do), the Hario Coffee Server (<a href=\"http://amzn.com/B000P4B4LU\">$26</a>) is a beautiful serving vessel.</p>\n<h2>Summary</h2>\n<p>A great first setup for someone getting into making pour over coffee at home would be a 6-cup V60. As far as the grinder, scale, and kettle goes, it really depends on how much convenience you want and how much money you want to spend.</p>",
            "url": "https://adamyonk.com/posts/2015/01/02/pour-over-coffee-gear",
            "title": "Pour Over Coffee Gear",
            "date_modified": "2015-01-05T04:44:00.000Z"
        },
        {
            "id": "7edf14fa-8ece-5755-8028-36d57b76695e",
            "content_html": "<blockquote>\n<p>It has always seemed strange to me that the things we admire in men, kindness and generosity, openness, honestly, understanding, and feeling are the concomitants of failure in our system. And those traits we detest, sharpness, greed, acquisitiveness, meanness, egotism, and self-interest are the traits of success. And while men admire the quality of the first they love the produce of the second.</p>\n</blockquote>\n<p>– John Steinbeck, <em>Cannery Row</em></p>\n<p><em>via: <a href=\"http://dcurt.is/the-things-we-admire\">Dustin Curtis</a></em></p>",
            "url": "https://adamyonk.com/posts/2014/03/29/the-things-we-admire",
            "title": "The Things We Admire",
            "date_modified": "2014-03-29T15:27:26.000Z"
        },
        {
            "id": "4f19fcc3-c677-59d6-bb2f-a49a6f5dff41",
            "content_html": "<p>I put together a pretty simple solution for masking yet another native HTML input that behaves just fine on its own. The lengths we'll go to for our designers…</p>\n<p>I'm just kidding. Y'all are great!</p>\n<iframe src=\"https://codesandbox.io/embed/8k2kjzll32?autoresize=1&hidenavigation=1&moduleview=1\" style=\"width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;\" sandbox=\"allow-modals allow-forms allow-popups allow-scripts allow-same-origin\"></iframe>",
            "url": "https://adamyonk.com/posts/2013/08/01/easy-masked-file-inputs",
            "title": "Masked file inputs",
            "date_modified": "2013-08-01T16:13:31.000Z"
        },
        {
            "id": "5eabcc65-3fba-5d86-9c67-d7e6fd2c1728",
            "content_html": "<p>I spend a fair amount of time trying to get this shape nailed down in CSS, so I wanted to share and save someone the time. The secret was in setting the second set of radii on the <code class=\"language-text\">box-shadow</code> property. <a href=\"https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius\">MDN</a> has a helpful visual to help wrap your mind around that lesser-known feature of box-shadow.</p>\n<iframe src=\"https://codesandbox.io/embed/k9162mxoqv?autoresize=1&hidenavigation=1&module=%2Findex.html\" style=\"width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;\" sandbox=\"allow-modals allow-forms allow-popups allow-scripts allow-same-origin\"></iframe>",
            "url": "https://adamyonk.com/posts/2013/05/17/css-map-pins",
            "title": "CSS Map Pins",
            "date_modified": "2013-05-17T19:57:00.000Z"
        },
        {
            "id": "69bc3618-dcfc-54cd-8ee6-fea7253534d6",
            "content_html": "<p>I recently started building a Rails 4 app and ran into some hangups when using strong parameters with nested models and forms. It seems to be lacking documentation for this specific scenario, so I wanted to share my findings.</p>\n<p>In a scenario where you have an album that <code class=\"language-text\">has_many</code> songs, and you want to be able to edit both with the same form, you need to add every nested attribute that you plan to pass through to the <code class=\"language-text\">params.permit()</code>. This is the setup that ended up working for me:</p>\n<div class=\"gatsby-highlight\" data-language=\"ruby\"><pre class=\"language-ruby\"><code class=\"language-ruby\"><span class=\"token operator\">=</span> form_for <span class=\"token variable\">@album</span> <span class=\"token keyword\">do</span> <span class=\"token operator\">|</span>f<span class=\"token operator\">|</span>\n  <span class=\"token operator\">=</span> f<span class=\"token punctuation\">.</span>text_field <span class=\"token symbol\">:title</span>\n  <span class=\"token operator\">=</span> f<span class=\"token punctuation\">.</span>fields_for <span class=\"token symbol\">:songs</span> <span class=\"token keyword\">do</span> <span class=\"token operator\">|</span>s<span class=\"token operator\">|</span>\n    <span class=\"token operator\">=</span> s<span class=\"token punctuation\">.</span>text_field <span class=\"token symbol\">:name</span>\n  …</code></pre></div>\n<div class=\"gatsby-highlight\" data-language=\"ruby\"><pre class=\"language-ruby\"><code class=\"language-ruby\"><span class=\"token keyword\">class</span> <span class=\"token class-name\">Album</span> <span class=\"token operator\">&lt;</span> <span class=\"token constant\">ActiveRecord</span><span class=\"token punctuation\">:</span><span class=\"token punctuation\">:</span><span class=\"token constant\">Base</span>\n  has_many <span class=\"token symbol\">:songs</span>\n  accepts_nested_attributes_for <span class=\"token symbol\">:songs</span><span class=\"token punctuation\">,</span> allow_destroy<span class=\"token punctuation\">:</span> <span class=\"token keyword\">true</span>\n  …\n<span class=\"token keyword\">end</span></code></pre></div>\n<div class=\"gatsby-highlight\" data-language=\"ruby\"><pre class=\"language-ruby\"><code class=\"language-ruby\"><span class=\"token keyword\">class</span> <span class=\"token class-name\">AlbumsController</span> <span class=\"token operator\">&lt;</span> <span class=\"token constant\">ApplicationController</span>\n  …\n  <span class=\"token keyword\">private</span>\n  <span class=\"token keyword\">def</span> <span class=\"token method-definition\"><span class=\"token function\">album_params</span></span>\n    params<span class=\"token punctuation\">.</span><span class=\"token keyword\">require</span><span class=\"token punctuation\">(</span><span class=\"token symbol\">:album</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">.</span>permit<span class=\"token punctuation\">(</span><span class=\"token symbol\">:title</span><span class=\"token punctuation\">,</span> songs_attributes<span class=\"token punctuation\">:</span> <span class=\"token punctuation\">[</span><span class=\"token symbol\">:id</span><span class=\"token punctuation\">,</span> <span class=\"token symbol\">:_destroy</span><span class=\"token punctuation\">,</span> <span class=\"token symbol\">:name</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">)</span>\n  <span class=\"token keyword\">end</span>\n<span class=\"token keyword\">end</span></code></pre></div>\n<div class=\"gatsby-highlight\" data-language=\"ruby\"><pre class=\"language-ruby\"><code class=\"language-ruby\"><span class=\"token keyword\">class</span> <span class=\"token class-name\">Song</span> <span class=\"token operator\">&lt;</span> <span class=\"token constant\">ActiveRecord</span><span class=\"token punctuation\">:</span><span class=\"token punctuation\">:</span><span class=\"token constant\">Base</span>\n  belongs_to <span class=\"token symbol\">:album</span>\n  …\n<span class=\"token keyword\">end</span></code></pre></div>\n<p>Do you know of a better or easier way? <a href=\"mailto:adamyonk@me.com?subject=Rails%204,%20Strong%20Parameters,%20and%20Nested%20Forms\">Let me know!</a></p>",
            "url": "https://adamyonk.com/posts/2013/05/16/rails-4-strong-parameters-and-nested-forms",
            "title": "Rails 4, Strong Parameters, and Nested Forms",
            "date_modified": "2013-05-16T18:19:06.000Z"
        },
        {
            "id": "051100a4-bc19-5b54-a1ec-3b9e24fc2947",
            "content_html": "<p>For the uninitiated, <a href=\"http://imageoptim.com\" title=\"ImageOptim — make websites and apps load faster (Mac app)\">ImageOptim</a> is a great Mac app that uses several well-known image optimization tools to compress images and help keep file sizes down and <a href=\"https://github.com/guard/guard\" title=\"Guard is a command line tool to easily handle events on file system modifications.\">Guard</a> is \"a command line tool to easily handle events on file system modifications.\" If you've never tried Guard, I'd encourage you to take some time and check it out. With over <a href=\"https://rubygems.org/search?query=guard-\">150 plugins</a> now available, there's surely some way that you can use it to optimize your workflow.</p>\n<p>I like to pair the <a href=\"https://github.com/guard/guard-shell\">guard-shell</a> gem with ImageOptim to help me keep my project's image assets compressed and ready for production. Make sure you have both guard and guard-shell in your Gemfile and set up a watcher in your Guardfile for new or edited images:</p>\n<div class=\"gatsby-highlight\" data-language=\"ruby\"><pre class=\"language-ruby\"><code class=\"language-ruby\">gem <span class=\"token string\">'guard'</span>\ngem <span class=\"token string\">'guard-shell'</span></code></pre></div>\n<div class=\"gatsby-highlight\" data-language=\"ruby\"><pre class=\"language-ruby\"><code class=\"language-ruby\">guard <span class=\"token string\">'shell'</span> <span class=\"token keyword\">do</span>\n  watch <span class=\"token regex\">%r{^public/images/.}</span> <span class=\"token keyword\">do</span> <span class=\"token operator\">|</span>file<span class=\"token operator\">|</span>\n    n file<span class=\"token punctuation\">[</span><span class=\"token number\">0</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span> <span class=\"token string\">'Image changed'</span>\n    `open <span class=\"token comment\">#{file[0]} -a ImageOptim`</span>\n  <span class=\"token keyword\">end</span>\n<span class=\"token keyword\">end</span></code></pre></div>\n<p>An interesting side effect to note is that guard will catch the file change when ImageOptim is done compressing and re-open it in ImageOptim and continue this loop untill there's nothing else ImageOptim can compress out of the image.</p>",
            "url": "https://adamyonk.com/posts/2013/01/14/using-imageoptim-with-guard-shell",
            "title": "Using ImageOptim with guard-shell",
            "date_modified": "2013-01-14T16:14:37.000Z"
        },
        {
            "id": "65b7a4e3-99a9-579e-aafb-3fde55bbaf6e",
            "content_html": "<p>I peruse a fair amount of dotfile repos, and keep seeing people use short flags for things like aliases and inside little command line tools. Short flags are a command line shortcut, and they do belong there, but if you're not writing the command in a prompt, do yourself (and anyone else that may someday be reading your code) a favor and be more verbose, because this:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token function\">curl</span> --silent checkip.dyndns.org <span class=\"token operator\">|</span> <span class=\"token function\">grep</span> --extended-regexp --only-matching <span class=\"token string\">'[0-9\\.]+'</span></code></pre></div>\n<p>is a lot easier for a human to understand than this:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token function\">curl</span> -s checkip.dyndns.org <span class=\"token operator\">|</span> <span class=\"token function\">grep</span> -Eo <span class=\"token string\">'[0-9\\.]+'</span></code></pre></div>",
            "url": "https://adamyonk.com/posts/2012/12/17/use-long-flags-when-scripting",
            "title": "Use long flags when scripting",
            "date_modified": "2012-12-17T16:32:59.000Z"
        },
        {
            "id": "6d6d5b3a-9936-5d09-a500-4470a3b6dfd3",
            "content_html": "<p>Tim Cook on Sir Jony Ive in a <a href=\"http://rockcenter.nbcnews.com/_news/2012/12/06/15708290-apple-ceo-tim-cook-announces-plans-to-manufacture-mac-computers-in-usa\" title=\"Read the interview on rockcenter.nbcnews.com\">Rock Center interview</a> with Brian Williams:</p>\n<blockquote>\n<p>Jony [Ive, senior vice president of industrial design], who I think has the best taste of anyone in the world and the best design skills, now has responsibility for the human interface. I mean, look at our products. (Cook reaches for his iPhone.) The face of this is the software, right? And the face of this iPad is the software. So it’s saying, Jony has done a remarkable job leading our hardware design, so let’s also have Jony responsible for the software and the look and feel of the software, not the underlying architecture and so forth, but the look and feel. I don’t think there’s anybody in the world that has a better taste than he does. So I think he’s very special. He’s an original.</p>\n</blockquote>\n<p>What an incredible reputation to have.</p>",
            "url": "https://adamyonk.com/posts/2012/12/06/sir-jony-ive",
            "title": "Sir Jony Ive",
            "date_modified": "2012-12-06T19:39:39.000Z"
        }
    ]
}