<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: nervewax</title>
    <description>The latest articles on Forem by nervewax (@nervewax).</description>
    <link>https://forem.com/nervewax</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F164595%2Fc90862c4-9560-43d6-93ce-98e13dcf0f47.png</url>
      <title>Forem: nervewax</title>
      <link>https://forem.com/nervewax</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/nervewax"/>
    <language>en</language>
    <item>
      <title>Cards Against Pandemic</title>
      <dc:creator>nervewax</dc:creator>
      <pubDate>Wed, 13 Jan 2021 00:00:00 +0000</pubDate>
      <link>https://forem.com/nervewax/cards-against-pandemic-kg2</link>
      <guid>https://forem.com/nervewax/cards-against-pandemic-kg2</guid>
      <description>

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/nervewax/cards-against-pandemic"&gt;Cards Against Pandemic - GitHub Repo&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
An online / web version of &lt;a href="https://cardsagainsthumanity.com/"&gt;Cards Against Humanity&lt;/a&gt;, built in desperate times.&lt;/p&gt;




&lt;p&gt;I built this so I could play Cards Against while on video call with friends during the COVID-19 lockdown. This was mainly because the other versions out there felt a bit hard to use, and I thought it could be fun to have a go myself.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SWYjQrHC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://nervewax.com/content/images/2020/08/cards03.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SWYjQrHC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://nervewax.com/content/images/2020/08/cards03.png" alt="Enter screen"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I got the game into a &lt;em&gt;just about&lt;/em&gt; playable state, played a bunch of games with friends, but then haven’t worked on it since. ¯\_(ツ)_/¯ It does work though!&lt;/p&gt;

&lt;p&gt;If you do come across this and want to raise &lt;strong&gt;issues&lt;/strong&gt; or even better a &lt;strong&gt;PR&lt;/strong&gt;, please do so. 🙏&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🕹 &lt;a href="https://cards-against-pandemic.glitch.me/"&gt;Current &lt;em&gt;barely&lt;/em&gt; playable version&lt;/a&gt; (on glitch.me)&lt;/li&gt;
&lt;li&gt;🐙 &lt;a href="https://github.com/nervewax/cards-against-pandemic"&gt;GitHub Repo&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;💾 Built using &lt;a href="https://vuejs.org/"&gt;vue.js&lt;/a&gt; and &lt;a href="https://socket.io/"&gt;socket.io&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;🃏 Cards json sourced from &lt;a href="https://crhallberg.com/cah/"&gt;JSON Against Humanity&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>project</category>
      <category>webdesign</category>
      <category>showdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Web Design Pick ‘n’ Mix 05</title>
      <dc:creator>nervewax</dc:creator>
      <pubDate>Mon, 09 Mar 2020 00:10:00 +0000</pubDate>
      <link>https://forem.com/nervewax/web-design-pick-n-mix-05-kf2</link>
      <guid>https://forem.com/nervewax/web-design-pick-n-mix-05-kf2</guid>
      <description>&lt;p&gt;So it’s been a long while since my last &lt;a href="https://nervewax.com/tag/pick-n-mix/"&gt;Pick ‘n’ Mix&lt;/a&gt;… this one has been in my drafts for ages, so I thought I’d write it up now that I’ve collected a good amount of stuff.&lt;/p&gt;

&lt;p&gt;The image this time is the amazing photography of &lt;a href="https://unsplash.com/@pawel_czerwinski"&gt;Paweł Czerwiński&lt;/a&gt; over on Unsplash.&lt;/p&gt;

&lt;h2&gt;
  
  
  Design
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.figma.com/"&gt;Figma&lt;/a&gt; - A web app, for design and prototyping. Besides using this for web design, it’s also a really good free alternative for something like Illustrator or Sketch.&lt;/p&gt;

&lt;p&gt;Even if you’re not really into design, Steve Schoger’s &lt;a href="https://www.youtube.com/watch?v=ZT4WRRhacWk"&gt;Refactoring UI&lt;/a&gt; videos are great. His &lt;a href="https://www.youtube.com/watch?v=7Z9rrryIOC4"&gt;CSS Day 2019 talk&lt;/a&gt; was also a good one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Front end
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://cssstats.com"&gt;cssstats.com&lt;/a&gt; - A great little tool for scanning and fixing up your CSS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://micromodal.now.sh/"&gt;micormodal&lt;/a&gt; and &lt;a href="https://microtip.now.sh/"&gt;microtip&lt;/a&gt; - Two handy JS libs built by the same people, that take care of modals and tooltips. Both are lightweight, accessible and unopinionated style-wise, what more could you want?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://picsum.photos"&gt;picsum.photos&lt;/a&gt; - Lorem ipsum… but for photos. This pulls photos from Unsplash and allows different sizes to be defined in the url. Really handy for quickly building out any html that includes an image.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cssbattle.dev"&gt;CSSBattle&lt;/a&gt; - A CSS battleground, with challenges to recreate designs in CSS with as little code as possible.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dixonandmoe.com/rellax/"&gt;Rellax&lt;/a&gt; - A lightweight, vanilla JS parallax library. This lib was so easy to use, I dropped in on my blog billboards within a couple of minutes of learning it existed!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior"&gt;Scroll behaviour smooth&lt;/a&gt; - Smooth scrolling now built into CSS. &lt;code&gt;scroll-behavior: smooth;&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Using outline with a negative outline-offset, you can emulate collapsing borders for responsive Flexbox layouts. No breakpoints. &lt;a href="https://t.co/UGybVsh3jB"&gt;pic.twitter.com/UGybVsh3jB&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;— overflow: heydon (@heydonworks) &lt;a href="https://twitter.com/heydonworks/status/897722364267548672"&gt;August 16, 2017&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://free-for.dev/"&gt;free-for.dev&lt;/a&gt; - Loads of links to free dev stuff.&lt;/p&gt;

&lt;h2&gt;
  
  
  Other
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.notion.so/"&gt;Notion&lt;/a&gt; - A note taking web app, that includes things like Trello style boards, knowledge bases and wikis. I used it a bit, and it seems really good for a digital notes tool. Although I’m actually just using good old notebooks myself ✍️&lt;/p&gt;

&lt;p&gt;&lt;a href="https://jessekorzan.github.io/expodal"&gt;expodal&lt;/a&gt; - The Most Explosive Modal on the Web. 💥&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>css</category>
      <category>design</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Disabling the native mobile keyboard</title>
      <dc:creator>nervewax</dc:creator>
      <pubDate>Sat, 31 Aug 2019 23:00:00 +0000</pubDate>
      <link>https://forem.com/nervewax/disabling-the-native-mobile-keyboard-d59</link>
      <guid>https://forem.com/nervewax/disabling-the-native-mobile-keyboard-d59</guid>
      <description>&lt;p&gt;Sometimes it’s a good idea to go against native mobile UI and opt for a more consistent custom experience. You can find a good example of this in practice over on &lt;a href="https://www.expedia.com"&gt;expedia.co.uk&lt;/a&gt;, where they’re using a custom datepicker for date input.&lt;/p&gt;

&lt;p&gt;On mobile however, the native keyboard would normally get in the way when focusing on the input, so here’s a quick tip for preventing that from happening.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mobile detection
&lt;/h2&gt;

&lt;p&gt;Firstly, we need to figure out if the user is on a mobile or not. This can be tricky, since many devices report this info differently.&lt;/p&gt;

&lt;p&gt;I found &lt;a href="https://stackoverflow.com/a/3540295/2351788"&gt;this answer on stackoverflow&lt;/a&gt; which seems like a fairly comprehensive list of all known mobile user agents.&lt;/p&gt;

&lt;p&gt;We can set up an &lt;code&gt;isMobile&lt;/code&gt; boolean as &lt;em&gt;false&lt;/em&gt;, then change it to &lt;em&gt;true&lt;/em&gt; if any of the user agent strings match.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let isMobile = false;

if (
    /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(
        navigator.userAgent
    ) ||
    /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(
        navigator.userAgent.substr(0, 4)
    )
) {
    isMobile = true;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Native keyboard prevention
&lt;/h2&gt;

&lt;p&gt;Once we’ve determined that the device is mobile, the next step is to prevent the native keyboard from opening.&lt;/p&gt;

&lt;p&gt;I found a good way to do this by &lt;em&gt;tricking&lt;/em&gt; the browser using the &lt;code&gt;readonly&lt;/code&gt; input attribute. We’ll then hook up our input to the &lt;code&gt;isMobile&lt;/code&gt; variable and that’s it!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;document.querySelector('input').readOnly = isMobile;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This also means the input can still be populated with js, but clicking on it will not trigger the keyboard.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Uses Pages &amp; #uses</title>
      <dc:creator>nervewax</dc:creator>
      <pubDate>Fri, 02 Aug 2019 14:33:58 +0000</pubDate>
      <link>https://forem.com/nervewax/uses-pages-uses-581f</link>
      <guid>https://forem.com/nervewax/uses-pages-uses-581f</guid>
      <description>&lt;p&gt;I saw &lt;a class="comment-mentioned-user" href="https://dev.to/nikoheikkila"&gt;@nikoheikkila&lt;/a&gt;
's &lt;a href="https://dev.to/nikoheikkila/show-your-own-uses-page-160j"&gt;post&lt;/a&gt; the other day about the &lt;code&gt;/uses&lt;/code&gt; page, which reminded me, I wanted to make my own after seeing the idea by &lt;a class="comment-mentioned-user" href="https://dev.to/wesbos"&gt;@wesbos&lt;/a&gt;
 a while back.&lt;/p&gt;

&lt;p&gt;Whilst making my own page, it was fun looking through all the other &lt;code&gt;/uses&lt;/code&gt; pages over on Wes' &lt;a href="https://github.com/wesbos/awesome-uses"&gt;awesome-uses repo&lt;/a&gt;. I then tried searching dev.to for more examples, but not much turned up. So for that reason, I'm making the &lt;a href="https://dev.to/t/uses"&gt;#uses&lt;/a&gt; tag. &lt;small&gt;(sort of like the dev.to equivalent of &lt;a href="https://www.reddit.com/r/battlestations/"&gt;/r/battlestations&lt;/a&gt; right?)&lt;/small&gt;&lt;/p&gt;

&lt;p&gt;So hopefully now, anyone else sharing info or photos of their setup can easily find others too. Oh and here's my own &lt;code&gt;/uses&lt;/code&gt; page:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://nervewax.com/uses"&gt;nervewax.com/uses&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/t/uses"&gt;#uses&lt;/a&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>showdev</category>
      <category>productivity</category>
      <category>uses</category>
    </item>
    <item>
      <title>One command deploy with GitHub Pages</title>
      <dc:creator>nervewax</dc:creator>
      <pubDate>Thu, 01 Aug 2019 23:00:00 +0000</pubDate>
      <link>https://forem.com/nervewax/one-command-deploy-with-github-pages-2bf6</link>
      <guid>https://forem.com/nervewax/one-command-deploy-with-github-pages-2bf6</guid>
      <description>&lt;p&gt;&lt;small&gt;&lt;em&gt;Cover image by the magnificent &lt;a href="https://andreewallin.com/"&gt;Andre Wallin&lt;/a&gt;&lt;/em&gt;&lt;/small&gt;&lt;/p&gt;

&lt;p&gt;One of the caveats of &lt;a href="https://pages.github.com/"&gt;GitHub Pages&lt;/a&gt; is that it won’t automatically build your site if you’re not using the GitHub Pages Jekyll gem. On top of this, you can’t use any Jekyll plugins that aren’t &lt;a href="https://pages.github.com/versions/"&gt;supported by GitHub Pages&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That being said, GitHub will deploy &lt;em&gt;compiled&lt;/em&gt; code for you, either from the &lt;code&gt;/docs&lt;/code&gt; folder, a &lt;code&gt;gh-pages&lt;/code&gt; branch or from the &lt;code&gt;master&lt;/code&gt; branch. &lt;a href="https://help.github.com/en/articles/configuring-a-publishing-source-for-github-pages"&gt;[ref]&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The solution I’m using right now means still I’m able to run my build process locally and auto-deploy with a single command.&lt;/p&gt;

&lt;p&gt;So for this to work, I’ve set up two branches for my site:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;master&lt;/code&gt; contains my Jekyll compiled &lt;code&gt;_site/&lt;/code&gt; folder, which GitHub will deploy each time it’s pushed. 

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.nojekyll&lt;/code&gt; should be added to this branch so GitHub doesn’t attempt to compile it.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sources&lt;/code&gt; contains the full repo, with the Jekyll source files. 

&lt;ul&gt;
&lt;li&gt;This method could work with any static site generator.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;_site/&lt;/code&gt; should be added to the .gitignore on this branch, so you don’t commit the changes in there.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I’ve written a simple &lt;a href="https://nervewax.com/npm-scripts-compiler/"&gt;npm shell script&lt;/a&gt; that runs with &lt;code&gt;npm deploy&lt;/code&gt;, which is essentially an alias for the following string of commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bundle exec jekyll build &amp;amp;&amp;amp;
cd _site/ &amp;amp;&amp;amp;
git add . &amp;amp;&amp;amp;
timestamp=$(date \"+%s\") &amp;amp;&amp;amp;
git commit -m \"automated deployment $timestamp\" &amp;amp;&amp;amp;
git push origin master &amp;amp;&amp;amp;
cd ..
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Each time I want to deploy:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The &lt;code&gt;jekyll build&lt;/code&gt; command compiles and builds my static site inside the &lt;code&gt;_site/&lt;/code&gt; folder.&lt;/li&gt;
&lt;li&gt;We then change directories to &lt;code&gt;_site/&lt;/code&gt;, which has a .git config, set to the &lt;code&gt;master&lt;/code&gt; branch of the repo.&lt;/li&gt;
&lt;li&gt;The script then commits all changes (+ timestamp), pushes master and returns to my source folder.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That’s it! So now, once I’ve made changes to my site or content, I can still have my site built and deployed with a single command.&lt;/p&gt;

&lt;h3&gt;
  
  
  Further reading
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://nervewax.com/ghost-to-jekyll/"&gt;Moving from Ghost CMS to Jekyll&lt;/a&gt;&lt;br&gt;
&lt;a href="https://help.github.com/en/categories/github-pages-basics"&gt;GitHub Pages Basics&lt;/a&gt;&lt;br&gt;
&lt;a href="https://jekyllrb.com/docs/"&gt;Official Jekyll Docs&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>githubpages</category>
      <category>productivity</category>
      <category>jekyll</category>
    </item>
    <item>
      <title>Automating RTL CSS</title>
      <dc:creator>nervewax</dc:creator>
      <pubDate>Sat, 20 Jul 2019 15:00:00 +0000</pubDate>
      <link>https://forem.com/nervewax/automating-rtl-css-a29</link>
      <guid>https://forem.com/nervewax/automating-rtl-css-a29</guid>
      <description>&lt;p&gt;When a site needs right-to-left (RTL) support for languages such as Arabic, Urdu or Hebrew, the general rule is all styles should be “mirrored”, so the page flow matches the experience in left-to-right (LTR).&lt;/p&gt;

&lt;p&gt;At first this can seem like a daunting task, since all CSS specific to left or right needs to be swapped, along with the entire layout of the page.&lt;/p&gt;

&lt;p&gt;The best place to start is by adding &lt;code&gt;dir="rtl"&lt;/code&gt; to the opening &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt; tag at the top of your markup. This indicates to the browser that the text flow should be presented the opposite way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Automation
&lt;/h2&gt;

&lt;p&gt;Enter &lt;a href="https://www.npmjs.com/package/cssjanus"&gt;CSSJanus&lt;/a&gt;, an npm package based on a project originally made by google, designed to automate the conversion of LTR CSS to RTL.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;CSSJanus is a CSS parser utility designed to aid the conversion of a website’s layout from LTR to RTL. […] CSSJanus will change most of the obvious CSS property names and their values as well as some not-so-obvious ones.&lt;/p&gt;

&lt;p&gt;– &lt;cite&gt;&lt;a href="https://code.google.com/archive/p/cssjanus/"&gt;Google Code Archive - CSSJanus&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In order to make use of the package, I put together a simple node script and hooked it into my npm scripts workflow.&lt;/p&gt;

&lt;p&gt;In my &lt;a href="https://dev.to/nervewax/npm-scripts-as-a-build-tool-n4"&gt;npm scripts compiler post&lt;/a&gt;, I covered the basic idea of using minimal single-use scripts in sequence to automate stuff. To get this script in place, it was just a case of adding the custom script to the end of the main build script.&lt;/p&gt;

&lt;p&gt;For reference, here’s the node script I made for the job:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Dependencies.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;path&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cssjanus&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./node_modules/cssjanus&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Source the ltr stylesheet.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ltrCss&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;readFileSync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;__dirname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./style.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// Run CSSJanus.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;rtlCss&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;cssjanus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;ltrCss&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Output rtl css file.&lt;/span&gt;
&lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;writeFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./rtl.css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;rtlCss&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;RTL CSS generated.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Manual tweaks
&lt;/h2&gt;

&lt;p&gt;I found CSSJanus did the trick for most styles, however in some situations a default opposite was needed, so when cssjanus did it’s thing that style could be swapped.&lt;/p&gt;

&lt;p&gt;For example, if something is being set with absolute positioning &lt;code&gt;left: 10px&lt;/code&gt;, then setting &lt;code&gt;right: auto&lt;/code&gt; in the same selector allows for the styles to be swapped automagically.&lt;/p&gt;

&lt;p&gt;If the styles are in plain css, the built in &lt;code&gt;/* @noflip */&lt;/code&gt; flag can be used to have a style ignored by CSSJanus. This is detailed on the npm package readme.&lt;/p&gt;

&lt;p&gt;In some cases, an extra little hack can be used by making use of dir property. It’s specificity will be higher, making it easy to override other styles.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;dir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;'rtl'&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;float&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;left&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Further reading
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://cssjanus.github.io/"&gt;CSS Janus web tool&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/direction"&gt;Mozilla MDN web docs - direction property&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.w3.org/International/questions/qa-html-dir"&gt;w3.org Structural markup and right-to-left text in HTML&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>css</category>
      <category>html</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>NPM Scripts as a Build Tool</title>
      <dc:creator>nervewax</dc:creator>
      <pubDate>Sun, 09 Jun 2019 16:00:00 +0000</pubDate>
      <link>https://forem.com/nervewax/npm-scripts-as-a-build-tool-n4</link>
      <guid>https://forem.com/nervewax/npm-scripts-as-a-build-tool-n4</guid>
      <description>&lt;p&gt;Build tools are great for helping devs save time by automating tasks. In this post, I’ll explain how I’m using npm scripts as a build tool, by directly running packages, rather than going via something like Grunt, Gulp, Webpack, Parcel etc.&lt;/p&gt;

&lt;p&gt;For those already familiar with the tools mentioned above, I hope this offers a simpler alternative. Those who’ve not used build tools before, this could be an easy entry point, since a lot can be achieved with even just a basic understanding.&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s npm?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/"&gt;Node Package Manager&lt;/a&gt; is a software registry, that many developers use to download their favourite packages and tools, usually via the &lt;a href="https://docs.npmjs.com/cli/npm"&gt;npm Command Line Interface&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To use npm, &lt;a href="https://nodejs.org/"&gt;install Node.js&lt;/a&gt; on your machine, then you’ll have access to the npm cli in your shell by typing &lt;code&gt;npm&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Also, see &lt;a href="https://docs.npmjs.com/downloading-and-installing-node-js-and-npm"&gt;“Downloading and installing Node.js and npm”&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scripts example
&lt;/h2&gt;

&lt;p&gt;Once you have npm on your machine, add a &lt;code&gt;package.json&lt;/code&gt; file to your project root or run &lt;code&gt;npm init&lt;/code&gt;. This file contains info about your project, packages you’ve added and any scripts defined, amongst other things. A basic package.json will look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"test-project"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"echo &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;Test works!&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Under “scripts” is where all our npm scripts are defined. Running &lt;code&gt;npm test&lt;/code&gt; inside the directory with this package.json will return &lt;code&gt;Test works!&lt;/code&gt; in the shell, try it for yourself!&lt;/p&gt;

&lt;h2&gt;
  
  
  npm as a build tool
&lt;/h2&gt;

&lt;p&gt;Using npm scripts, we can put together more complex tasks, similar to the ones you might find in other build tools. Then, with the help of some utility packages, we can have the tasks run in sequence or parallel and trigger when changes are made to specific files.&lt;/p&gt;

&lt;p&gt;Over on GitHub, I’ve created a repo with my own &lt;a href="https://github.com/nervewax/npm-compiler/blob/master/package.json"&gt;package.json&lt;/a&gt; that contains scripts which form a basic build process.&lt;/p&gt;

&lt;p&gt;In this file, I’ve added tasks like &lt;code&gt;build&lt;/code&gt;, &lt;code&gt;clean&lt;/code&gt; and &lt;code&gt;watch&lt;/code&gt;, which run other subtasks grouped via their keyword. For example &lt;code&gt;watch:*&lt;/code&gt; refers to all tasks starting with &lt;code&gt;watch:&lt;/code&gt;. Using these tasks, this tool accomplishes the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Compiles sass files into CSS files.&lt;/li&gt;
&lt;li&gt;Minifies CSS and JS files.&lt;/li&gt;
&lt;li&gt;Compresses images and SVG files, ready for a live site.&lt;/li&gt;
&lt;li&gt;Runs the above tasks after saving changes and refreshes the browser.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/nervewax/npm-compiler"&gt;github.com/nervewax/npm-compiler&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you want to get started with npm scripts yourself, try downloading the repo and running some of the tasks included. Once you’re more familiar with those, you can assemble your own build process to fit your needs.&lt;/p&gt;

&lt;p&gt;Below I’ve made a list of the packages found in my repo and what they do. Each of these packages has its own instructions, found in the readme of the corresponding linked npm page.&lt;/p&gt;

&lt;h3&gt;
  
  
  Utilities
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/mkdirp"&gt;mkdirp&lt;/a&gt; - makes a directory and any sub-directories, which is useful for when you need to create folder structures.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/onchange"&gt;onchange&lt;/a&gt; - watches files and then runs a task when anything is added, changed or deleted.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/npm-run-all"&gt;npm-run-all&lt;/a&gt; - lets you run multiple tasks in sequence or parallel to each other.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/rimraf"&gt;rimraf&lt;/a&gt; - runs the remove command recursively, including read only files.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/livereload"&gt;livereload&lt;/a&gt; - refreshes your browser when it detects changes.&lt;/p&gt;

&lt;h3&gt;
  
  
  CSS
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/node-sass"&gt;node-sass&lt;/a&gt; - compiles scss files into css.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/postcss-cli"&gt;postcss-cli&lt;/a&gt; - After running the above, &lt;a href="https://github.com/postcss/postcss"&gt;PostCSS&lt;/a&gt; can then be used to run a few more tasks, they are the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/autoprefixer"&gt;autoprefixer&lt;/a&gt; - automatically adds vendor prefixes to any styles that need them, in order to work in different browsers. Such as the &lt;code&gt;-webkit-&lt;/code&gt; or &lt;code&gt;-ms-&lt;/code&gt; prefixes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/pixrem"&gt;pixrem&lt;/a&gt; - provides a &lt;code&gt;px&lt;/code&gt; fallback for &lt;code&gt;rem&lt;/code&gt; units.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/cssnano"&gt;cssnano&lt;/a&gt; - compresses css files.&lt;/p&gt;

&lt;h3&gt;
  
  
  JS
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/terser"&gt;terser&lt;/a&gt; - compresses js files.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/rollup"&gt;rollup&lt;/a&gt; - is not actually included in my repo! But it’s an alternative to dealing with js that also handles es6 modules, so I’ll certainly be looking into using this myself.&lt;/p&gt;

&lt;h3&gt;
  
  
  Other stuff
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/html-minifier"&gt;html-minifier&lt;/a&gt; - compresses HTML files.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/imagemin-cli"&gt;imagemin-cli&lt;/a&gt; - reduces image file size. Although this can be time consuming, so this is a candidate for removal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/svgo"&gt;svgo&lt;/a&gt; - optimises and reduces the file size of SVGs.&lt;/p&gt;

&lt;h2&gt;
  
  
  That's all folks
&lt;/h2&gt;

&lt;p&gt;Hopefully, if you’ve read this, you’ll have a little more insight into what npm scripts can do. Maybe this has also convinced you to switch over from one of the more complex build tools?&lt;/p&gt;

&lt;p&gt;Either way, thanks for reading, if you have any questions, I’d be happy to help if I can. 👋&lt;/p&gt;

&lt;h3&gt;
  
  
  Further reading
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/7249871/what-is-a-build-tool"&gt;What’s a build tool?&lt;/a&gt;&lt;br&gt;
&lt;a href="https://css-tricks.com/why-npm-scripts/"&gt;css-tricks.com/why-npm-scripts&lt;/a&gt;&lt;br&gt;
&lt;a href="https://gablaxian.com/blog/using-npm-as-a-build-tool"&gt;gablaxian.com/blog/using-npm-as-a-build-too&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/"&gt;keithcirkel.co.uk/how-to-use-npm-as-a-build-tool&lt;/a&gt;&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>tutorial</category>
      <category>npm</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Atom Tips 🌶</title>
      <dc:creator>nervewax</dc:creator>
      <pubDate>Tue, 07 May 2019 14:37:19 +0000</pubDate>
      <link>https://forem.com/nervewax/atom-tips-mmn</link>
      <guid>https://forem.com/nervewax/atom-tips-mmn</guid>
      <description>&lt;p&gt;&lt;em&gt;This article was originally posted 16th Sep 2018 at &lt;a href="https://nervewax.com/atom-tips/"&gt;nervewax.com/atom-tips&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I use Github's text editor &lt;a href="https://atom.io/"&gt;Atom&lt;/a&gt; pretty much every day, so I thought maybe I should write up some tips for anyone who's just started with it, or even those thinking about switching to it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Powerful Keys
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Command Palette
&lt;/h3&gt;

&lt;p&gt;Cmd+Shift+P This one is possibly the most useful, it brings up the atom Command Palette. It's best described by Atom themselves in the &lt;a href="https://flight-manual.atom.io/getting-started/sections/atom-basics/"&gt;Flight Manual&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This search-driven menu can do just about any major task that is possible in Atom. Instead of clicking around all the application menus to look for something, you can press Cmd+Shift+P and search for the command.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Fuzzy Finder
&lt;/h3&gt;

&lt;p&gt;Cmd+P When you have a crazy big project, this helps you quickly find and open a file. It uses "fuzzy" search, so the results can match any part of the search query. It also skips git ignored files by default, which is cool.&lt;/p&gt;

&lt;h3&gt;
  
  
  Find &amp;amp; Replace&lt;/h3&gt;


&lt;p&gt;Cmd+F / Cmd+Shift+F Atom's shortcuts for this familiar function have two flavours. The former will just search within the current tab, but by holding shift too, you're able to search the entire open project.&lt;/p&gt;

&lt;p&gt;In addition to this, you can provide a third parameter in the form of a file pattern, so entering &lt;code class="highlighter-rouge"&gt;*.html&lt;/code&gt; will search only HTML files etc. There's also a Regex toggle... but let's not go down that rabbit hole.&lt;/p&gt;
&lt;h2&gt;
  
  
  Packages
&lt;/h2&gt;

&lt;p&gt;There are currently nearly 8000 atom packages available right now, so it can be hard finding the ones that are actually useful. I'll keep it brief, here's my favourite packages:&lt;/p&gt;
&lt;h3&gt;
  
  
  Emmet
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://atom.io/packages/emmet"&gt;emmet&lt;/a&gt; You might be familiar with this one, since it's available in a few other text editors. Basically, it lets you change code like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;ul.list&amp;gt;li.list__item*5&amp;gt;a.list__link
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;into this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;ul&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"list"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"list__item"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"list__link"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"list__item"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"list__link"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"list__item"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"list__link"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"list__item"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"list__link"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"list__item"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"list__link"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Great for quickly preparing markup, it feels so slow when coding without it now! 🐌&lt;/p&gt;

&lt;h3&gt;
  
  
  Tree View Git Status
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://atom.io/packages/tree-view-git-status"&gt;tree-view-git-status&lt;/a&gt; does exactly what it says on the tin, it adds the current git branch and status to your tree view. Even though Atom has recently included this info in the bottom right status area, I feel like the colouring and text provided right there in tree-view is still pretty handy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pigments
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://atom.io/packages/pigments"&gt;pigments&lt;/a&gt; applies the colour value of a colour as the background for that text in the editor. Sort of like this: &lt;span&gt;rgb(25, 187, 134)&lt;/span&gt; - So yep, really handy for visualising what you're doing without switching to browser.&lt;/p&gt;

&lt;h3&gt;
  
  
  File Icons
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://atom.io/packages/file-icons"&gt;file-icons&lt;/a&gt; just swaps out the default file icon for a little icon representing the file type. Surprisingly useful&lt;/p&gt;

&lt;h3&gt;
  
  
  Atom Alignment
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://atom.io/packages/atom-alignment"&gt;atom-alignment&lt;/a&gt; is simple, but &lt;em&gt;so&lt;/em&gt; useful. It's just a keyboard shortcut that lets you quickly align all your variable definitions. This saves you a bit of effort aligning them yourself, but also you get a little feeling of satisfaction seeing everything line up nicely. 🤓&lt;/p&gt;

&lt;h2&gt;
  
  
  Atom Shell Commands
&lt;/h2&gt;

&lt;p&gt;This is a neat feature, if you're regularly switching between your editor and terminal, install atom shell commands and you can use &lt;code class="highlighter-rouge"&gt;atom .&lt;/code&gt; to open your cwd in atom. Do &lt;code class="highlighter-rouge"&gt;atom -h&lt;/code&gt; to see all the other available commands 👌&lt;/p&gt; &lt;p&gt;Atom package manager will also let you install packages with &lt;code class="highlighter-rouge"&gt;apm install [package]&lt;/code&gt;, which is handy for quickly getting set up on a new machine too.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Holy Grail 🍹
&lt;/h2&gt;

&lt;p&gt;Saving the best til last, &lt;a href="http://blog.atom.io/2017/06/13/atom-1-18.html"&gt;Atom v1.18&lt;/a&gt; introduced my new favourite feature, the Git/Github Tab.&lt;/p&gt;

&lt;p&gt;This side panel gives you a visual view of the current state of your local git branch. From here, you can easily navigate changes, resolve merge conflicts, pull/push and much more!&lt;/p&gt;

&lt;p&gt;I'll not go on about it too much, but this feature improved my workflow a fair bit, so I'd certainly recommend Atom for this alone.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MtZrIsbG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://nervewax.com/content/images/2018/02/rWu0kFq1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MtZrIsbG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://nervewax.com/content/images/2018/02/rWu0kFq1.jpg" alt="Atom Wizard"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So now you're a true Atom wizard! 🧙 &lt;a href="http://twitter.com/nervewax"&gt;Let me know&lt;/a&gt; what &lt;em&gt;you&lt;/em&gt; couldn't code without!&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>atom</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Moving from Ghost to Jekyll</title>
      <dc:creator>nervewax</dc:creator>
      <pubDate>Sun, 09 Sep 2018 16:00:00 +0000</pubDate>
      <link>https://forem.com/nervewax/moving-from-ghost-to-jekyll-185b</link>
      <guid>https://forem.com/nervewax/moving-from-ghost-to-jekyll-185b</guid>
      <description>&lt;p&gt;Every so often I like to redo my site, while experimenting with something new. In the past i’ve used Tumblr, WordPress and Ghost, but this time i’m trying out Jekyll.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fnervewax.com%2Fcontent%2Fimages%2F2018%2F03%2Fjekyll.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fnervewax.com%2Fcontent%2Fimages%2F2018%2F03%2Fjekyll.png" alt="Jekyll"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://jekyllrb.com/" rel="noopener noreferrer"&gt;Jekyll&lt;/a&gt; is a fairly well established static site generator, and it’s been really fun learning something new. I’m also a big fan of how neat and minimal the process has been building my site around it. I started out by watching &lt;a href="https://www.youtube.com/watch?v=iWowJBRMtpc" rel="noopener noreferrer"&gt;this video&lt;/a&gt;, which is a nice introduction to the basics of Jekyll.&lt;/p&gt;

&lt;h2&gt;
  
  
  Converting my content
&lt;/h2&gt;

&lt;p&gt;Transitioning from ghost to Jekyll was surprisingly easy. I used a program called &lt;a href="https://github.com/eloyesp/jekyll_ghost_importer" rel="noopener noreferrer"&gt;jekyll_post_importer&lt;/a&gt; to convert my content from the ghost backup file to Jekyll’s markdown files.&lt;/p&gt;

&lt;p&gt;After that, there was a little manual work needed to make sure all the images and tags worked ok. Luckily I’ve not written that much actual content!&lt;/p&gt;

&lt;h2&gt;
  
  
  Where are my tag pages??
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fnervewax.com%2Fcontent%2Fimages%2F2018%2F03%2Fwamd.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fnervewax.com%2Fcontent%2Fimages%2F2018%2F03%2Fwamd.gif" alt="Where are my dragons?!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So moving over from Ghost and Wordpress, I expected Jekyll to have some kind of tag structure, which it does… however Jekyll taxonomies don’t actually come with their own pages as you would expect.&lt;/p&gt;

&lt;p&gt;In order to generate tag archive pages in the same way you’d get with a traditional blog CMS, something extra is needed.&lt;/p&gt;

&lt;p&gt;While searching, I found &lt;a href="http://charliepark.org/tags-in-jekyll/" rel="noopener noreferrer"&gt;this blog&lt;/a&gt;, which I couldn’t quite get working, but reassured me it’s possible. I then checked out &lt;a href="https://github.com/pattex/jekyll-tagging" rel="noopener noreferrer"&gt;this Jekyll plugin&lt;/a&gt;, and that pretty much solved the problem with only a little tweaking. 🙌&lt;/p&gt;

&lt;p&gt;So &lt;a href="https://nervewax.com/tag/project/" rel="noopener noreferrer"&gt;as you can see&lt;/a&gt;, i’ve got a page for each of my tags, and even managed to get it to pull the most recent post’s image using a bit of good old &lt;a href="https://stackoverflow.com/a/41721856/2351788" rel="noopener noreferrer"&gt;interpolation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Related content
&lt;/h2&gt;

&lt;p&gt;Since all my content is tagged, I thought it might be cool to grab a related post if one is available. With very little searching I found &lt;a href="https://blog.webjeda.com/jekyll-related-posts/" rel="noopener noreferrer"&gt;this clever snippet&lt;/a&gt;, which I ended up modifying for my own use.&lt;/p&gt;

&lt;h2&gt;
  
  
  So that’s it!
&lt;/h2&gt;

&lt;p&gt;It’s not the CMS for everyone, but so far i’m liking it and it certainly does the job. Bonus points for fulfilling my developer need for a performant and lean codebase.&lt;/p&gt;

&lt;p&gt;It’s also nice to be writing this directly in Atom too, now to figure out &lt;a href="https://dev.to/nervewax/one-command-deploy-with-github-pages-2bf6"&gt;the best way to push this to live&lt;/a&gt;… 👋&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>jekyll</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
