<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Scott Watermasysk</title>
    <description>Family, Life, Business, Code, and some sports</description>
    <link>https://scottw.com/</link>
    <atom:link href="https://scottw.com/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Tue, 23 Apr 2019 19:04:41 +0000</pubDate>
    <lastBuildDate>Tue, 23 Apr 2019 19:04:41 +0000</lastBuildDate>
    <generator>Jekyll v3.8.5</generator>
    
    
      <item>
        <title>Hash#new</title>
        <description>&lt;p&gt;I was reading this post on &lt;a href=&quot;https://dev.to/raquelxmoss/using-hashfetch-in-ruby-for-better-nil-handling-2l8h&quot;&gt;Hash#fetch&lt;/a&gt;, and it reminded me of another lesser used/understood method on Ruby’s Hash object, &lt;code class=&quot;highlighter-rouge&quot;&gt;new&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Typically, in Ruby, a hash is created by using just the &lt;code class=&quot;highlighter-rouge&quot;&gt;{}&lt;/code&gt; literal. This is the equivalent of just doing &lt;code class=&quot;highlighter-rouge&quot;&gt;Hash.new&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;h1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{}&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;h2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Hash&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Regardless of which option you choose, you get the same result.&lt;/p&gt;

&lt;p&gt;However, as in most things Ruby, there is more than one way. The Hash initializer has three options:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;No parameters&lt;/li&gt;
  &lt;li&gt;A default parameter&lt;/li&gt;
  &lt;li&gt;A Block&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Next to the literal, the one I use most often is option #2, a default parameter. Typically, I use this when I want to count a bunch of things.&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&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;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&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;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;h&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Hash&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&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;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;each&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;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&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;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;h&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;#{1=&amp;gt;3, 2=&amp;gt;1, 3=&amp;gt;2, 4=&amp;gt;1}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Without the &lt;code class=&quot;highlighter-rouge&quot;&gt;Hash.new(0)&lt;/code&gt; we would have to check for nil, or do an assignment like &lt;code class=&quot;highlighter-rouge&quot;&gt;(h[i] ||= 0) += 1&lt;/code&gt; which is much less readable and depending on what you are iterating over can get complicated.&lt;/p&gt;
</description>
        <pubDate>Mon, 25 Mar 2019 13:32:30 +0000</pubDate>
        <link>https://scottw.com/hash-new</link>
        
        <guid isPermaLink="true">https://scottw.com/hash-new</guid>
      </item>
    
      <item>
        <title>Multiple Heroku Environments</title>
        <description>&lt;p&gt;When you have multiple environments for an app on Heroku each command you execute requires you to pass in the -a (–app) flag with the app name. Heroku app names need to be unique not just for you, but for Heroku as a whole. This means the app name might not always be as memorable as you would like. KickoffLabs is actually broken up into three separate apps which further complicates things (6 total app names).&lt;/p&gt;

&lt;p&gt;Instead of using the -a flag, you can also use the git remote name via the –remote flag.&lt;/p&gt;

&lt;p&gt;The remote name only needs to be unique within your app. This means you can reign in this craziness a bit by using your own git remote names. By default, Heroku creates a remote called &lt;code class=&quot;highlighter-rouge&quot;&gt;heroku&lt;/code&gt;. You can use the &lt;code class=&quot;highlighter-rouge&quot;&gt;git remote rename&lt;/code&gt; command to rename your remote(s) to something more consistent&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git remote rename original_name new_name
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With this knowledge, you can create more consistent names for your remotes. I generally go with &lt;code class=&quot;highlighter-rouge&quot;&gt;production&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;staging&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Next, I add the following to my zsh profile:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;function &lt;/span&gt;hs&lt;span class=&quot;o&quot;&gt;(){&lt;/span&gt;
  heroku  &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$@&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--remote&lt;/span&gt; staging
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;function &lt;/span&gt;hp&lt;span class=&quot;o&quot;&gt;(){&lt;/span&gt;
  heroku  &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$@&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--remote&lt;/span&gt; production
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now, anything I want to do to production, is as simple as:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;hp config:set &lt;span class=&quot;nv&quot;&gt;VAR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1234
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And the same can be done in staging:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;hs config:set &lt;span class=&quot;nv&quot;&gt;VAR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1234
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Mon, 25 Mar 2019 13:11:13 +0000</pubDate>
        <link>https://scottw.com/multiple-heroku-environments</link>
        
        <guid isPermaLink="true">https://scottw.com/multiple-heroku-environments</guid>
      </item>
    
      <item>
        <title>Introducing Jekyll Rest</title>
        <description>&lt;p&gt;Executive Summary - &lt;a href=&quot;https://github.com/scottwater/jekyll_rest&quot;&gt;Jekyll Rest&lt;/a&gt; allows you to publish to a Jekyll based site which uses Github as a repository.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;One of the things I like about the Jekyll + Github + Netlify combination is there is nothing to manage. No backups. No (major) concerns with hosting. Ultimately, nothing to do but write&lt;sup id=&quot;fnref:1&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;. This is actual serverless IMO.&lt;/p&gt;

&lt;p&gt;The trade-off is a slower publishing flow and usually being tied to a computer with Git access. Most of the time this is not as big of an issue as it would seem (how many of you blog more than once a week). However, I am continuing to try and flush out my “shorts” concept and always needing to be at a computer with Git access was slowing me down.&lt;/p&gt;

&lt;p&gt;I had initially hoped I could leverage Zapier and avoid writing any code. Unfortunately, Zapier&lt;sup id=&quot;fnref:2&quot;&gt;&lt;a href=&quot;#fn:2&quot; class=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt; only got me about 50% there. Zapier is willing and able to receive a post from me from just about any tool (web, email, and even SMS), but I could not figure out how to correctly format my content to make it work with the Github V3 rest API&lt;sup id=&quot;fnref:3&quot;&gt;&lt;a href=&quot;#fn:3&quot; class=&quot;footnote&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;

&lt;p&gt;The more I play with Zapier, the more convinced I am I could make it work, but I soon realized that sending in posts from various devices require a bit more finessing of the data. This ultimately made writing it in Ruby even more appealing.&lt;/p&gt;

&lt;p&gt;In the end, I built something I am calling Jekyll Rest. It is a single endpoint you host on your own in a matter of seconds on Heroku.&lt;/p&gt;

&lt;p&gt;It has just one endpoint, &lt;code class=&quot;highlighter-rouge&quot;&gt;create&lt;/code&gt;. This endpoint was written to be as flexible as possible. You can specify all of the individual parameters (title, date, body, etc.) or you can send it a block of frontmatter. It will do its best to decipher what you meant, even extracting a title from your content if necessary. The rules for this are defined on the &lt;a href=&quot;https://github.com/scottwater/jekyll_rest/blob/master/README.md&quot;&gt;GitHub readme&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;With this endpoint, you can do a couple of things:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;You can add it Zapier. This enables you to compose blog posts via email or SMS.&lt;/li&gt;
  &lt;li&gt;Automate your workflow.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I have done both. I have it set up now so that I quickly email and txt new short posts. I also built a simple UI that helps me share various things I find interesting.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot;&gt;
      &lt;p&gt;I will someday how I can see blogging as just writing &lt;a href=&quot;#fnref:1&quot; class=&quot;reversefootnote&quot;&gt;&amp;#x21A9;&amp;#xFE0E;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:2&quot;&gt;
      &lt;p&gt;Zapier is amazing. &lt;a href=&quot;#fnref:2&quot; class=&quot;reversefootnote&quot;&gt;&amp;#x21A9;&amp;#xFE0E;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:3&quot;&gt;
      &lt;p&gt;The biggest issue was base64 encoding the content &lt;a href=&quot;#fnref:3&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>
        <pubDate>Mon, 11 Mar 2019 16:30:52 +0000</pubDate>
        <link>https://scottw.com/jekyll-rest</link>
        
        <guid isPermaLink="true">https://scottw.com/jekyll-rest</guid>
      </item>
    
      <item>
        <title>Proxying Requests To Heroku Via Caddy Server</title>
        <description>&lt;p&gt;I wanted to experiment with using &lt;a href=&quot;https://caddyserver.com&quot;&gt;Caddy Server&lt;/a&gt; as a reverse proxy to an application hosted on Heroku.&lt;/p&gt;

&lt;p&gt;If you are not familiar with Caddy, it is a newish, lightweight web server written in Go that was built from the ground up to leverage HTTPS (via Let’s Encrypt). Caddy is general purpose web server, but for now, I am only interested in using it as a reverse proxy.&lt;/p&gt;

&lt;p&gt;You can create a minimalist version of a &lt;a href=&quot;https://caddyserver.com/docs/proxy&quot;&gt;reverse proxy&lt;/a&gt; by adding a &lt;code class=&quot;highlighter-rouge&quot;&gt;Caddyfile&lt;/code&gt; with the following:&lt;/p&gt;

&lt;div class=&quot;language-conf highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;yourdomainname&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;com&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;proxy&lt;/span&gt; / &lt;span class=&quot;n&quot;&gt;proxieddomain&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;com&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You then start Caddy&lt;sup id=&quot;fnref:1&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;, and your requests from &lt;em&gt;yourdomainname.com&lt;/em&gt; should be proxied to &lt;em&gt;proxieddomain.com&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;However, this does not work as is for Heroku. When a request is proxied to Heroku, it needs to know which app to direct the request to. Chances are, &lt;em&gt;yourdomainname.com&lt;/em&gt; is not registered on Heroku&lt;sup id=&quot;fnref:2&quot;&gt;&lt;a href=&quot;#fn:2&quot; class=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;

&lt;p&gt;As you might expect, Caddy allows you to specify some headers which are passed along to the server receiving the proxy request.&lt;/p&gt;

&lt;p&gt;Even better, Caddy has a convenient helper, &lt;code class=&quot;highlighter-rouge&quot;&gt;transparent&lt;/code&gt;&lt;sup id=&quot;fnref:3&quot;&gt;&lt;a href=&quot;#fn:3&quot; class=&quot;footnote&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;, which wraps up the standard headers.&lt;/p&gt;

&lt;p&gt;Using &lt;code class=&quot;highlighter-rouge&quot;&gt;transparent&lt;/code&gt;, our original example now looks like this:&lt;/p&gt;

&lt;div class=&quot;language-conf highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;yourdomainname&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;com&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;proxy&lt;/span&gt; / &lt;span class=&quot;n&quot;&gt;proxieddomain&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;com&lt;/span&gt; {
  &lt;span class=&quot;n&quot;&gt;transparent&lt;/span&gt;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;To keep you up to speed, &lt;code class=&quot;highlighter-rouge&quot;&gt;transparent&lt;/code&gt; is shorthand for:&lt;/p&gt;

&lt;div class=&quot;language-conf highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;yourdomainname&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;com&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;proxy&lt;/span&gt; / &lt;span class=&quot;n&quot;&gt;proxieddomain&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;com&lt;/span&gt; {
  &lt;span class=&quot;n&quot;&gt;header_upstream&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Host&lt;/span&gt; {&lt;span class=&quot;n&quot;&gt;host&lt;/span&gt;}
  &lt;span class=&quot;n&quot;&gt;header_upstream&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Real&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt; {&lt;span class=&quot;n&quot;&gt;remote&lt;/span&gt;}
  &lt;span class=&quot;n&quot;&gt;header_upstream&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Forwarded&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;For&lt;/span&gt; {&lt;span class=&quot;n&quot;&gt;remote&lt;/span&gt;}
  &lt;span class=&quot;n&quot;&gt;header_upstream&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Forwarded&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Port&lt;/span&gt; {&lt;span class=&quot;n&quot;&gt;server_port&lt;/span&gt;}
  &lt;span class=&quot;n&quot;&gt;header_upstream&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Forwarded&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Proto&lt;/span&gt; {&lt;span class=&quot;n&quot;&gt;scheme&lt;/span&gt;}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Less Code == More Gooder! Well, except here. Heroku fails in the Host header is set to anything other than the &lt;em&gt;proxieddomain.com&lt;/em&gt;. This one took quite a while to figure out. &lt;a href=&quot;https://scottw.com/s88&quot;&gt;Thank you very much curl!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I reached out to Heroku and they confirmed that the HOST header is used internally&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The Heroku router uses the host header for routing traffic on the platform. If you are specifying a host that is not setup as a custom domain on your application these sorts of requests will fail because they won’t be able to be routed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Using &lt;code class=&quot;highlighter-rouge&quot;&gt;header_upstream Host {host}&lt;/code&gt; the host header is set to &lt;em&gt;yourdomainname.com&lt;/em&gt;&lt;sup id=&quot;fnref:4&quot;&gt;&lt;a href=&quot;#fn:4&quot; class=&quot;footnote&quot;&gt;4&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;

&lt;p&gt;But in the end, the following works and provides all the benefits of &lt;code class=&quot;highlighter-rouge&quot;&gt;transparent&lt;/code&gt;, just a couple of extra lines:&lt;/p&gt;

&lt;div class=&quot;language-conf highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;yourdomainname&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;com&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;proxy&lt;/span&gt; / &lt;span class=&quot;n&quot;&gt;proxieddomain&lt;/span&gt;.&lt;span class=&quot;n&quot;&gt;com&lt;/span&gt; {
  &lt;span class=&quot;n&quot;&gt;header_upstream&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Real&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;IP&lt;/span&gt; {&lt;span class=&quot;n&quot;&gt;remote&lt;/span&gt;}
  &lt;span class=&quot;n&quot;&gt;header_upstream&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Forwarded&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;For&lt;/span&gt; {&lt;span class=&quot;n&quot;&gt;remote&lt;/span&gt;}
  &lt;span class=&quot;n&quot;&gt;header_upstream&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Forwarded&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Port&lt;/span&gt; {&lt;span class=&quot;n&quot;&gt;server_port&lt;/span&gt;}
  &lt;span class=&quot;n&quot;&gt;header_upstream&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Forwarded&lt;/span&gt;-&lt;span class=&quot;n&quot;&gt;Proto&lt;/span&gt; {&lt;span class=&quot;n&quot;&gt;scheme&lt;/span&gt;}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;You will also likely want to include either &lt;code class=&quot;highlighter-rouge&quot;&gt;header_upstream X-Forwarded-Host {host}&lt;/code&gt; or &lt;code class=&quot;highlighter-rouge&quot;&gt;header_upstream Origin {host}&lt;/code&gt; so that you know which domain is actually being proxied.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot;&gt;
      &lt;p&gt;If you are completely new, checkout the getting started guide to make sure you generate your SSL cert first &lt;a href=&quot;#fnref:1&quot; class=&quot;reversefootnote&quot;&gt;&amp;#x21A9;&amp;#xFE0E;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:2&quot;&gt;
      &lt;p&gt;Otherwise, why would you need to proxy it? 😀 &lt;a href=&quot;#fnref:2&quot; class=&quot;reversefootnote&quot;&gt;&amp;#x21A9;&amp;#xFE0E;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:3&quot;&gt;
      &lt;p&gt;“Passes thru host information from the original request as most backend apps would expect.” &lt;a href=&quot;#fnref:3&quot; class=&quot;reversefootnote&quot;&gt;&amp;#x21A9;&amp;#xFE0E;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:4&quot;&gt;
      &lt;p&gt;The {} in the configuration are &lt;a href=&quot;https://caddyserver.com/docs/placeholders&quot;&gt;Caddy’s placeholders&lt;/a&gt;. &lt;a href=&quot;#fnref:4&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>
        <pubDate>Thu, 07 Mar 2019 19:59:26 +0000</pubDate>
        <link>https://scottw.com/heroku-caddy</link>
        
        <guid isPermaLink="true">https://scottw.com/heroku-caddy</guid>
      </item>
    
      <item>
        <title>Bugs are Inevitable. Your Response is What Matters</title>
        <description>&lt;p&gt;Bug, defects, delays, etc will always happen. With good practices, you can minimize them, but they will always exist.&lt;/p&gt;

&lt;p&gt;You can however control &lt;strong&gt;how you respond to them&lt;/strong&gt;. This message from &lt;a href=&quot;http://www.wasdkeyboards.com/&quot;&gt;WASD&lt;/a&gt; is exceptional.&lt;sup id=&quot;fnref:1&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/posts/wasd_sorry.png&quot; alt=&quot;Sorry email from WASD&quot; /&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Accept fault&lt;/li&gt;
  &lt;li&gt;Apologize&lt;/li&gt;
  &lt;li&gt;Provide details and supporting information.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;footnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot;&gt;
      &lt;p&gt;If you are following my &lt;a href=&quot;https://scottw.com/mac-mechanical-keyboard-search&quot;&gt;keyboard journey&lt;/a&gt;, interactions with WASD like this won me over. &lt;a href=&quot;#fnref:1&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>
        <pubDate>Wed, 20 Feb 2019 13:22:29 +0000</pubDate>
        <link>https://scottw.com/your-response</link>
        
        <guid isPermaLink="true">https://scottw.com/your-response</guid>
      </item>
    
      <item>
        <title>Better Jekyll Excerpts</title>
        <description>&lt;p&gt;When you use the built-in excerpt feature, Jekyll returns the first paragraph of text. It does this by looking for something called the &lt;em&gt;excerpt_separator&lt;/em&gt;. The excerpt_separator defaults to &lt;code class=&quot;highlighter-rouge&quot;&gt;\n\n&lt;/code&gt;, which is ideal for most short posts.&lt;/p&gt;

&lt;!--custom--&gt;

&lt;p&gt;Back in my LiveWriter days, it would use an HTML comment like &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;!--more--&amp;gt;&lt;/code&gt; to designate where to break for an excerpt. Jekyll supports this as well. In your _config.yml file you can add:&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;na&quot;&gt;excerpt_separator&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;lt;!--more--&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Unfortunately, this now means that on every post, you need to enter &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;!--more--&amp;gt;&lt;/code&gt;, even if you are OK with the default of the first paragraph. The alternative is to add &lt;code class=&quot;highlighter-rouge&quot;&gt;excerpt_separator: &amp;lt;!--more--&amp;gt;&lt;/code&gt; for each post you want to control the excerpt.&lt;/p&gt;

&lt;p&gt;Adding the excerpt_separator when needed is slightly better, but still too manual for my tastes.&lt;/p&gt;

&lt;p&gt;Instead, I wrote a small plugin you can drop in your _plugins directory.&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&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;Hooks&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;register&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:posts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:pre_render&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'excerpt_separator'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;nil?&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;content&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=~&lt;/span&gt; &lt;span class=&quot;sr&quot;&gt;/^(&amp;lt;!--\s*more\s*--&amp;gt;)$/&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;excerpt_separator&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;vg&quot;&gt;$1&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'excerpt'&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;no&quot;&gt;Jekyll&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Excerpt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;post&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;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;For each post, when building, it looks to see if there is a &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;!--more--&amp;gt;&lt;/code&gt; in the body. If it is found it sets it as the excerpt_separator. Otherwise, it uses the default &lt;code class=&quot;highlighter-rouge&quot;&gt;\n\n&lt;/code&gt;.&lt;/p&gt;
</description>
        <pubDate>Tue, 12 Feb 2019 11:49:54 +0000</pubDate>
        <link>https://scottw.com/better-jekyll-excerpts</link>
        
        <guid isPermaLink="true">https://scottw.com/better-jekyll-excerpts</guid>
      </item>
    
      <item>
        <title>Michelle Obama On Startup Pricing</title>
        <description>&lt;p&gt;On startup pricing, Michelle Obama famously said,&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;…our motto is: when they go low, we go high&lt;sup id=&quot;fnref:1&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A post on Indie Hackers reminded me of this quote:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;So, I’m thinking if I should try offering an email service, similar to Google Apps, but more affordable..&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Just raise prices has been the rallying cry in the bootstrap community for the last couple of years&lt;sup id=&quot;fnref:2&quot;&gt;&lt;a href=&quot;#fn:2&quot; class=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;, but this is a different topic.&lt;/p&gt;

&lt;p&gt;When competing with large entrenched competitors competing on price is almost always the wrong strategy. Founders, especially those who were developers, grossly underestimate what it takes to build and &lt;strong&gt;support&lt;/strong&gt; something.&lt;/p&gt;

&lt;p&gt;Google could easily run Google Apps for nothing (they did for a long time). The price is already low, and they likely could go lower. They have resources and margins you will never attain.&lt;/p&gt;

&lt;p&gt;Instead, how you compete with an entrenched competitor is with things they cannot possibly compete with like support and personal interactions. In the case of Google Apps, a couple of dollars a month (even 100s) is not going to make a big difference. But personally setting up the DNS? Helping the customer figure out DKIM records, SPF records, correctly using their business domain for email with their other third-party integrations will make a significant difference and one that they will likely be able to pay for with much better margins.&lt;/p&gt;

&lt;p&gt;Find your competitive advantage and use it.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot;&gt;
      &lt;p&gt;According to the facts, I am taking this quote completely out of context. Please do not let the facts get in the way of my story. &lt;a href=&quot;#fnref:1&quot; class=&quot;reversefootnote&quot;&gt;&amp;#x21A9;&amp;#xFE0E;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
    &lt;li id=&quot;fn:2&quot;&gt;
      &lt;p&gt;I am increasingly less convinced high(er) prices is the only answer. More on this in the future. &lt;a href=&quot;#fnref:2&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>
        <pubDate>Sun, 10 Feb 2019 12:53:54 +0000</pubDate>
        <link>https://scottw.com/michelle-obama-startup-pricing</link>
        
        <guid isPermaLink="true">https://scottw.com/michelle-obama-startup-pricing</guid>
      </item>
    
      <item>
        <title>Unlimited Software Does Not Exist</title>
        <description>&lt;p&gt;In software, nothing is unlimited. You can market and sell your product &lt;em&gt;without any limits&lt;/em&gt;, but when it comes to computing, &lt;strong&gt;there are always limits&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;One such limit, bit me in the ass yesterday.&lt;/p&gt;

&lt;p&gt;KickoffLabs uses recursive queries in a couple of places. These are great because they can often limit hops back and forth to the database. Generally, they recurse two or so levels deep.&lt;/p&gt;

&lt;p&gt;Unfortunately, a customer (or customer’s customer) managed to go many levels deep….and you probably guessed it by now, without any limits. Furthermore, one of these queries generates more related recursive queries.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/posts/limits.png&quot; alt=&quot;Oh no! When things went wrong&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The green in the picture is database work. It was not the number of queries causing the problem, just the amount of work they were doing. These queries in turn started to push everything else back, exhaust connections, etc….a fun time for all.&lt;/p&gt;

&lt;p&gt;The good news is overall the system held up quite well. For a couple of hours our response time was over our desired limits, but we were still very much operational.&lt;/p&gt;

&lt;p&gt;We now have a limit in place on the depth of our recursive queries.&lt;/p&gt;

&lt;p&gt;These bugs frustrate the bajeebus&lt;sup id=&quot;fnref:1&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; out of me. It is so obvious once you see it and it I borderline preach always having some limits.&lt;/p&gt;

&lt;p&gt;As penance for my sins against computing, I could not sleep last night, and I ended up starting on the real fix at 2 am.&lt;/p&gt;

&lt;p&gt;If you have a moment, look around your code and see if there is something which needs some a ‘just in case’ limit.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot;&gt;
      &lt;p&gt;I got to use the word bajeebus…it is all worth it. &lt;a href=&quot;#fnref:1&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>
        <pubDate>Wed, 06 Feb 2019 16:00:16 +0000</pubDate>
        <link>https://scottw.com/limits</link>
        
        <guid isPermaLink="true">https://scottw.com/limits</guid>
      </item>
    
      <item>
        <title>What Are Shorts? And Why You Should Use Them Too.</title>
        <description>&lt;p&gt;There are few things lamer than blogging about blogging, but this is a subject I think is very important.&lt;/p&gt;

&lt;p&gt;In my virtual circles, Twitter has killed blogging. I do not believe Twitter did it on purpose. Twitter is simple, and you can reach a lot of people quickly. And despite all the negative energy around Twitter, it still the place where I learn the most on a daily basis.&lt;/p&gt;

&lt;p&gt;What concerns me about blogging’s demise is how much information vanishes after a couple of minutes.  You can like it, but good luck finding in the future.&lt;/p&gt;

&lt;p&gt;What I am trying to do instead is something I am calling shorts. A short is a post that is either small enough to live inside a tweet or has enough formatting applied so that it can start as a tweet and can be followed on site if it piques your interest.&lt;/p&gt;

&lt;p&gt;I even went as far as building a simple UI which posts to this (static!) blog:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/posts/shorts_ui.png&quot; alt=&quot;Shorts UI Demo&quot; /&gt;&lt;/p&gt;

&lt;p&gt;If you are interested in the logic around the posts, you can see &lt;a href=&quot;https://github.com/scottwater/blog/blob/master/_plugins/short_feed_hook.rb&quot;&gt;my Jekyll hook here&lt;/a&gt;. In a nutshell:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Figure out if there is an excerpt defined or not&lt;/li&gt;
  &lt;li&gt;Format the excerpt/content&lt;/li&gt;
  &lt;li&gt;If it is a link to another site, link to it directly otherwise link back to this site only if we need more than 280 characters.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I then push the posts to their &lt;a href=&quot;http://scottw.com/shortfeed.xml&quot;&gt;own feed&lt;/a&gt; and allow Zapier to deliver them to Twitter.&lt;/p&gt;

&lt;p&gt;The other significant benefit of this approach is I will have a list of content that I find essential that lives outside of Twitter.&lt;/p&gt;

&lt;p&gt;Long term, I would love to make this easy for everyone, but for now, I wanted to share how I am doing it and provide some tips and strategies for doing it yourself as well.&lt;/p&gt;

</description>
        <pubDate>Mon, 04 Feb 2019 23:23:07 +0000</pubDate>
        <link>https://scottw.com/what-your-shorts-why-you-should-use-them-too</link>
        
        <guid isPermaLink="true">https://scottw.com/what-your-shorts-why-you-should-use-them-too</guid>
      </item>
    
      <item>
        <title>Simplifying Shorti's Api</title>
        <description>&lt;p&gt;If you are not familiar, &lt;a href=&quot;https://scottw.com/shorti&quot;&gt;Shorti&lt;/a&gt; is my API only simple URL shortener. The &lt;a href=&quot;https://github.com/scottwater/shorti&quot;&gt;source is on GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Initially, all of the API endpoints returned JSON. JSON is convenient, and the tools around it are great these days. However, I did notice that in my primary use cases it was adding some unnecessary steps, especially when using it with shell scripts.&lt;/p&gt;

&lt;p&gt;Since it is a relatively new project, I thought it was best to fix this now.&lt;/p&gt;

&lt;p&gt;I made a change that now checks the HTTP ACCEPT header. If it is &lt;code class=&quot;highlighter-rouge&quot;&gt;application/json&lt;/code&gt;, the API will return JSON. If it is anything else, it will return plain text.&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;is_json_request?&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;accept&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;application/json&quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;What is nice is that you can now simply do something like this:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; curl &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;url=https://scottw.com&amp;amp;api_key=HOAGIES&quot;&lt;/span&gt; https://shortilinks.herokuapp.com | pipe_some_where
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Also of interest, &lt;code class=&quot;highlighter-rouge&quot;&gt;respond_to&lt;/code&gt; is not available by default in a Rails API project. I am sure there is a way to retroactively add it, but for now I went with something simple.&lt;/p&gt;

</description>
        <pubDate>Sat, 02 Feb 2019 14:24:46 +0000</pubDate>
        <link>https://scottw.com/simplifying-shorti-api</link>
        
        <guid isPermaLink="true">https://scottw.com/simplifying-shorti-api</guid>
      </item>
    
  </channel>
</rss>
