<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Stephen Howells</title>
    <description>Stephen Howells writes about coding, design, and life.</description>
    <link>https://stephenhowells.net/</link>
    <atom:link href="https://stephenhowells.net/feeds/main.xml" rel="self" type="application/rss+xml" />
    <pubDate>Thu, 04 Oct 2018 20:07:49 -0700</pubDate>
    <lastBuildDate>Thu, 04 Oct 2018 20:07:49 -0700</lastBuildDate>
    <generator>Jekyll v3.5.0</generator>
    
      <item>
        <title>Things 3 →</title>
        <link>https://culturedcode.com/things/blog/2017/05/meet-the-all-new-things/</link>
        <guid isPermaLink="false">https://culturedcode.com/things/blog/2017/05/meet-the-all-new-things/</guid>
        <pubDate>Mon, 29 May 2017 13:44:30 -0700</pubDate>
        <description>&lt;p&gt;German indie app maker Cultured Code recently released the third major version of Things, their classy todo app. This app, five years in the making, is noteworthy as it’s an incredible example of beautiful typography and iconography that carries a delightful user interface. I’ve bought and used previous versions of Things and have always admired Cultured Code’s attention to design. With Things 3 they’ve made one of the strongest statements yet for native platform software to be as beautiful as it is useful.&lt;/p&gt;

&lt;p&gt;I’m currently spending time with the new Things and so far it’s going well. Design matters whether you are building for mobile, desktop, or the browser. My wish is that other software makers will use Things as inspiration to exhibit better restraint in their work. I’m naturally drawn to design that shows restraint and Things is a masterpiece in this regard.&lt;/p&gt;
&lt;p&gt;[&lt;a href="https://stephenhowells.net/things-3/" rel="bookmark" title="Things 3"&gt;Read on StephenHowells.net&lt;/a&gt;]&lt;/p&gt;</description>
        
        <category>links</category>
        
      </item>
    
      <item>
        <title>Next.js 2.0 →</title>
        <link>https://zeit.co/blog/next2</link>
        <guid isPermaLink="false">https://zeit.co/blog/next2</guid>
        <pubDate>Mon, 27 Mar 2017 21:03:56 -0700</pubDate>
        <description>&lt;p&gt;Zeit:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;More than &lt;strong&gt;3.1 million developers&lt;/strong&gt; read our &lt;a href=&quot;https://zeit.co/blog/next&quot;&gt;announcement post&lt;/a&gt; of &lt;a href=&quot;https://github.com/zeit/next.js&quot;&gt;Next.js&lt;/a&gt;. More than &lt;strong&gt;110 contributors&lt;/strong&gt; have submitted patches, examples or improved our documentation. Over &lt;strong&gt;10,000 developers&lt;/strong&gt; have starred us on &lt;a href=&quot;https://github.com/zeit/next.js&quot;&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

  &lt;p&gt;Today, we are proud to introduce &lt;strong&gt;Next 2.0&lt;/strong&gt; to the world.[…]&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;[&lt;a href="https://stephenhowells.net/next-js-2-0/" rel="bookmark" title="Next.js 2.0"&gt;Read on StephenHowells.net&lt;/a&gt;]&lt;/p&gt;</description>
        
        <category>links</category>
        
      </item>
    
      <item>
        <title>Rails 5 User Registration With Devise, Vue.js, and Axios</title>
        <link>https://stephenhowells.net/rails-5-user-registration-with-devise-vue-js-and-axios/</link>
        <guid isPermaLink="false">/rails-5-user-registration-with-devise-vue-js-and-axios/</guid>
        <pubDate>Sat, 18 Mar 2017 12:36:33 -0700</pubDate>
        <description>&lt;p&gt;As I’m writing this it’s 2017 and there is a solid chance your apps use &lt;a href=&quot;https://vuejs.org/&quot;&gt;Vue&lt;/a&gt;, &lt;a href=&quot;https://facebook.github.io/react/&quot;&gt;React&lt;/a&gt;, or &lt;a href=&quot;https://angularjs.org/&quot;&gt;Angular&lt;/a&gt; on the front-end. I was recently working on an app that uses Vue and &lt;a href=&quot;http://rubyonrails.org/&quot;&gt;Rails 5&lt;/a&gt; together. The app has a Vue component where administrators can create new users. The new user’s credentials are sent to the Rails server through a POST request from &lt;a href=&quot;https://github.com/mzabriskie/axios&quot;&gt;Axios&lt;/a&gt;. The Rails app then uses the powerful and flexible &lt;a href=&quot;https://github.com/plataformatec/devise&quot;&gt;Devise&lt;/a&gt; gem to handle user creation and authentication.&lt;/p&gt;

&lt;p&gt;It required a bit of research to learn how to successfully implement this workflow. I’d like to share a few lessons learned in setting this up. Most of the Devise “how to” articles assume you’re using the standard ERB templates that come with the gem, which is obviously antiquated in the new JavaScript heavy world we code in.&lt;/p&gt;

&lt;h2 id=&quot;configuring-axios&quot;&gt;Configuring Axios&lt;/h2&gt;

&lt;p&gt;Axios acts as the HTTP client for Vue. All form submissions and data retrieval from the backend are made possible with Axios. When you’re working in Vue it’ll be among the most important packages you’ll rely upon. There are other good HTTP clients available in the JavaScript community but I’ve found Axios to be my favorite.&lt;/p&gt;

&lt;p&gt;A few small tweaks are needed when importing Axios into your Vue App. These tweaks rely on Axios’ ability to set defaults for use in every request:&lt;/p&gt;

&lt;div class=&quot;language-js highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kr&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Vue&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'vue'&lt;/span&gt;
&lt;span class=&quot;kr&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;axios&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'axios'&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;token&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getElementsByName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'csrf-token'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getAttribute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'content'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;axios&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;defaults&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;common&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'X-CSRF-Token'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;token&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;axios&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;defaults&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;headers&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;common&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'Accept'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'application/json'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Import the Vue and Axios packages when creating a new Vue app.&lt;/li&gt;
  &lt;li&gt;Access the CSRF token that Rails displays in a meta tag towards the top of the &lt;code class=&quot;highlighter-rouge&quot;&gt;application.html.erb&lt;/code&gt; file and save it as a variable.&lt;/li&gt;
  &lt;li&gt;Tell Axios that every request should include the &lt;code class=&quot;highlighter-rouge&quot;&gt;X-CSRF-Token&lt;/code&gt; header with the saved token.&lt;/li&gt;
  &lt;li&gt;Tell Axios that every request should include an &lt;code class=&quot;highlighter-rouge&quot;&gt;Accept&lt;/code&gt; header that only allows JSON as the desired response.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These configuration defaults tell Rails that requests are valid by including the CSRF Token and that all responses should be formatted as JSON. Axios sets the &lt;code class=&quot;highlighter-rouge&quot;&gt;Accept&lt;/code&gt; header to include &lt;em&gt;ALL MIME TYPES&lt;/em&gt; out of the box! This is bad for a number of reasons but easily corrected by specifying the configuration default shown in the example. Devise will read this header and return the proper response. If you don’t specify JSON, Devise will send back HTML which is useless to your Vue app.&lt;/p&gt;

&lt;h2 id=&quot;configuring-devise&quot;&gt;Configuring Devise&lt;/h2&gt;

&lt;p&gt;Devise is one of the more flexible gems for handling user authentication and registration in the Rails ecosystem. It only requires that one controller be customized to accommodate the registration request sent from Vue.&lt;/p&gt;

&lt;p&gt;First, edit the &lt;code class=&quot;highlighter-rouge&quot;&gt;routes.rb&lt;/code&gt; file to enable Devise and specify that there is a custom registration controller:&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;# routes.rb&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;Rails&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;application&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;routes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;draw&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;devise_for&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:users&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;controllers: &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;registrations: &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'registrations'&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;root&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'home#index'&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Then, edit the custom registration controller to allow an authenticated administrator to create a new user from Vue:&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;# app/controllers/registrations_controller.rb&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;RegistrationsController&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Devise&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;RegistrationsController&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;before_action&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:authenticate_user!&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:redirect_unless_admin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;only: &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:create&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;skip_before_action&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:require_no_authentication&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;clear_respond_to&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;respond_to&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:json&lt;/span&gt;

  &lt;span class=&quot;kp&quot;&gt;private&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;redirect_unless_admin&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:unauthorized&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;unless&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;current_user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:admin?&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;sign_up&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;_resource_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_resource&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;kp&quot;&gt;true&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;This controller is mostly copied from a &lt;a href=&quot;http://stackoverflow.com/a/36209399/1678740&quot;&gt;Stack Overflow answer&lt;/a&gt; where a good explanation of the code is already discussed. It is essentially adjusting Devise’s filters to allow an authenticated administrator to create a user then respond to the request with JSON if the front-end client specifies it in the &lt;code class=&quot;highlighter-rouge&quot;&gt;Accept&lt;/code&gt; header. We’ve already configured Axios to ask for a JSON response so now Vue and Rails are speaking to each other nicely. You don’t need to make any further changes to Devise. You may be tempted to edit the &lt;code class=&quot;highlighter-rouge&quot;&gt;devise.rb&lt;/code&gt; initializer in hopes of troubleshooting this workflow but that isn’t necessary and in some cases may break things.&lt;/p&gt;

&lt;h2 id=&quot;create-a-new-user&quot;&gt;Create a New User&lt;/h2&gt;

&lt;p&gt;In the Vue component simply make the POST request to the Rails app with the user credentials stored in the &lt;code class=&quot;highlighter-rouge&quot;&gt;v-model&lt;/code&gt; for the form inputs:&lt;/p&gt;

&lt;div class=&quot;language-js highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nx&quot;&gt;methods&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;onSubmit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;axios&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'/users'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;password&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;password&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;response&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;// whatever you want&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;error&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;// whatever you want&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The form’s &lt;code class=&quot;highlighter-rouge&quot;&gt;onSubmit&lt;/code&gt; method is called by Vue when specified in the template: &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;form v-on:submit.prevent=&quot;onSubmit&quot;&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;In this article I’ve only covered adding a new user through a Vue front-end as an administrator. However, this same concept can easily be applied to authenticating new sessions, editing user information, and allowing users to register on their own. Once Axios is configured properly to communicate with Devise it’s only a matter of overriding the gem’s controllers to achieve whatever functionality you want.&lt;/p&gt;
</description>
        
        <category>articles</category>
        
      </item>
    
      <item>
        <title>Nice and Neat</title>
        <link>https://stephenhowells.net/nice-and-neat/</link>
        <guid isPermaLink="false">/nice-and-neat/</guid>
        <pubDate>Mon, 06 Mar 2017 11:44:03 -0700</pubDate>
        <description>&lt;p&gt;When I first coded this site in Jekyll I decided to make life easy and use &lt;a href=&quot;http://getbootstrap.com/&quot;&gt;Bootstrap&lt;/a&gt; to organize the web templates. The main advantage was the nice grid system, mobile responsive navigation, and quick time to launch. It served its purpose by helping me finish the project in a hurry, one weekend, and the results were fine.&lt;/p&gt;

&lt;p&gt;As time passed I’ve had this notion in my mind that eventually I’d do a rewrite specifically to remove Bootstrap. The site’s layout is minimal and doesn’t justify the full weight of the framework. Also, some of the visual elements from Bootstrap appeared overly default for my taste and I never felt motivated to heavily restyle them. Finally, the responsive menu system was unnecessary because the site’s navigation is simple. Obviously, using a front-end framework has its advantages and can prevent reinventing the wheel. Why write my own custom grid system when there are countless others to choose from?&lt;/p&gt;

&lt;p&gt;This past Saturday I noticed &lt;a href=&quot;https://thoughtbot.com/&quot;&gt;Thoughtbot&lt;/a&gt; had recently released version 2.0.0 of their lightweight grid system &lt;a href=&quot;http://neat.bourbon.io/&quot;&gt;Neat&lt;/a&gt;. This was all the motivation I needed to start rewriting the site’s templates. I felt an unexpected sense of relief when I removed Bootstrap, almost as if I had regained control of the page. Neat doesn’t affect styling of page elements, it only focuses on the layout grid. Also, I did drop in the tiny &lt;a href=&quot;https://github.com/necolas/normalize.css/&quot;&gt;Normalize.css&lt;/a&gt; library because it offers a sensible baseline to begin customizing the page.&lt;/p&gt;

&lt;p&gt;Once again the rewrite took a weekend and that proved to me that using a heavy framework like Bootstrap isn’t always the time saver I believed it was. The real value in Bootstrap becomes more apparent when developing a prototype web app. It’s nice when all the buttons, menus, and tables are already formatted. It’s worth mentioning that I could pull in a customized version of Bootstrap that omitted the elements I didn’t need but I honestly never bothered to do that. I would guess that most quick weekend projects people put together just grab the full framework off the CDN.&lt;/p&gt;

&lt;p&gt;So how did I like using Neat? I loved it! It’s an incredible approach to grids because it’s just a series of SASS mixins you drop into your stylesheets. You assign which items on your page are columns and that’s it. The result is a super lightweight stylesheet and a very flexible grid. It does have a small learning curve as the syntax is a bit unique but it’s not hard to learn. I’d use Neat again for projects both large and small. It’s the type of library that never feels like it’s taken over my project. Those are the libraries I plan to use whenever possible.&lt;/p&gt;
</description>
        
        <category>articles</category>
        
      </item>
    
      <item>
        <title>Use Operator Mono and Fira Code Together in Atom →</title>
        <link>https://medium.com/@peterpme/operator-mono-fira-code-the-best-of-both-worlds-191be512fd5e#.5smx4blrp</link>
        <guid isPermaLink="false">https://medium.com/@peterpme/operator-mono-fira-code-the-best-of-both-worlds-191be512fd5e#.5smx4blrp</guid>
        <pubDate>Thu, 02 Mar 2017 09:41:19 -0700</pubDate>
        <description>&lt;p&gt;Sometimes I find a total gem on Medium that was published several months ago. This quick blog post by Peter Piekarczyk is an example of such a gem. Peter explains the virtues of Fira Code (spoiler: the cool ligatures) and Operator Mono (spoiler: the cursive) and how to use them together in Atom. I’ve tried this neat trick and I must admit it made my text editor look and feel very unique.&lt;/p&gt;
&lt;p&gt;[&lt;a href="https://stephenhowells.net/use-operator-mono-and-fira-code-together-in-atom/" rel="bookmark" title="Use Operator Mono and Fira Code Together in Atom"&gt;Read on StephenHowells.net&lt;/a&gt;]&lt;/p&gt;</description>
        
        <category>links</category>
        
      </item>
    
      <item>
        <title>RethinkDB Joins The Linux Foundation →</title>
        <link>https://rethinkdb.com/blog/rethinkdb-joins-linux-foundation/</link>
        <guid isPermaLink="false">https://rethinkdb.com/blog/rethinkdb-joins-linux-foundation/</guid>
        <pubDate>Mon, 13 Feb 2017 12:10:45 -0700</pubDate>
        <description>&lt;p&gt;Michael Glukhovsky:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;RethinkDB is alive and well: active development can continue without disruption. Users can continue to run RethinkDB in production with the expectation that it will receive updates. The website, GitHub organization, and social media accounts will also continue operating. The interim leadership team will work with the community to establish formal governance for the project. Under the aegis of The Linux Foundation, the project has strong institutional support and the capacity to accept donations.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;RethinkDB is one of the best examples of a thoughtful modern data store. Its survival and ongoing community contributions are an incredible outcome for this sadly overlooked product.&lt;/p&gt;
&lt;p&gt;[&lt;a href="https://stephenhowells.net/rethinkdb-joins-the-linux-foundation/" rel="bookmark" title="RethinkDB Joins The Linux Foundation"&gt;Read on StephenHowells.net&lt;/a&gt;]&lt;/p&gt;</description>
        
        <category>links</category>
        
      </item>
    
      <item>
        <title>Rails 5 →</title>
        <link>http://weblog.rubyonrails.org/2016/6/30/Rails-5-0-final/</link>
        <guid isPermaLink="false">http://weblog.rubyonrails.org/2016/6/30/Rails-5-0-final/</guid>
        <pubDate>Fri, 01 Jul 2016 11:07:22 -0700</pubDate>
        <description>&lt;p&gt;David Heinemeier Hansson:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;It’s taken hundreds of contributors and thousands of commits to get here, but what a destination: Rails 5.0 is without a doubt the best, most complete version of Rails yet.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Rails continues to be the gold standard for iterative improvement and community involvement.&lt;/p&gt;
&lt;p&gt;[&lt;a href="https://stephenhowells.net/rails-5/" rel="bookmark" title="Rails 5"&gt;Read on StephenHowells.net&lt;/a&gt;]&lt;/p&gt;</description>
        
        <category>links</category>
        
      </item>
    
      <item>
        <title>Use Elixir in CodeRunner 2</title>
        <link>https://stephenhowells.net/use-elixir-in-coderunner-2/</link>
        <guid isPermaLink="false">/use-elixir-in-coderunner-2/</guid>
        <pubDate>Sat, 18 Jun 2016 10:07:01 -0700</pubDate>
        <description>&lt;p&gt;Recently, I’ve been tinkering around with the &lt;a href=&quot;http://elixir-lang.org/&quot;&gt;Elixir&lt;/a&gt; language and have quite enjoyed it. It does offer a nice interactive environment named IEX which functions quite similarly to IRB in the Ruby world. While IEX is a great place to get started I prefer to tinker with code in &lt;a href=&quot;https://coderunnerapp.com/&quot;&gt;CodeRunner&lt;/a&gt;. It’s a hybrid of a text editor and the Terminal wrapped in a nice GUI. Mac based developers will feel right at home in CodeRunner. Basically, you compose code in an editor pane, complete with customizable syntax highlighting, and can view the results in an adjacent pane as they would appear in the shell. This workflow is fast and elegant.&lt;/p&gt;

&lt;p&gt;CodeRunner doesn’t include Elixir out of the box but adding a new language is very easy. We’ll need to enter a few Terminal commands to start with:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# Install Elixir on OS X if you don't already have it with Homebrew.&lt;/span&gt;
brew update
brew install elixir

&lt;span class=&quot;c&quot;&gt;# Download the TextMate language grammar for Elixir.&lt;/span&gt;
curl -O https://raw.githubusercontent.com/elixir-lang/elixir-tmbundle/master/Syntaxes/Elixir.tmLanguage
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Then, in CodeRunner’s preferences visit the “Languages” tab and click the plus sign in the lower left. Name the new syntax “Elixir” and then in the “Syntax Mode” dropdown box select &lt;code class=&quot;highlighter-rouge&quot;&gt;Other…&lt;/code&gt;. Navigate to where you saved the &lt;code class=&quot;highlighter-rouge&quot;&gt;Elixir.tmLanguage&lt;/code&gt; file earlier and select it. You’re almost finished. The following two screenshots display the required configuration to start using Elixir:&lt;/p&gt;

&lt;figure&gt;&lt;img src=&quot;https://stephenhowells.net/dist/img/2016-06-18_8_17_37AM.png&quot; data-action=&quot;zoom&quot; /&gt;&lt;/figure&gt;

&lt;figure&gt;&lt;img src=&quot;https://stephenhowells.net/dist/img/2016-06-18_8_18_10AM.png&quot; data-action=&quot;zoom&quot; /&gt;&lt;/figure&gt;

&lt;p&gt;Once those settings are saved in CodeRunner you’ll have the option to start using Elixir. Just choose it in the dropdown box for a new file:&lt;/p&gt;

&lt;figure&gt;&lt;img src=&quot;https://stephenhowells.net/dist/img/2016-06-18_2_48_03PM.png&quot; data-action=&quot;zoom&quot; /&gt;&lt;/figure&gt;
</description>
        
        <category>articles</category>
        
      </item>
    
      <item>
        <title>Prevent Widows in Jekyll and Middleman</title>
        <link>https://stephenhowells.net/prevent-widows-in-jekyll-and-middleman/</link>
        <guid isPermaLink="false">/prevent-widows-in-jekyll-and-middleman/</guid>
        <pubDate>Fri, 17 Jun 2016 09:04:24 -0700</pubDate>
        <description>&lt;p&gt;One of my major pet peeves while reading Internet publications is when article titles (normally wrapped in header tags) display line breaks that result in unfortunate widows. A widow is when a line break occurs and a single lonely word is bumped to the next line, left to poke me in eye.&lt;/p&gt;

&lt;p&gt;Luckily, this can easily be avoided in both Jekyll and Middleman. The goal is to determine if the title is at least two words in length and then replace the last space in the title with an &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;amp;nbsp;&lt;/code&gt;. This non-breaking space will keep the last two words married together so that in the event of a line break they will always bump down to the next line together.&lt;/p&gt;

&lt;p&gt;The following code is a Jekyll filter that is used in Liquid templates. Simply place this filter in a file named &lt;code class=&quot;highlighter-rouge&quot;&gt;filters.rb&lt;/code&gt; and save it to the &lt;code class=&quot;highlighter-rouge&quot;&gt;_plugins&lt;/code&gt; folder (create this file and folder if you don’t have them):&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;# filters.rb&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;Jekyll&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;module&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;WidowFilter&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;no_widows&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;strip&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&amp;amp;nbsp;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;strip&lt;/span&gt;
      &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;no&quot;&gt;Liquid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Template&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;register_filter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Jekyll&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;WidowFilter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The filter is easily invoked in a Liquid template:&lt;/p&gt;

&lt;div class=&quot;language-html highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;{{ post.title | no_widows }}&lt;span class=&quot;nt&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The process is very similar in Middleman except it’s referred to as a helper instead of a filter. Place the following code in the &lt;code class=&quot;highlighter-rouge&quot;&gt;config.rb&lt;/code&gt; file:&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;# config.rb&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;helpers&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;no_widows&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;strip&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&amp;amp;nbsp;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;strip&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Middleman supports both Haml and ERB. To use the helper in Haml:&lt;/p&gt;

&lt;div class=&quot;language-haml highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;%h1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;no_widows&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;article&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Or in ERB:&lt;/p&gt;

&lt;div class=&quot;language-erb highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;%=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;no_widows&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;article&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;If you view the source code for this site you’ll see that I use the same technique for my titles. It’s a nice touch and the type of attention to detail that makes a better experience for the reader.&lt;/p&gt;
</description>
        
        <category>articles</category>
        
      </item>
    
      <item>
        <title>Byword Previews in Marked 2 with AppleScript</title>
        <link>https://stephenhowells.net/byword-previews-in-marked-2-with-applescript/</link>
        <guid isPermaLink="false">/byword-previews-in-marked-2-with-applescript/</guid>
        <pubDate>Tue, 23 Sep 2014 15:55:44 -0700</pubDate>
        <description>&lt;p&gt;I’m a big fan of both &lt;a href=&quot;http://www.bywordapp.com&quot;&gt;Byword&lt;/a&gt; and &lt;a href=&quot;http://marked2app.com/&quot;&gt;Marked 2&lt;/a&gt;. &lt;em&gt;The Sweet Setup&lt;/em&gt; recently declared Byword to be &lt;a href=&quot;http://thesweetsetup.com/apps/favorite-markdown-writing-app-mac/&quot;&gt;their favorite Markdown writing app&lt;/a&gt; and deservedly so. While Byword does offer a Markdown preview to quickly ensure everything is formatted correctly, its functionality is limited. Marked on the other hand is a Markdown processing powerhouse. It offers many advanced options to both preview and export HTML such as MultiMarkdown and GitHub Flavored Markdown. If you maintain a blog it’s the best $14 you’ll ever spend. I wrote an AppleScript that allows me to author posts in Byword and automatically preview them in Marked with a simple hotket. I use &lt;kbd&gt;command&lt;/kbd&gt; + &lt;kbd&gt;shift&lt;/kbd&gt; + &lt;kbd&gt;m&lt;/kbd&gt;.&lt;/p&gt;

&lt;div class=&quot;language-applescript highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;tell&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;application&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Byword&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;activate&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;the_document&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;save&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;the_document&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;tell&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;application&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Marked 2&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;the_file&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;the_document&lt;/span&gt;'s &lt;span class=&quot;nv&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;the_file&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;activate&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;tell&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;tell&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;I use &lt;a href=&quot;http://www.keyboardmaestro.com/main/&quot;&gt;Keyboard Maestro&lt;/a&gt; to invoke the script but &lt;a href=&quot;http://www.red-sweater.com/fastscripts/&quot;&gt;FastScripts&lt;/a&gt; and &lt;a href=&quot;http://www.alfredapp.com/&quot;&gt;Alfred&lt;/a&gt; can both do the job. Conveniently, it will automatically prompt you to save the file in Byword if you’re working on a brand new document. Once saved, invoking the script again will provide the desired result. If you’re an iA Writer fan&lt;sup id=&quot;fnref:0923201415551&quot;&gt;&lt;a href=&quot;#fn:0923201415551&quot; class=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; the same script will work by simply replacing the reference to Byword with iA Writer.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:0923201415551&quot;&gt;
      &lt;p&gt;Which I’m not, long story.&amp;nbsp;&lt;a href=&quot;#fnref:0923201415551&quot; class=&quot;reversefootnote&quot;&gt;&amp;#x21A9;&amp;#xFE0E;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</description>
        
        <category>articles</category>
        
      </item>
    
  </channel>
</rss>
