bridgetownrb_williamkennedy.ninja.atom.xml - sfeed_tests - sfeed tests and RSS and Atom files
 (HTM) git clone git://git.codemadness.org/sfeed_tests
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
       bridgetownrb_williamkennedy.ninja.atom.xml (99283B)
       ---
            1 <?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://bridgetownrb.com/" version="1.0.0">Bridgetown</generator><link href="https://williamkennedy.ninja/feed.xml" rel="self" type="application/atom+xml" /><link href="https://williamkennedy.ninja/" rel="alternate" type="text/html" /><updated>2022-05-08T12:03:45+00:00</updated><id>https://williamkennedy.ninja/feed.xml</id><title type="html">William Kennedy </title><subtitle>Ruby on Rails Developer based in Dublin</subtitle><entry><title type="html">In Defence of the Single Page Application</title><link href="https://williamkennedy.ninja/javascript/2022/05/03/in-defence-of-the-single-page-application/" rel="alternate" type="text/html" title="In Defence of the Single Page Application" /><published>2022-05-03T00:00:00+00:00</published><updated>2022-05-03T00:00:00+00:00</updated><id>repo://posts.collection/_posts/2022-05-03-in-defence-of-the-single-page-application.md</id><content type="html" xml:base="https://williamkennedy.ninja/javascript/2022/05/03/in-defence-of-the-single-page-application/">&lt;div class=&quot;flex flex-col items-center justify-center mt-4 mx-auto&quot;&gt;
            2 &lt;svg class=&quot;animate-spin text-center -ml-1 mr-3 h-40 w-40 text-indigo&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; fill=&quot;none&quot; viewBox=&quot;0 0 24 24&quot;&gt;
            3 &lt;circle class=&quot;opacity-25&quot; cx=&quot;12&quot; cy=&quot;12&quot; r=&quot;10&quot; stroke=&quot;currentColor&quot; stroke-width=&quot;4&quot;&gt;&lt;/circle&gt;
            4 &lt;path class=&quot;opacity-75&quot; fill=&quot;currentColor&quot; d=&quot;M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z&quot;&gt;&lt;/path&gt;
            5 &lt;/svg&gt;
            6 &lt;p&gt;Loading article...&lt;/p&gt;
            7 &lt;/div&gt;</content><author><name>William Kennedy</name></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://williamkennedy.ninja/assets/images/posts/html.jpg" /><media:content medium="image" url="https://williamkennedy.ninja/assets/images/posts/html.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">How to upgrade your Bridgetown site</title><link href="https://williamkennedy.ninja/bridgetown/2022/03/14/how-to-upgrade-your-bridgetown-site/" rel="alternate" type="text/html" title="How to upgrade your Bridgetown site" /><published>2022-03-14T00:00:00+00:00</published><updated>2022-03-14T00:00:00+00:00</updated><id>repo://posts.collection/_posts/2022-03-14-how-to-upgrade-your-bridgetown-site.md</id><content type="html" xml:base="https://williamkennedy.ninja/bridgetown/2022/03/14/how-to-upgrade-your-bridgetown-site/">&lt;p&gt;If you run into trouble upgrading your Bridgetown site, this might help you.&lt;/p&gt;
            8 
            9 &lt;p&gt;I have been building small sites with Bridgetown for a while now. Sometimes Rails is not a good fit for particular projects, and Bridgetown offers just enough to get things done and enjoy the process. Plus, it uses Ruby. The best part.&lt;/p&gt;
           10 
           11 &lt;p&gt;Even though it has evolved in ambitions, Bridgetown remains a static site generator.&lt;/p&gt;
           12 
           13 &lt;p&gt;What is a static site generator?&lt;/p&gt;
           14 
           15 &lt;p&gt;Before the days of frameworks, Javascript build tools and random compile errors, websites used to be the just folder you FTP up to a server and voila. Your website was live.&lt;/p&gt;
           16 
           17 &lt;p&gt;Now things are different, we have more advanced needs, but people like me pine for those days before Webpack error two hundred and one cropped up to ruin the day.&lt;/p&gt;
           18 
           19 &lt;p&gt;Tangent aide, I have been using Bridgetown for about two years on this site, and recently &lt;a href=&quot;https://jaredwhite.com/&quot;&gt;Jared Whyte&lt;/a&gt; announced that &lt;a href=&quot;https://www.bridgetownrb.com/&quot;&gt;Bridgetown Version 1&lt;/a&gt; was ready. I have been so impressed that I even sponsor &lt;a href=&quot;https://github.com/sponsors/jaredcwhite&quot;&gt;Jared on Github&lt;/a&gt;.&lt;/p&gt;
           20 
           21 &lt;p&gt;This is a big deal because I grew up as an Irish farmer. Anyone who knows Irish farmers knows that spending money is a foreign concept. I’m pretty sure Irish farmers can hear bills travelling to their postbox.&lt;/p&gt;
           22 
           23 &lt;p&gt;I wanted to upgrade to the latest version and use Esbuild. I ran into a few issues, so hopefully, this helps anyone with the same problems.&lt;/p&gt;
           24 
           25 &lt;p&gt;After following &lt;a href=&quot;https://www.bridgetownrb.com/docs/installation/upgrade&quot;&gt;the upgrade guide&lt;/a&gt; and &lt;a href=&quot;https://github.com/matoni109/matoni_portfolio/pull/8&quot;&gt;running the script&lt;/a&gt; to switch webpack to esbuild, I ran into some errors.&lt;/p&gt;
           26 
           27 &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;config&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;esbuild&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;defaults&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;js&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;68&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;note: &lt;/span&gt;&lt;span class=&quot;no&quot;&gt;This&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;error&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;came&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;onLoad&quot;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;callback&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;registered&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;here&lt;/span&gt;
           28    &lt;span class=&quot;mi&quot;&gt;68&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;│&lt;/span&gt;   &lt;span class=&quot;n&quot;&gt;build&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;onLoad&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;filter: &lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;/\.(css)$/&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;async&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;args&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; 
           29      &lt;span class=&quot;err&quot;&gt;╵&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;~~~~~~&lt;/span&gt;
           30 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
           31 
           32 &lt;p&gt;&lt;img src=&quot;/assets/images/posts/pokemon_meme.jpeg&quot; alt=&quot;Wild Stacktrace appeared&quot; /&gt;&lt;/p&gt;
           33 
           34 &lt;p&gt;In the end, it turned out that this was because I updated TailwindCSS, and my old &lt;code class=&quot;highlighter-rouge&quot;&gt;tailwind.config.js&lt;/code&gt; was incorrectly formatted.&lt;/p&gt;
           35 
           36 &lt;p&gt;After I corrected my &lt;code class=&quot;highlighter-rouge&quot;&gt;tailwind.config.js&lt;/code&gt; file, everything worked.&lt;/p&gt;
           37 
           38 &lt;p&gt;Here is every step I followed:&lt;/p&gt;
           39 
           40 &lt;ol&gt;
           41   &lt;li&gt;Visited this &lt;a href=&quot;https://www.bridgetownrb.com/docs/installation/upgrade&quot;&gt;site&lt;/a&gt;&lt;/li&gt;
           42   &lt;li&gt;Add the &lt;code class=&quot;highlighter-rouge&quot;&gt;gem puma&lt;/code&gt; to the Gemfile and ran &lt;code class=&quot;highlighter-rouge&quot;&gt;bundle update&lt;/code&gt;&lt;/li&gt;
           43   &lt;li&gt;Ran bundle &lt;code class=&quot;highlighter-rouge&quot;&gt;binstubs bridgetown-core&lt;/code&gt;&lt;/li&gt;
           44   &lt;li&gt;Created a separate bridgetown site and copied over files &lt;code class=&quot;highlighter-rouge&quot;&gt;config.ru&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;Rakefile&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;config/puma.rb&lt;/code&gt;, and everything under &lt;code class=&quot;highlighter-rouge&quot;&gt;server/*&lt;/code&gt;&lt;/li&gt;
           45   &lt;li&gt;Ran &lt;code class=&quot;highlighter-rouge&quot;&gt;bin/bridgetown esbuild migrate-from-webpack&lt;/code&gt; created by &lt;a href=&quot;https://andrewm.codes/&quot;&gt;Andrew Mason&lt;/a&gt;&lt;/li&gt;
           46   &lt;li&gt;Removed &lt;code class=&quot;highlighter-rouge&quot;&gt;start.js&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;sync.js&lt;/code&gt;&lt;/li&gt;
           47   &lt;li&gt;removed browser-sync and concurrently from my &lt;code class=&quot;highlighter-rouge&quot;&gt;package.json&lt;/code&gt;&lt;/li&gt;
           48   &lt;li&gt;Changed the &lt;code class=&quot;highlighter-rouge&quot;&gt;Rakefile&lt;/code&gt; to use &lt;a href=&quot;https://esbuild.github.io/&quot;&gt;esbuild&lt;/a&gt;&lt;/li&gt;
           49 &lt;/ol&gt;
           50 
           51 &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;c1&quot;&gt;# Rakefile&lt;/span&gt;
           52 &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;bridgetown&quot;&lt;/span&gt;
           53 
           54 &lt;span class=&quot;no&quot;&gt;Bridgetown&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;load_tasks&lt;/span&gt;
           55 
           56 &lt;span class=&quot;c1&quot;&gt;# Run rake without specifying any command to execute a deploy build by default.&lt;/span&gt;
           57 &lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;default: :deploy&lt;/span&gt;
           58 
           59 &lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
           60 &lt;span class=&quot;c1&quot;&gt;# Standard set of tasks, which you can customize if you wish:&lt;/span&gt;
           61 &lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
           62 &lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Build the Bridgetown site for deployment&quot;&lt;/span&gt;
           63 &lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:deploy&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;ss&quot;&gt;:clean&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;frontend:build&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
           64  &lt;span class=&quot;no&quot;&gt;Bridgetown&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Commands&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Build&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;start&lt;/span&gt;
           65 &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
           66 
           67 &lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Build the site in a test environment&quot;&lt;/span&gt;
           68 &lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:test&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
           69  &lt;span class=&quot;no&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;BRIDGETOWN_ENV&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;test&quot;&lt;/span&gt;
           70  &lt;span class=&quot;no&quot;&gt;Bridgetown&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Commands&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Build&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;start&lt;/span&gt;
           71 &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
           72 
           73 &lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Runs the clean command&quot;&lt;/span&gt;
           74 &lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:clean&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
           75  &lt;span class=&quot;no&quot;&gt;Bridgetown&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Commands&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Clean&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;start&lt;/span&gt;
           76 &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
           77 
           78 &lt;span class=&quot;n&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:frontend&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
           79  &lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Build the frontend with esbuild for deployment&quot;&lt;/span&gt;
           80  &lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:build&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
           81   &lt;span class=&quot;n&quot;&gt;sh&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;yarn run esbuild&quot;&lt;/span&gt;
           82  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
           83 
           84  &lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Watch the frontend with esbuild during development&quot;&lt;/span&gt;
           85  &lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:dev&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
           86   &lt;span class=&quot;n&quot;&gt;sh&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;yarn run esbuild-dev&quot;&lt;/span&gt;
           87  &lt;span class=&quot;k&quot;&gt;rescue&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Interrupt&lt;/span&gt;
           88  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
           89 &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
           90 
           91 &lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
           92 &lt;span class=&quot;c1&quot;&gt;# Add your own Rake tasks here! You can use `environment` as a prerequisite&lt;/span&gt;
           93 &lt;span class=&quot;c1&quot;&gt;# in order to write automations or other commands requiring a loaded site.&lt;/span&gt;
           94 &lt;span class=&quot;c1&quot;&gt;#&lt;/span&gt;
           95 &lt;span class=&quot;c1&quot;&gt;# task :my_task =&amp;gt; :environment do&lt;/span&gt;
           96 &lt;span class=&quot;c1&quot;&gt;#  puts site.root_dir&lt;/span&gt;
           97 &lt;span class=&quot;c1&quot;&gt;#  automation do&lt;/span&gt;
           98 &lt;span class=&quot;c1&quot;&gt;#   say_status :rake, &quot;I&apos;m a Rake tast =) #{site.config.url}&quot;&lt;/span&gt;
           99 &lt;span class=&quot;c1&quot;&gt;#  end&lt;/span&gt;
          100 &lt;span class=&quot;c1&quot;&gt;# end&lt;/span&gt;
          101 
          102 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
          103 
          104 &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;bin/bridgetown configure bt-postcss
          105 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
          106 
          107 &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;bin/bridgetown configure stimulus
          108 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
          109 
          110 &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;bin/bridgetown configure tailwindcss
          111 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
          112 
          113 &lt;p&gt;After that, I ran into the error where esbuild would not generate the CSS, which was a pain to debug because the stack trace was misleading. However, by correcting the tailwind config, everything started working. This took me a few hours to work out.&lt;/p&gt;
          114 
          115 &lt;p&gt;Next, I had to update my liquid templated because collections work differently.&lt;/p&gt;
          116 &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;&lt;span class=&quot;c&quot;&gt;# Before&lt;/span&gt;
          117 &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;post &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;site.posts %&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
          118 &lt;span class=&quot;c&quot;&gt;#After&lt;/span&gt;
          119 &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;% &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;post &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;collections.posts.resources %&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
          120 
          121 In one of my components, I did the following to keep the same a tag href
          122 &lt;span class=&quot;c&quot;&gt;# Before&lt;/span&gt;
          123 post.url
          124 &lt;span class=&quot;c&quot;&gt;# After&lt;/span&gt;
          125 post.relative_url
          126 
          127 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
          128 
          129 &lt;p&gt;Then I changed my Netlify to run &lt;code class=&quot;highlighter-rouge&quot;&gt;bridgetown deploy&lt;/code&gt; instead of yarn deploy.&lt;/p&gt;
          130 
          131 &lt;p&gt;After that, I had to update my head to use &lt;code class=&quot;highlighter-rouge&quot;&gt;resource title&lt;/code&gt; instead of &lt;code class=&quot;highlighter-rouge&quot;&gt;page.title&lt;/code&gt;.&lt;/p&gt;
          132 
          133 &lt;div class=&quot;language-html 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;c&quot;&gt;&amp;lt;!-- src/_components/head.liquid --&amp;gt;&lt;/span&gt;
          134 &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;charset=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;utf-8&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
          135 &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;viewport&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;content=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;width=device-width, initial-scale=1.0&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
          136 {% capture resource_title %}{{ title | strip_html | strip_newlines }}{% endcapture %}
          137 &lt;span class=&quot;nt&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;{% if resource_title != &quot;Index&quot; %}{{ resource_title | escape }} | {{ metadata.title | escape }}{% else %}{{ metadata.title | escape }}: {{ metadata.tagline | escape }}{% endif %}&lt;span class=&quot;nt&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
          138 
          139 &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;description&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;content=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;{{ metadata.description }}&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
          140 &lt;span class=&quot;nt&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;stylesheet&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;{% asset_path css %}&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
          141 &lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;{% asset_path js %}&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;defer&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
          142 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
          143 
          144 &lt;p&gt;Finally, for the sitemap, I just installed this &lt;a href=&quot;#&quot;&gt;handy gem&lt;/a&gt;(https://github.com/ayushn21/bridgetown-sitemap), which did what my code previously did.&lt;/p&gt;
          145 
          146 &lt;p&gt;Hopefully, that helps anyone who has run into trouble updating their Bridgetown site to version 1.&lt;/p&gt;
          147 
          148 &lt;p&gt;Long live Bridgetown.&lt;/p&gt;</content><author><name>William Kennedy</name></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://williamkennedy.ninja/assets/images/posts/pokemon_meme.jpeg" /><media:content medium="image" url="https://williamkennedy.ninja/assets/images/posts/pokemon_meme.jpeg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">What does scale mean anyway?</title><link href="https://williamkennedy.ninja/business/2022/03/08/what-does-scale-mean-anyway/" rel="alternate" type="text/html" title="What does scale mean anyway?" /><published>2022-03-08T00:00:00+00:00</published><updated>2022-03-08T00:00:00+00:00</updated><id>repo://posts.collection/_posts/2022-03-08-what-does-scale-mean-anyway-.md</id><content type="html" xml:base="https://williamkennedy.ninja/business/2022/03/08/what-does-scale-mean-anyway/">&lt;p&gt;&lt;img src=&quot;/assets/images/posts/what-now.jpeg&quot; alt=&quot;alt text&quot; /&gt;
          149 &lt;span&gt;Photo by &lt;a href=&quot;https://unsplash.com/@timmossholder?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Tim Mossholder&lt;/a&gt; on &lt;a href=&quot;https://unsplash.com/s/photos/question-mark?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Unsplash&lt;/a&gt;
          150   &lt;/span&gt;&lt;/p&gt;
          151 
          152 &lt;h1 id=&quot;what-does-scale-mean-anyway&quot;&gt;What does scale mean anyway?&lt;/h1&gt;
          153 
          154 &lt;p&gt;At different points in a software lifecycle, scale means other things. It also means different things to different people at any particular time. Let’s tease out precisely what this means.&lt;/p&gt;
          155 
          156 &lt;h2 id=&quot;performance&quot;&gt;Performance&lt;/h2&gt;
          157 
          158 &lt;p&gt;One of the first definitions of scale is performance. Can your software scale to the needs of its demand?&lt;/p&gt;
          159 
          160 &lt;p&gt;In the Rails community, there is a meme &lt;em&gt;but does it scale?&lt;/em&gt; It is a criticism that Rails can’t seem to shake since Twitter fail-whale. However, the chances of working on a Rails application that even has that much demand is slim.&lt;/p&gt;
          161 
          162 &lt;p&gt;For this reason, some engineers might create an application using a higher-performance language such as Java, C#, or Go. There is no doubt that the correct technology can help applications scale much more accessible and better than something like Rails but no matter the framework or technology choice, we can break web performance scaling into two main concepts.&lt;/p&gt;
          163 
          164 &lt;ul&gt;
          165   &lt;li&gt;Network optimization&lt;/li&gt;
          166   &lt;li&gt;performant technology practices (such as caching and database optimizations)&lt;/li&gt;
          167 &lt;/ul&gt;
          168 
          169 &lt;h2 id=&quot;ability-to-build-fast&quot;&gt;Ability to Build Fast&lt;/h2&gt;
          170 
          171 &lt;p&gt;Business-minded people point to technology choices as an inhibitor to growth. This is where frameworks such as Laravel and Rails shine, making it easy to get up and running.&lt;/p&gt;
          172 
          173 &lt;p&gt;If a product catches the market’s attention, there will be a need to add new features. These might not be customer-facing features, but they could have to do with a myriad of practices related to reporting, fulfilment etc…&lt;/p&gt;
          174 
          175 &lt;p&gt;The ability to change and improve the product is scale. The chosen technology and practices can impact how the product scales to fit more customers’ needs.&lt;/p&gt;
          176 
          177 &lt;p&gt;As an application grows, it gets harder to change, update and improve. However, TDD can mitigate against this.&lt;/p&gt;
          178 
          179 &lt;h2 id=&quot;support-staff&quot;&gt;Support Staff&lt;/h2&gt;
          180 
          181 &lt;p&gt;If a product is successful, the chances are you might need to hire more people to cope with the demand. Scale in this sense is related to the application and business practices. How do you scale customer support?&lt;/p&gt;
          182 
          183 &lt;p&gt;Knowledge is hard-earned by customer service staff after every customer interaction. How do we ensure that learning is passed on to the next generation of staff? How do we fill the gaps in our support documentation?&lt;/p&gt;
          184 
          185 &lt;h2 id=&quot;sales&quot;&gt;Sales&lt;/h2&gt;
          186 
          187 &lt;p&gt;Like customer service, sales is another area that is difficult to scale. Early customer success is vital if your product is a self-sign-up product; otherwise, churn could become a problem.&lt;/p&gt;
          188 
          189 &lt;p&gt;If the product is complex, your sales process might include a traditional salesperson, sales engineer, account manager, and customer success agent.&lt;/p&gt;
          190 
          191 &lt;h2 id=&quot;processes&quot;&gt;Processes&lt;/h2&gt;
          192 
          193 &lt;p&gt;McDonalds is one the most successful franchises globally because its processes are so good that they can be replicated almost instantly worldwide. Set up a McDonalds in the right area, and it will probably make money. Its processes are among its greatest strengths.&lt;/p&gt;
          194 
          195 &lt;p&gt;You can focus on picking the right area, getting the initial finance and staff and voila. You’re good.&lt;/p&gt;
          196 
          197 &lt;p&gt;Processes are the hardest to scale because they cover many areas, and if they are too cumbersome, they will impede your progress more than enable it.&lt;/p&gt;
          198 
          199 &lt;p&gt;No matter what, we need to look at scale as something more than a physical limit of our machines.&lt;/p&gt;</content><author><name>William Kennedy</name></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://williamkennedy.ninja/assets/images/posts/what-now.jpeg" /><media:content medium="image" url="https://williamkennedy.ninja/assets/images/posts/what-now.jpeg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Recently Read #2 - Ireland’s dark past, an entrepreneur who pioneered wind energy and how browsers work</title><link href="https://williamkennedy.ninja/books/2021/11/29/recently-read-2/" rel="alternate" type="text/html" title="Recently Read #2 - Ireland&apos;s dark past, an entrepreneur who pioneered wind energy and how browsers work" /><published>2021-11-29T00:00:00+00:00</published><updated>2021-11-29T00:00:00+00:00</updated><id>repo://posts.collection/_posts/2021-11-29-recently-read-2.md</id><content type="html" xml:base="https://williamkennedy.ninja/books/2021/11/29/recently-read-2/">&lt;p&gt;&lt;img src=&quot;/assets/images/posts/kimberly-farmer-books.jpeg&quot; alt=&quot;alt text&quot; title=&quot;Books&quot; /&gt;
          200 Photo by &lt;a href=&quot;https://unsplash.com/@kimberlyfarmer?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Kimberly Farmer&lt;/a&gt; on &lt;a href=&quot;https://unsplash.com/s/photos/books?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Unsplash&lt;/a&gt;&lt;/p&gt;
          201 &lt;h1 id=&quot;recently-read-2---irelands-dark-past-an-entrepreneur-who-pioneered-wind-energy-and-how-browsers-work&quot;&gt;Recently Read #2 - Ireland’s dark past, an entrepreneur who pioneered wind energy and how browsers work&lt;/h1&gt;
          202 
          203 &lt;p&gt;This is the second in my series of recently read where I give a brief summary of what I am reading. You can read the others &lt;a href=&quot;https://williamkennedy.ninja/books&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
          204 
          205 &lt;h2 id=&quot;high-performance-browser-networking-by-ilya-grigorik&quot;&gt;&lt;a href=&quot;https://www.oreilly.com/library/view/high-performance-browser/9781449344757/&quot;&gt;High-Performance Browser Networking&lt;/a&gt; by Ilya Grigorik&lt;/h2&gt;
          206 
          207 &lt;h3 id=&quot;why-read-it&quot;&gt;Why read it?&lt;/h3&gt;
          208 
          209 &lt;p&gt;I build web apps for a living, and I’m always keen to know how things work under the hood. In many ways, the way we develop websites and applications are constantly changing. In my short tenure as a software developer (7 years), promising technologies have come and gone to emerge again later.&lt;/p&gt;
          210 
          211 &lt;p&gt;One thing that has not changed is latency and bottlenecks. The fundamentals of how we make websites perform have not changed. Fewer network requests, fewer bytes, and move things closer to our end users while optimising our code for speed and complexity.&lt;/p&gt;
          212 
          213 &lt;p&gt;Even though what we should do is obvious, the why things are the way they are is more complex. I was looking for a book that could give me an in-depth overview of different protocols such as WebRTC, web sockets and HTTP2. The book goes much further than that and tackles networks, wireless networks and even mobile networks.&lt;/p&gt;
          214 
          215 &lt;p&gt;It is an excellent book to read if you want to learn about the journey of the byte as it makes its way around the world.&lt;/p&gt;
          216 
          217 &lt;h3 id=&quot;what-i-learned&quot;&gt;What I Learned?&lt;/h3&gt;
          218 
          219 &lt;p&gt;A lot. It would probably require more than one blog post to go through everything. Not only does it cover what it promises(performance), it also covers everything you could need to know about browser networking.&lt;/p&gt;
          220 
          221 &lt;h3 id=&quot;read-if&quot;&gt;Read if&lt;/h3&gt;
          222 
          223 &lt;p&gt;You’re a web developer.&lt;/p&gt;
          224 
          225 &lt;h2 id=&quot;the-prince-by-niccolò-machiavelli&quot;&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/The_Prince&quot;&gt;The Prince&lt;/a&gt; by Niccolò Machiavelli&lt;/h2&gt;
          226 
          227 &lt;h3 id=&quot;why-read-it-1&quot;&gt;Why read it?&lt;/h3&gt;
          228 
          229 &lt;p&gt;When Trump was elected, I heard that this was because of his Machiavellian brilliance. Being on the other side of the world, I didn’t know much about Trump until his election. After the election, I questioned if the this moniker was a suitable description of Trump.&lt;/p&gt;
          230 
          231 &lt;p&gt;I studied the author’s writings in college, and I have always been interested in leaders who cling to power even when it is slipping through their fingers. It’s evident to everyone but themselves. However, some leaders like Putin, avoid this fate.&lt;/p&gt;
          232 
          233 &lt;p&gt;The Prince was a controversial book. The ideas frightened people (and still do) because it provided a blueprint for power retention. The Catholic Church even banned it at one point.&lt;/p&gt;
          234 
          235 &lt;h3 id=&quot;what-i-learned-1&quot;&gt;What I Learned?&lt;/h3&gt;
          236 
          237 &lt;p&gt;From a historian’s perspective, this book must be a gem. Not only does it act as a guide for rulers, the author references wars, groups and families that he was involved with for a time.&lt;/p&gt;
          238 
          239 &lt;p&gt;Machiavelli writes a lot about Cesare Borgia. Cesare Borgia was, in some ways, a pawn of Pope Alexander. The Pope used Borgia to carry out his plans for the expansion of the church’s lands. Every Pope after Alexander inherited a lot more land.&lt;/p&gt;
          240 
          241 &lt;p&gt;That’s not to say Borgia only followed the Pope’s instructions. Cesare Borgia is the case study of how to stay in power. Through a combination of murdering opponents, positioning and uniting splintered groups(he established an army), Borgia stayed in power for a long time.&lt;/p&gt;
          242 
          243 &lt;p&gt;Cesare Borgia was the Pope’s son. He should not have been able to ascend to power. However, through a combination of luck to get there and incredible intellect to stay there, Borgia retained power.&lt;/p&gt;
          244 
          245 &lt;h3 id=&quot;read-if-1&quot;&gt;Read if&lt;/h3&gt;
          246 
          247 &lt;p&gt;I found this a challenging read. I had to use Wikipedia to fill in some gaps. However, it’s a short read, and I recommend it for people who want to know more about the term Machiavellian. Do people in office politics play the same games as Cesare Borgia minus the violence? Do people court powerful allies to gain power in office?&lt;/p&gt;
          248 
          249 &lt;p&gt;What about our political leaders? Behind closed doors, do policymakers create alliances to push their agenda? Do they sacrifice their allies when the time comes?&lt;/p&gt;
          250 
          251 &lt;p&gt;Probably. Certainly, we can look to leaders such as Putin who have silenced opponents and ascribe machiavellian traits to them.&lt;/p&gt;
          252 
          253 &lt;p&gt;This book has inspired great stories throughout the years and I’ve no doubt it will continue to intrigue us for many years.&lt;/p&gt;
          254 
          255 &lt;h2 id=&quot;a-dangerous-visionary-by-eddie-oconnor&quot;&gt;&lt;a href=&quot;https://www.books.ie/a-dangerous-visionary&quot;&gt;A Dangerous Visionary&lt;/a&gt; by Eddie O’Connor&lt;/h2&gt;
          256 
          257 &lt;h3 id=&quot;why-read-it-2&quot;&gt;Why read it?&lt;/h3&gt;
          258 
          259 &lt;p&gt;I have been &lt;a href=&quot;https://williamkennedy.ninja/reviews/2021/09/06/recently-read-1/&quot;&gt;learning more and more about clean energy in the past year&lt;/a&gt;. Eddie O’Connor started Airtricity before moving on and starting another renewable energy business. I wanted to get insight into what goes into running a renewable energy company.&lt;/p&gt;
          260 
          261 &lt;h3 id=&quot;what-i-learned-2&quot;&gt;What I Learned?&lt;/h3&gt;
          262 &lt;p&gt;One of Ireland’s most successful businessmen started his career in the public service. It’s not something you expect. I think the stereotype about government bureaucrats shrouds the fact that some talented people work in government.&lt;/p&gt;
          263 
          264 &lt;p&gt;O’Connor has proven to be one of those people. After starting at Ireland’s national electricity supply manager(known as ESB - Electricity Supply Board), he rose through the ranks before working as Managing Director of Board Na Mona(another Irish state-owned company), then finally crossing over into the private sector with Airtricity.&lt;/p&gt;
          265 
          266 &lt;p&gt;A lot of his book covers his management style, which involves a lot of process improvement and delegation. Back in the ’90s, he recognised the importance of buy-in, and it’s pretty impressive what he achieved at Bord na Móna. Bord Na Mona is a state-owned company where some workers would embrace the government stereotype of as little work as possible. He was able to root out these inefficiencies by gaining employee buy-in.&lt;/p&gt;
          267 
          268 &lt;p&gt;“The problem with a lazy worker is that they want to make other people lazy”&lt;/p&gt;
          269 
          270 &lt;p&gt;After leaving Board Na Mona, he covered how the media dragged his name through the mud before starting his venture with Airtricity. He had learned in 1989 that climate change was an issue. He saw himself as Ireland’s biggest polluter as Ireland is a net importer of coal for electricity. There was a petite fuel mix for electricity generation in the ’90s.&lt;/p&gt;
          271 
          272 &lt;p&gt;Nowadays, Ireland produces a lot of energy from wind. Solar and wind cheaper are significantly cheaper than coal, and it’s getting lower. Fossil fuels have lost the cost advantage they once had over renewable energy. As of writing, renewable energy sources are four times cheaper than the fossil-fuel counterparts and they’re getting cheaper.&lt;/p&gt;
          273 
          274 &lt;h3 id=&quot;read-if-2&quot;&gt;Read if&lt;/h3&gt;
          275 
          276 &lt;p&gt;If you want a personal and passionate perspective on renewable energy but are business-minded, you might like this book. It lays out the practical implications of renewable energy and the exciting future that lays ahead.&lt;/p&gt;
          277 
          278 &lt;p&gt;If you’re Irish and you like the idea of public servants being called out, this book is not afraid to do that. Senior Civil servants, politicians and others are attacked by O’Connor again and again. Not in a bitter way, more that they would be slow or sly to move.&lt;/p&gt;
          279 
          280 &lt;h2 id=&quot;republic-of-shame-by-caelainn-hogan&quot;&gt;&lt;a href=&quot;https://gutterbookshop.com/product/republic-of-shame-by-caelainn-hogan/&quot;&gt;Republic Of Shame&lt;/a&gt; by Caelainn Hogan&lt;/h2&gt;
          281 
          282 &lt;h3 id=&quot;why-read-it-3&quot;&gt;Why read it?&lt;/h3&gt;
          283 
          284 &lt;p&gt;When travelling abroad and meeting new people, particularly Americans, I get the impression that there is a romantic view of Ireland. Ireland, for the most part, seems to have had a positive cultural impact on our planet. However, we have skeletons in our closet, or should I say we have baby skeletons buried in our sewerage tanks in Tuam, Co. Galway.&lt;/p&gt;
          285 
          286 &lt;p&gt;In 2017, news travelled around the world about a collection of children’s skeletons that were found in a sewerage tank. It was unfortunate timing for the Catholic Church and other religious orders which were supporting the’ No’ side in the upcoming abortion referendum. This story and others set the narrative that these religious orders care more for their own heavenly entry credentials than the welfare of women and children.&lt;/p&gt;
          287 
          288 &lt;p&gt;The Catholic Church used to have a firm grip on Ireland much to our determent.  We are still feeling the effects of the Catholic Church’s influence on our constitution to this day where we’ve had to hold several national referendums on the rights of women, children and gay marriage to name but a few. They also have a strong grip on our education system where they openly practice discrimination against parents who do not practice a ‘catholic ethos’.&lt;/p&gt;
          289 
          290 &lt;p&gt;The Church’s shackles are slowly being shattered piece by piece. The story of the baby skeletons being discovered is a sewerage tank in Tuam was yet another chisel handed to our increasingly secular citizens. It also dragged up a piece of history many in Ireland would rather not know about and some would rather the public did not know.&lt;/p&gt;
          291 
          292 &lt;p&gt;Many were unaware of Ireland’s ‘industrial shame complex’, but the author explores the frightening treatment of vulnerable women under a regime afraid of catholic Ireland shame. Women who became pregnant out of wedlock were treated horribly by their families, the nuns and wider state involvement. Letters exchanged between health boards and the “mother and baby homes” clearly demonstrate an attitude that saw these women as a problem.&lt;/p&gt;
          293 
          294 &lt;p&gt;I lost my faith at the age of 15. School in 90’s Ireland never presented the idea of other religions. Every day, we had to say our prayers before school(and after). When I stopped believing in God, I stood out quite a bit. I remember being the only student not to walk up and sit down to confession with the priest. Every other student queued, but I remained in my seat. The first year I did this, I was only one. The second year, there was 10 more to join me. By the third, it was common to make jokes about priests.&lt;/p&gt;
          295 
          296 &lt;p&gt;This experience and many others led me to view the church with a perspective I don’t think I’ll ever shake. So another book to cast another light on the church in Ireland was always going to appeal to me.&lt;/p&gt;
          297 
          298 &lt;h3 id=&quot;what-i-learned-3&quot;&gt;What I learned&lt;/h3&gt;
          299 
          300 &lt;p&gt;Caelainn Hogan is a terrific writer. She does a fantastic job of describing her own journey and discovery of those affected by mother and baby homes. The books weaves between the personal stories of those affected and the wider role of the Irish culture at the time.&lt;/p&gt;
          301 
          302 &lt;p&gt;The last mother and baby home closed in 1996. It’s on the street where I live, and I walk past the building every time I walk my dog. To read what happened in homes like this is harrowing.&lt;/p&gt;
          303 
          304 &lt;p&gt;What was even more harrowing was the state’s involvement and the general public’s ignorance. I get the impression that the citizens did not know or did not want to question the church’s authority.&lt;/p&gt;
          305 
          306 &lt;p&gt;The nuns come across as heartless. There are countless examples of nuns selling these young infants to the highest bidder(usually American couples looking to adopt).&lt;/p&gt;
          307 
          308 &lt;p&gt;The survival rate of the children in mother and baby homes only went up after the adoption laws were implemented, allowing for Irish children to be adopted.&lt;/p&gt;
          309 
          310 &lt;p&gt;Vulnerable women seemed to have no place to run. Ostracised by their family, they had two options. Turn themselves into the mother and baby home to risk losing their children or flee. Fleeing did not always help. There was an abundance of cases where women running to England were discovered and sent back.&lt;/p&gt;
          311 
          312 &lt;p&gt;The choice these women had was an illusion. In some cases, the choice was made for them by their family.&lt;/p&gt;
          313 
          314 &lt;h3 id=&quot;read-if-3&quot;&gt;Read if&lt;/h3&gt;
          315 
          316 &lt;p&gt;You’re Irish and want a detailed overview of the mother and baby homes. It’s also a great insight into Irish culture under the thumb of the Catholic Church. I think it’s important to read books like this, so we never repeat the past.&lt;/p&gt;</content><author><name>William Kennedy</name></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://williamkennedy.ninja/assets/images/posts/kimberly-farmer-books.jpeg" /><media:content medium="image" url="https://williamkennedy.ninja/assets/images/posts/kimberly-farmer-books.jpeg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Good Citizen Refactoring</title><link href="https://williamkennedy.ninja/refactoring/2021/09/22/good-citizen-refactoring/" rel="alternate" type="text/html" title="Good Citizen Refactoring" /><published>2021-09-22T00:00:00+00:00</published><updated>2021-09-22T00:00:00+00:00</updated><id>repo://posts.collection/_posts/2021-09-22-good-citizen-refactoring.md</id><content type="html" xml:base="https://williamkennedy.ninja/refactoring/2021/09/22/good-citizen-refactoring/">&lt;p&gt;&lt;img src=&quot;/assets/images/posts/dog-coding.jpeg&quot; alt=&quot;alt text&quot; title=&quot;Dog with glasses siting with iPad&quot; /&gt;
          317 &lt;span&gt;Photo by &lt;a href=&quot;https://unsplash.com/@cookiethepom?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Cookie the Pom&lt;/a&gt; on &lt;a href=&quot;https://unsplash.com/s/photos/fix?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Unsplash&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
          318 
          319 &lt;p&gt;No matter how much you try, refactoring is a hard sell. Why change code that works, so a developers job is more straightforward?&lt;/p&gt;
          320 
          321 &lt;p&gt;Refactoring is specific to software development as code is malleable. Users can’t see it, and it doesn’t affect them.&lt;/p&gt;
          322 
          323 &lt;p&gt;However, bad code can make life difficult for the next developer(or you in six months).&lt;/p&gt;
          324 
          325 &lt;p&gt;Yet, explaining the upsides of refactoring to anyone outside of your bubble is hard. So here is a compromise that can help. The next time you have to venture into a particular part of the codebase that’s unpleasant, see if you can apply a &lt;em&gt;small change&lt;/em&gt; to make life better for you and your fellow developers.&lt;/p&gt;
          326 
          327 &lt;h2 id=&quot;adopt-a-good-citizen-culture-at-work&quot;&gt;Adopt a Good Citizen Culture at Work&lt;/h2&gt;
          328 
          329 &lt;p&gt;Refactoring can be as simple as reducing copy and paste code. It can be as complex as creating new classes and modules for easier readability.&lt;/p&gt;
          330 
          331 &lt;p&gt;The next time you’ve wandered in the thick swathes of messy code, try to leave it in a better place for the next person.&lt;/p&gt;
          332 
          333 &lt;p&gt;Nothing needs to be said to anyone outside of the development team. It’s fast, clean and your fellow team will be happier.&lt;/p&gt;
          334 
          335 &lt;h2 id=&quot;keep-refactoring-small&quot;&gt;Keep refactoring small&lt;/h2&gt;
          336 
          337 &lt;p&gt;If you try to refactor too much, it may take focus away from the task.&lt;/p&gt;
          338 
          339 &lt;p&gt;Here is an example of refactoring I did once as part of a more significant task. As part of the task, I had to change the controller. Here is what it looked like&lt;/p&gt;
          340 
          341 &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;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;PostsContoller&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ApplicationController&lt;/span&gt;
          342   &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;edit&lt;/span&gt;
          343     &lt;span class=&quot;vi&quot;&gt;@post&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&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;posts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
          344     &lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;
          345   &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
          346 
          347   &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;show&lt;/span&gt;
          348     &lt;span class=&quot;vi&quot;&gt;@post&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&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;posts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
          349     &lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;
          350   &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
          351 
          352   &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;destroy&lt;/span&gt;
          353     &lt;span class=&quot;vi&quot;&gt;@post&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&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;posts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
          354     &lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;
          355   &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
          356 
          357   &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;publish&lt;/span&gt;
          358     &lt;span class=&quot;vi&quot;&gt;@post&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&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;posts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
          359     &lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;
          360   &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
          361 &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
          362 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
          363 
          364 &lt;p&gt;The above is an example; the real controller was 900 lines long and filled with conditional blocks. However, reducing the file was easy via extraction.&lt;/p&gt;
          365 
          366 &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;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;PostsContoller&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ApplicationController&lt;/span&gt;
          367   &lt;span class=&quot;n&quot;&gt;before_acton&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:set_post&lt;/span&gt;
          368 
          369   &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;edit&lt;/span&gt;
          370     &lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;
          371   &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
          372 
          373   &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;show&lt;/span&gt;
          374     &lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;
          375   &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
          376 
          377   &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;destroy&lt;/span&gt;
          378     &lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;
          379   &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
          380 
          381   &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;publish&lt;/span&gt;
          382     &lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;
          383   &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
          384 
          385   &lt;span class=&quot;kp&quot;&gt;private&lt;/span&gt; 
          386 
          387   &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;set_post&lt;/span&gt;
          388     &lt;span class=&quot;vi&quot;&gt;@post&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&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;posts&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
          389   &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
          390 &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
          391 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
          392 
          393 &lt;p&gt;Now we have removed four lines of code by adding a &lt;code class=&quot;highlighter-rouge&quot;&gt;before_action&lt;/code&gt; to the Rails controller. An experienced Rails developer would be familiar with the above pattern, but I’ve come across this more than once in a few different companies in real-world codebases.&lt;/p&gt;
          394 
          395 &lt;p&gt;This example was a simple refactor I did as part of another task. It required minimal testing but made life easier for the next person even if I left the company.&lt;/p&gt;
          396 
          397 &lt;p&gt;And that is what being a good citizen is all about.&lt;/p&gt;</content><author><name>William Kennedy</name></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://williamkennedy.ninja/assets/images/posts/dog-coding.jpeg" /><media:content medium="image" url="https://williamkennedy.ninja/assets/images/posts/dog-coding.jpeg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Recently Read #1</title><link href="https://williamkennedy.ninja/books/2021/09/06/recently-read-1/" rel="alternate" type="text/html" title="Recently Read #1" /><published>2021-09-06T00:00:00+00:00</published><updated>2021-09-06T00:00:00+00:00</updated><id>repo://posts.collection/_posts/2021-09-06-recently-read--1.md</id><content type="html" xml:base="https://williamkennedy.ninja/books/2021/09/06/recently-read-1/">&lt;p&gt;&lt;img src=&quot;/assets/images/posts/kimberly-farmer-books.jpeg&quot; alt=&quot;alt text&quot; title=&quot;Books&quot; /&gt;
          398 Photo by &lt;a href=&quot;https://unsplash.com/@kimberlyfarmer?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Kimberly Farmer&lt;/a&gt; on &lt;a href=&quot;https://unsplash.com/s/photos/books?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Unsplash&lt;/a&gt;&lt;/p&gt;
          399 
          400 &lt;h2 id=&quot;intro&quot;&gt;Intro&lt;/h2&gt;
          401 
          402 &lt;p&gt;Recently I took a holiday which allowed me to catch up on some books. I’ve mostly been a non-fiction reader, but lately, I tucked my teeth into the massive novel &lt;a href=&quot;https://www.indiebound.org/search/book?keys=Atlas+Shrugged&quot;&gt;Atlas Shrugged&lt;/a&gt; by Ayn Rand. It’s easily the longest novel I read in the last few years.&lt;/p&gt;
          403 
          404 &lt;p&gt;However, most of the recent books I enjoyed were non-fiction.&lt;/p&gt;
          405 
          406 &lt;h2 id=&quot;how-to-avoid-climate-disaster-by-bill-gates&quot;&gt;&lt;a href=&quot;https://www.penguinrandomhouse.com/books/633968/how-to-avoid-a-climate-disaster-by-bill-gates/&quot;&gt;How to Avoid Climate Disaster&lt;/a&gt; by Bill Gates&lt;/h2&gt;
          407 
          408 &lt;h3 id=&quot;why-i-wanted-to-read-it&quot;&gt;Why I wanted to read It?&lt;/h3&gt;
          409 
          410 &lt;p&gt;Even though I’ve heard about climate change since I was young(over 20 years ago), I never had someone explain the numbers. I always wanted to know what noise to cut through to understand the core problem. If you wish for a holistic view on climate change, then this is a good book. It does not focus on one area of human activity, such as eating meat or driving but covers many different areas.&lt;/p&gt;
          411 
          412 &lt;h3 id=&quot;what-i-learned&quot;&gt;What I Learned?&lt;/h3&gt;
          413 
          414 &lt;p&gt;There is one important number to know. 

51 billion. 
This is how many tons of greenhouse equivalent gases are added to the planet each year. We have to get this number to zero. The breakdown of this number would surprise you. I assumed electricity and transport were the main culprits. However, Gates breaks it down is as follows.&lt;/p&gt;
          415 
          416 &lt;ul&gt;
          417   &lt;li&gt;Making things(cement, steel, plastic) 31%&lt;/li&gt;
          418   &lt;li&gt;Electricity 27%&lt;/li&gt;
          419   &lt;li&gt;Growing Things(plants, animals) 19%&lt;/li&gt;
          420   &lt;li&gt;Getting around (cars, planes, trucks, cargo ships) 16%&lt;/li&gt;
          421   &lt;li&gt;Keeping warm and cool(heating, cooling, refrigeration) 7%&lt;/li&gt;
          422 &lt;/ul&gt;
          423 
          424 &lt;p&gt;The other thing I learned is that we can do this. As individuals, communities, entrepreneurs, and nations, we can do this, but it will take work and innovations in lots of different areas. 

Another interesting concept I learned from this book is that adopting a greener solution sometimes requires a green premium. This means we may pay extra if we pursue a green solution over the alternative. For example, changing a country from burning coal for electricity to wind may increase everyone’s electricity bill to account for the infrastructure involved.&lt;/p&gt;
          425 
          426 &lt;p&gt;It can also work the other way. Some solutions save money. For example, suppose more cities adopt cycling and pedestrian infrastructure first. In that case, &lt;a href=&quot;https://www.sciencedaily.com/releases/2015/05/150512104023.htm&quot;&gt;they will save on road maintenance&lt;/a&gt; as car infrastructure is one of the most expensive parts of running a city.&lt;/p&gt;
          427 
          428 &lt;h3 id=&quot;read-if&quot;&gt;Read if&lt;/h3&gt;
          429 
          430 &lt;p&gt;You want a broader understanding of climate change with some numbers thrown in. The book is pretty unbiased. Gates is relatively moderate in his approach, which I appreciate compared to the general media’s constant polarising by special interest groups.&lt;/p&gt;
          431 
          432 &lt;h2 id=&quot;atlas-shrugged-by-ayn-rand&quot;&gt;&lt;a href=&quot;https://www.indiebound.org/search/book?keys=Atlas+Shrugged&quot;&gt;Atlas Shrugged&lt;/a&gt; by Ayn Rand&lt;/h2&gt;
          433 
          434 &lt;h3 id=&quot;why-i-wanted-to-read-it-1&quot;&gt;Why I wanted to read It?&lt;/h3&gt;
          435 
          436 &lt;p&gt;One of my favourite games is called &lt;a href=&quot;https://en.wikipedia.org/wiki/BioShock&quot;&gt;Bioshock&lt;/a&gt;. The game’s set at the bottom of the sea in a city called Rapture, built by Andrew Ryan. Andrew Ryan sought to create a society free from laws and religion so capitalism and human endeavour could progress uninterrupted. He is the main antagonist of the game and produces some of the most memorable quotes in gaming. Take this quote which somewhat sums up why Ryan built Rapture away from normal civilization.&lt;/p&gt;
          437 
          438 &lt;blockquote&gt;
          439   &lt;p&gt;Lacking its own ingenuity, the parasite fears the visionary. What it cannot plagiarize, it seeks to censor. What it cannot regulate, it seeks to ban.&lt;/p&gt;
          440 &lt;/blockquote&gt;
          441 
          442 &lt;p&gt;Ayn Rand calls the parasites ‘looters’ in &lt;a href=&quot;https://www.indiebound.org/search/book?keys=Atlas+Shrugged&quot;&gt;Atlas Shrugged&lt;/a&gt;, but it’s effectively the same thing.&lt;/p&gt;
          443 
          444 &lt;p&gt;Bioshock is one of my favourite games, and when I heard that this book largely inspired it, I had to read it. 

Ayn Rand is quite a polarizing character. Her books and ideas have been met with both scorn and fevered admiration.&lt;/p&gt;
          445 
          446 &lt;h3 id=&quot;what-i-learned-1&quot;&gt;What I Learned&lt;/h3&gt;
          447 
          448 &lt;p&gt;I joke that this is the most exciting book about building a railway line ever created. 
&lt;/p&gt;
          449 
          450 &lt;p&gt;This book is fictional, but it was written midway during the Cold War. Ayn Rand’s attempt to explain her right-wing philosophy that champions brilliant individualism, competition, and objectivity. It’s fascinating to see the fears of communism explained in a  gripping story as America is slowly succumbed to becoming a People’s State where the country becomes a more centrally planned economy. The book is over 1100 pages, so I’m not going to do it justice in a blog post.&lt;/p&gt;
          451 
          452 &lt;p&gt;Suffice it to say; I love reading books that are so divisive. This book is probably the best way for me to understand the culture of America during the Cold War. Reading the source is also my preferred way of #learning about a particular brand of philosophy.&lt;/p&gt;
          453 
          454 &lt;h3 id=&quot;read-if-1&quot;&gt;Read if&lt;/h3&gt;
          455 
          456 &lt;p&gt;I won’t recommend this book unless you’re pretty centrist. What I mean by centrist is that you see value in both left and right-wing ideas but believe extreme in each is silly. If you’re open-minded and have the time, it’s an enjoyable read. Any entrepreneur can relate to the nefarious and sometimes dubious bureaucracy that government can place on you. However, there are some parts of the book that made my eyes roll. If you identify heavily as left-wing or right-wing, I do not recommend it because you will only see what you want to see as your worldview is anchored.&lt;/p&gt;
          457 
          458 &lt;p&gt;Rand is a terrific writer. Somehow, she was able to get me to read over 1100 pages of a philosophy that I don’t entirely agree with.
          459 Rand is a champion of the free market with little to no government interference. Still, if you’re European with access to affordable healthcare, free-roaming, GDPR laws to protect our privacy, free education and much more, the free market of America doesn’t look that great. Breaking Bad, a show about a man dying from cancer turning to crime to fund his treatment, could not be set in Europe. So I’ll stick to my socialism, thanks. 

We see what happens when companies have too much power. Apple and Google extract 30% tax from developers despite the lack of value-added to justify the 30%. Amazon undercuts at a loss to usurp would-be competitors, and oil companies flouted their moral obligation to man-kind to make a quick buck. Maybe if Rand were about a fair market, not a free market, I would agree with her more.&lt;/p&gt;
          460 
          461 &lt;h2 id=&quot;amusing-ourselves-to-death-by-neil-postman&quot;&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Amusing_Ourselves_to_Death&quot;&gt;Amusing Ourselves to Death&lt;/a&gt; by Neil Postman&lt;/h2&gt;
          462 
          463 &lt;h3 id=&quot;why-i-wanted-to-read-it-2&quot;&gt;Why I wanted to read It?&lt;/h3&gt;
          464 
          465 &lt;p&gt;If you would like to learn precisely how TV changed the minds of a nation, then this may be the book for you. If you also want some clues to the future of what social media is doing to us, this book provides some hints.&lt;/p&gt;
          466 
          467 &lt;p&gt;This book espouses the values of a ‘typographic mind’ and culture. &lt;a href=&quot;https://en.wikipedia.org/wiki/Amusing_Ourselves_to_Death&quot;&gt;Amusing Ourselves to Death&lt;/a&gt; was written in 1986, but if written today, replacing the word TV with the internet, it would still be relevant.&lt;/p&gt;
          468 
          469 &lt;h3 id=&quot;what-i-learned-2&quot;&gt;What I Learned&lt;/h3&gt;
          470 
          471 &lt;p&gt;The book is laid out in 2 parts. In the first part, Postman lays down the argument for why reading is different from watching television, the benefits of reading, and how it differs from watching. When reading, we pay attention, reflect on what was said and then ponder it afterwards. The same is not of television.&lt;/p&gt;
          472 
          473 &lt;p&gt;In the second part of the book, Postman then talks about the effects of television on a nation. How politicians went from speeches to entertainment, preachers became televangelists, and even TV education has morphed children from active learners to passive observers.&lt;/p&gt;
          474 
          475 &lt;p&gt;Early America had an unusually high literacy rate compared to other nations of that time. In many ways, before the American Revolution, America was a land of intellectuals where key figures used long-form speeches, books and reading to get their points across. Their intellect would have been examined under scrutiny by the public as they had access to all these printed materials, and reading was the primary form of leisure. The written word forced influential people to think through their ideas as they wrote them down. The opinions presented had to be logical and coherent.&lt;/p&gt;
          476 
          477 &lt;p&gt;Contrast this with today, where key figures use a combination of camera tricks, good looks and clever editing to entertain to influence.&lt;/p&gt;
          478 
          479 &lt;p&gt;Postman thinks the 1980s was closer to the book Brave New World instead of 1984. Brave New World describes how the public is so distracted that they do not notice the authoritarian world they occupy. 1984 represents a world where surveillance and misinformation are used to control society.&lt;/p&gt;
          480 
          481 &lt;p&gt;If Postman lived till 2021, he would see that Huxley and Orwell were both half right.&lt;/p&gt;
          482 
          483 &lt;h3 id=&quot;read-if-2&quot;&gt;Read If&lt;/h3&gt;
          484 
          485 &lt;p&gt;If you find it hard to explain why you should read, this is a good book. If you want a hint as to the effects websites such as YouTube, Twitter, Tiktok et al., then look no further.&lt;/p&gt;
          486 
          487 &lt;p&gt;However, this book does not use science or statistics. Instead, it relies on some intellectual arguments.&lt;/p&gt;
          488 
          489 &lt;h2 id=&quot;deep-sea-and-foreign-going-by-rose-george&quot;&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Ninety_Percent_of_Everything&quot;&gt;Deep Sea and Foreign Going&lt;/a&gt; by Rose George&lt;/h2&gt;
          490 
          491 &lt;h3 id=&quot;why-i-wanted-to-read-it-3&quot;&gt;Why I wanted to read It?&lt;/h3&gt;
          492 
          493 &lt;p&gt;Rose George is easily one of my favourite authors. She explores topics that are big yet are somehow out of our sight. This book is no exception. Having read The Big Necessity(a book about the world of poo) and Nine Pints(about the world of blood), I was excited to read more of her work.&lt;/p&gt;
          494 
          495 &lt;p&gt;My knowledge of the physical movement of goods around the world is lacking. When I look around my desk, most of the stuff comes from abroad. I have only one item on my desk that was made in Ireland.&lt;/p&gt;
          496 
          497 &lt;h3 id=&quot;what-i-learned-3&quot;&gt;What I learned&lt;/h3&gt;
          498 
          499 &lt;p&gt;In the book, she is travelling on a Maersk ship which is a company only is only slightly smaller than Microsoft. About 100K ships ship nearly everything you see around you. I doubt many people have heard of them, but they make about 20% of Danish GDP, which is crazy when you think about it.&lt;/p&gt;
          500 
          501 &lt;p&gt;There is also no manifest on board that matches what’s on the ship. I always assumed nearly everything was accounted for, but this is not the case. Ships are only aware of potentially hazardous materials such as chemicals and bombs. No country scans vessels to prevent illegal goods such as drugs from being shipped because it would slow down trade. Since countries grow when trade is increased, there is no incentive to add this security.&lt;/p&gt;
          502 
          503 &lt;p&gt;The Suez Canal takes ten days off the trip to the south because it cuts through the continent. It’s easily worth more than $3 Billion to the Egyptian government each year.&lt;/p&gt;
          504 
          505 &lt;p&gt;Piracy is still a problem. Somalian pirates can make more from one pirate job than they can from a lifetime of work in Somalia.&lt;/p&gt;
          506 
          507 &lt;p&gt;The book is packed with even more exciting nuances exploring law and crime at sea, the labour on board and just how boring life can be.&lt;/p&gt;
          508 
          509 &lt;h3 id=&quot;read-if-3&quot;&gt;Read If&lt;/h3&gt;
          510 
          511 &lt;p&gt;Do you ever wonder how stuff gets to your home? The answer is shipping. If you wanted to learn more about this hidden yet important industry, this is a great place to start. It touches on many aspects of shipping, and if you like learning new facts, this is a great place to start. 

&lt;/p&gt;
          512 
          513 &lt;p&gt;Shipping has a lot of challenges ahead. We have to modernize a lot of ships to be more environmentally friendly. If you want to know how we’re going to do that, it’s good to understand more about the industry.&lt;/p&gt;</content><author><name>William Kennedy</name></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://williamkennedy.ninja/assets/images/posts/kimberly-farmer-books.jpeg" /><media:content medium="image" url="https://williamkennedy.ninja/assets/images/posts/kimberly-farmer-books.jpeg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Don’t Let Developers Become The Bottleneck: Use Editmode</title><link href="https://williamkennedy.ninja/business/2021/07/29/don-t-let-developers-become-the-bottleneck-use-editmode/" rel="alternate" type="text/html" title="Don&apos;t Let Developers Become The Bottleneck: Use Editmode" /><published>2021-07-29T00:00:00+00:00</published><updated>2021-07-29T00:00:00+00:00</updated><id>repo://posts.collection/_posts/2021-07-29-don-t-let-developers-become-the-bottleneck--use-editmode.md</id><content type="html" xml:base="https://williamkennedy.ninja/business/2021/07/29/don-t-let-developers-become-the-bottleneck-use-editmode/">&lt;p&gt;&lt;img src=&quot;/assets/images/posts/editing.jpg&quot; alt=&quot;alt text&quot; title=&quot;Macbook pro with two hands typing&quot; /&gt;
          514 Photo by &lt;a href=&quot;https://unsplash.com/@kaitlynbaker?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Kaitlyn Baker&lt;/a&gt; on &lt;a href=&quot;https://unsplash.com/s/photos/writing?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Unsplash&lt;/a&gt;&lt;/p&gt;
          515 
          516 &lt;p&gt;One of the biggest mistakes I made with my clients is not making it easy for them to update the marketing site for their app.&lt;/p&gt;
          517 
          518 &lt;p&gt;Usually, I build the whole app with Rails with the marketing site bundled in. I then create an admin area to update the blog or other dynamic content around the site. This approach works great. My clients get an excellent looking app, and they can contribute to the marketing via a blog. Even in this day and age, blogging as a marketing strategy is under-utilised, so my clients can get ahead and build some strong SEO.&lt;/p&gt;
          519 
          520 &lt;p&gt;However, changes are inevitably requested. There are generally three kinds of code changes.&lt;/p&gt;
          521 
          522 &lt;ol&gt;
          523   &lt;li&gt;
          524     &lt;h4 id=&quot;design-changes&quot;&gt;Design Changes&lt;/h4&gt;
          525   &lt;/li&gt;
          526   &lt;li&gt;
          527     &lt;h4 id=&quot;business-logic-changes&quot;&gt;Business Logic Changes&lt;/h4&gt;
          528   &lt;/li&gt;
          529   &lt;li&gt;
          530     &lt;h4 id=&quot;static-content-changes&quot;&gt;Static Content Changes&lt;/h4&gt;
          531   &lt;/li&gt;
          532 &lt;/ol&gt;
          533 
          534 &lt;p&gt;The first two are down to my team and me. The 3rd one is different. These are changes take the longest for the people who request them. Sometimes, my client wants to change some text to see how it looks. Yet, they’re denied the same fast feedback loop developers and designers get when creating.&lt;/p&gt;
          535 
          536 &lt;p&gt;Let’s illustrate. The client adds a task in Basecamp with what text they want to be changed. I then apply that change and push it to the staging server, where they can preview it. Great but now they want to play around with the formatting of the words or try other words.&lt;/p&gt;
          537 
          538 &lt;p&gt;A back and forth begins with the client that can drag out for hours, if not days. I change text, use screenshots or and sometimes redeploy to staging to see what my client thinks. Sometimes more requests are made.&lt;/p&gt;
          539 
          540 &lt;p&gt;Changing text should not be a big deal, but we’ve made a big deal. As soon as someone feels they are making another person’s life awkward, they are less inclined to take action.&lt;/p&gt;
          541 
          542 &lt;p&gt;Simply put, my client deserves the same rapid feedback that developers get when coding. A client should be able to Inspect Element and change some text, then when they are happy, click save and call it a day.&lt;/p&gt;
          543 
          544 &lt;h2 id=&quot;stop-back-and-forth&quot;&gt;Stop Back And Forth&lt;/h2&gt;
          545 
          546 &lt;p&gt;In this industry, we spend a lot of time trying to improve the Software Development Lifecycle. From Test Driven Development to Continuous Deployment to using version control and even using AI to help us write code. Yet, how often do we optimise the processes for everyone else in the business cycle? If you want to save your company and yourself time, &lt;a href=&quot;https://editmode.com/&quot;&gt;install edit mode&lt;/a&gt; and remove the development cycle bottleneck.&lt;/p&gt;
          547 
          548 &lt;p&gt;For me, Editmode is a step in the right direction for teams to collaborate even more on making a great product.&lt;/p&gt;
          549 
          550 &lt;p&gt;So how does it work?&lt;/p&gt;
          551 
          552 &lt;p&gt;Editmode acts as the central repository where the whole team can manage, update and create content without needing a developer. Think HeadlessCMS but more granular. It’s the sweet spot between CMS and I18n files.&lt;/p&gt;
          553 
          554 &lt;p&gt;It’s pretty straightforward. Instead of littering your codebase with random pieces of text that you received from your marketers, you instead replace these with “chunks”.&lt;/p&gt;
          555 
          556 &lt;p&gt;Then your product manager, co-founder or copywriter can press CMD+SHIFT+E and voila, they can then edit text on the page.&lt;/p&gt;
          557 
          558 &lt;p&gt;They can also update the text using the Editmode website.&lt;/p&gt;
          559 
          560 &lt;p&gt;The content is aggressively cached and served via Cloudflare.&lt;/p&gt;
          561 
          562 &lt;p&gt;The company is new, but since it could save me quite a lot of time, I’m selfishly talking about it on the internet, hoping more people check it out.&lt;/p&gt;
          563 
          564 &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/0MJrdYjMYu4&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
          565 
          566 &lt;h2 id=&quot;when-not-to-install-editmode&quot;&gt;When Not To Install Editmode&lt;/h2&gt;
          567 
          568 &lt;p&gt;In terms of product-market-fit, Editmode targets teams. For this reason, if you are a one-person company that doesn’t have clients, I won’t recommend it.&lt;/p&gt;
          569 
          570 &lt;p&gt;Editmode becomes useful when you want to expand beyond yourself and bring on a copywriter, product manager, or salesperson. In my case, it’s useful because it will allow my clients more power over their product without my intervention. This frees me up to grow my consulting business even more.&lt;/p&gt;
          571 
          572 &lt;p&gt;The next time I start a project with a non-technical person, this will be my go-to tool.&lt;/p&gt;</content><author><name>William Kennedy</name></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://williamkennedy.ninja/assets/images/posts/editing.jpg" /><media:content medium="image" url="https://williamkennedy.ninja/assets/images/posts/editing.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">How to Setup Storybook with Rails View Components in under 10 Minutes</title><link href="https://williamkennedy.ninja/rails/2021/07/25/how-to-setup-storybook-with-rails-view-components-in-under-10-minutes/" rel="alternate" type="text/html" title="How to Setup Storybook with Rails View Components in under 10 Minutes" /><published>2021-07-25T00:00:00+00:00</published><updated>2021-07-25T00:00:00+00:00</updated><id>repo://posts.collection/_posts/2021-07-25-how-to-setup-storybook-with-rails-view-components-in-under-10-minutes.md</id><content type="html" xml:base="https://williamkennedy.ninja/rails/2021/07/25/how-to-setup-storybook-with-rails-view-components-in-under-10-minutes/">&lt;p&gt;&lt;img src=&quot;/assets/images/posts/storybook.jpeg&quot; alt=&quot;alt text&quot; title=&quot;How to Setup Storybook with Rails View Components in under 10 Minutes&quot; /&gt;&lt;/p&gt;
          573 
          574 &lt;p&gt;Component driven design is one of the best things to come out of the ReactJS framework, and Storybook is an excellent way for a team to collaborate on new features while also conforming to a team style guide.&lt;/p&gt;
          575 
          576 &lt;p&gt;In a codebase, it’s easy for the different erb files to quickly become a mess when using a utility-style framework like Tailwind CSS. In no time at all, your app loses one of the essential elements of style.

&lt;/p&gt;
          577 
          578 &lt;p&gt;&lt;em&gt;Consistency.&lt;/em&gt;&lt;/p&gt;
          579 
          580 &lt;p&gt;View Components along with Storybook, can help solve this issue while also providing an excellent collaboration experience with your team members.&lt;/p&gt;
          581 
          582 &lt;h2 id=&quot;why-use-storybook-with-view-components&quot;&gt;Why use Storybook with View Components&lt;/h2&gt;
          583 
          584 &lt;p&gt;The main reason is that you can test edge cases with your design. For example, you might want to see what it looks like with different languages or different text when making a button.&lt;/p&gt;
          585 
          586 &lt;ul&gt;
          587   &lt;li&gt;Test edge cases with your design dynamically&lt;/li&gt;
          588   &lt;li&gt;Share your style guide with your team, including your managers, product managers and designers, so that they can iterate on it&lt;/li&gt;
          589   &lt;li&gt;Document use cases&lt;/li&gt;
          590   &lt;li&gt;Test components for accessibility issues.&lt;/li&gt;
          591 &lt;/ul&gt;
          592 
          593 &lt;p&gt;If I have convinced you at all, feel free to follow along.&lt;/p&gt;
          594 
          595 &lt;h2 id=&quot;1-set-up-a-rails-app-optional&quot;&gt;1. Set up a rails app (Optional)&lt;/h2&gt;
          596 
          597 &lt;p&gt;Experienced Rails developers usually read this blog. I’m assuming that you are adding this to an existing app. 

If not, run the following command:&lt;/p&gt;
          598 
          599 &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rails new Storybook
          600 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
          601 
          602 &lt;h2 id=&quot;2-install-the-necessary-gems&quot;&gt;2. Install the necessary gems&lt;/h2&gt;
          603 
          604 &lt;p&gt;To note. As of writing, there is no generator for the &lt;a href=&quot;&quot;&gt;View Component Storybook gem&lt;/a&gt;, but I imagine there will be soon. Below is a summary of all the notes I took while investigating the gem. Hopefully, everything is there for you to get up and running to experience Storybook for yourself.&lt;/p&gt;
          605 
          606 &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;bundle add view_component
          607 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
          608 &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;bundle add view_component_storybook
          609 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
          610 &lt;p&gt;Add &lt;code class=&quot;highlighter-rouge&quot;&gt;require &quot;view_component/storybook/engine&quot;&lt;/code&gt; to &lt;code class=&quot;highlighter-rouge&quot;&gt;config/application.rb&lt;/code&gt;&lt;/p&gt;
          611 
          612 &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# config/application.rb
          613 require_relative &apos;boot&apos;
          614 
          615 require &apos;rails/all&apos;
          616 require &quot;view_component/storybook/engine&quot;
          617 ....
          618 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
          619 
          620 &lt;p&gt;Add &lt;code class=&quot;highlighter-rouge&quot;&gt;*/*.stories.json&lt;/code&gt; to &lt;code class=&quot;highlighter-rouge&quot;&gt;.gitignore&lt;/code&gt;&lt;/p&gt;
          621 
          622 &lt;h2 id=&quot;2-configure-asset-hosts&quot;&gt;2. Configure Asset Hosts&lt;/h2&gt;
          623 
          624 &lt;p&gt;If your view components depend on Javascript, CSS or other assets served by the Rails application, you will need to configure &lt;code class=&quot;highlighter-rouge&quot;&gt;asset_hosts&lt;/code&gt; appropriately for your various environments. For local development, this is a simple as adding to &lt;code class=&quot;highlighter-rouge&quot;&gt;config/development.rb&lt;/code&gt;:&lt;/p&gt;
          625 
          626 &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Rails.application.configure do
          627 config.action_controller.asset_host =  &apos;http://localhost:3000&apos;
          628 end
          629 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
          630 
          631 &lt;p&gt;Naturally, you can do the same for staging and production.&lt;/p&gt;
          632 
          633 &lt;h2 id=&quot;3-install-storybook-via-yarn&quot;&gt;3. Install Storybook via yarn&lt;/h2&gt;
          634 
          635 &lt;ol&gt;
          636   &lt;li&gt;Add Storybook server as a dev dependency. The Storybook Controls addon isn’t needed but comes recommended.
          637     &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;yarn add @storybook/server @storybook/addon-controls --dev
          638 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
          639   &lt;/li&gt;
          640   &lt;li&gt;Add an NPM script to your package.json to start your Storybook later.
          641     &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;// package.json
          642 {
          643   &quot;scripts&quot;: {
          644  &quot;storybook&quot;: &quot;start-storybook&quot;
          645   }
          646 }
          647 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
          648   &lt;/li&gt;
          649   &lt;li&gt;Create a folder called &lt;code class=&quot;highlighter-rouge&quot;&gt;.storybook&lt;/code&gt;. It is a dotfolder. From the command line, do the following:
          650     &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
 
mkdir .storybook

          651 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
          652   &lt;/li&gt;
          653   &lt;li&gt;Create a file called .storybook/main.js file to configure Storybook to find the JSON stories the gem creates. Also, configure the Controls addon:
          654     &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;touch .storybook/main.js
          655 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
          656     &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;// .storybook/main.js
          657 module.exports = {
          658 stories: [&apos;../test/components/**/*.stories.json&apos;],
          659       //  stories: [&apos;../spec/components/**/*.stories.json&apos;], if using RSpec
          660       addons: [
          661         &apos;@storybook/addon-controls&apos;,
          662       ],
          663 };


          664 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
          665   &lt;/li&gt;
          666   &lt;li&gt;Create the .storybook/preview.js file to configure Storybook with the Rails application URL to call for the HTML content of the stories
          667     &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;touch .storybook/preview.js
          668 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
          669     &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;//.storybook/preview.js
          670 export const parameters = {
          671   server: {
          672 url: `http://localhost:3000/rails/stories`,
          673   },
          674 };
          675 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
          676     &lt;h2 id=&quot;4-your-first-storybook-component&quot;&gt;4. Your First StoryBook Component&lt;/h2&gt;
          677   &lt;/li&gt;
          678 &lt;/ol&gt;
          679 
          680 &lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;ViewComponent::Storybook::Stories&lt;/code&gt; provides a way to preview components in Storybook.
          681 Suppose our app has a &lt;code class=&quot;highlighter-rouge&quot;&gt;ButtonComponent&lt;/code&gt; that takes a &lt;code class=&quot;highlighter-rouge&quot;&gt;button_text&lt;/code&gt; parameter:&lt;/p&gt;
          682 &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;class ButtonComponent &amp;lt; ViewComponent::Base
          683   def initialize(button_text:)
          684     @button_text = button_text
          685   end
          686 end
          687 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
          688 &lt;p&gt;We can write a stories describing the &lt;code class=&quot;highlighter-rouge&quot;&gt;ButtonComponent.&lt;/code&gt;
          689   
So in  spec/components/stories or test/components/stories, put in the following
&lt;/p&gt;
          690 &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;class ButtonComponentStories &amp;lt; ViewComponent::Storybook::Stories
          691   story(:with_short_text) do
          692   constructor(title: &quot;my title&quot;)
          693   end
          694 
          695   story(:with_long_text) do
          696   constructor(title: &quot;my title&quot;)
          697   end
          698 end
          699 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
          700 
          701 &lt;h2 id=&quot;5--generate-storybook-json&quot;&gt;5.  Generate Storybook JSON&lt;/h2&gt;
          702 
          703 &lt;p&gt;Generate the Storybook JSON stories by running the rake task:&lt;/p&gt;
          704 
          705 &lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;rake view_component_storybook:write_stories_json&lt;/code&gt;&lt;/p&gt;
          706 
          707 &lt;p&gt;Now you should be able to start the rails app and run the Storybook 

          708   rails s
          709   yarn storybook # in separate tab&lt;/p&gt;
          710 
          711 &lt;h2 id=&quot;configuration-rspec-only&quot;&gt;&lt;strong&gt;Configuration&lt;/strong&gt; (RSpec Only)&lt;/h2&gt;
          712 
          713 &lt;p&gt;By Default ViewComponent::Storybook expects to find stories in the folder &lt;code class=&quot;highlighter-rouge&quot;&gt;test/components/stories&lt;/code&gt;.  This can be configured by setting &lt;code class=&quot;highlighter-rouge&quot;&gt;stories_path&lt;/code&gt; in &lt;code class=&quot;highlighter-rouge&quot;&gt;config/application.rb&lt;/code&gt;. For example if you’re using RSpec you might set the following configuration:&lt;/p&gt;
          714 
          715 &lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;config.view_component_storybook.stories_path = Rails.root.join(&quot;spec/components/stories&quot;)&lt;/code&gt;&lt;/p&gt;
          716 
          717 &lt;h2 id=&quot;gotchas&quot;&gt;Gotcha’s&lt;/h2&gt;
          718 
          719 &lt;p&gt;I had to add rack-cors gem and configure wildcard access for development.&lt;/p&gt;
          720 &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  bundle add rack-cors
          721 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
          722 &lt;p&gt;In config/development.rb, I added the following lines:&lt;/p&gt;
          723 
          724 &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# config/development.rb
          725   config.action_controller.asset_host =  &apos;http://localhost:5000&apos;
          726   config.middleware.insert_before 0, Rack::Cors do
          727     allow do
          728       origins &apos;*&apos;
          729         resource &apos;/rails/stories/*&apos;, :headers =&amp;gt; :any, :methods =&amp;gt; [:get]
          730       end
          731     end
          732 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
          733 
          734 &lt;p&gt;Another Gotcha, I ran into. After you update the HTML for the component, you have to rerun the rake task.&lt;/p&gt;
          735 
          736 &lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
          737 
          738 &lt;p&gt;There you have it. Hopefully, this has gotten you up and running in under 10 minutes. If not, feel free to reach out to me to see if I can help. Also, be sure to &lt;a href=&quot;https://github.com/jonspalmer/view_component_storybook/tree/main/docs/guide&quot;&gt;check out the docs&lt;/a&gt;. This gem is still under development and was even updated while I was writing this article.&lt;/p&gt;
          739 
          740 &lt;p&gt;Happy coding.&lt;/p&gt;
          741 
          742 &lt;p&gt;


&lt;/p&gt;</content><author><name>William Kennedy</name></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://williamkennedy.ninja/assets/images/posts/storybook.jpeg" /><media:content medium="image" url="https://williamkennedy.ninja/assets/images/posts/storybook.jpeg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Thoughts on Sprints</title><link href="https://williamkennedy.ninja/project-management/2021/06/21/thoughts-on-sprints/" rel="alternate" type="text/html" title="Thoughts on Sprints" /><published>2021-06-21T00:00:00+00:00</published><updated>2021-06-21T00:00:00+00:00</updated><id>repo://posts.collection/_posts/2021-06-21-thoughts-on-sprints.md</id><content type="html" xml:base="https://williamkennedy.ninja/project-management/2021/06/21/thoughts-on-sprints/">&lt;p&gt;&lt;img src=&quot;/assets/images/posts/stress.jpeg&quot; alt=&quot;alt text&quot; title=&quot;man covered in post-it notes&quot; /&gt;
          743 Photo by &lt;a href=&quot;https://unsplash.com/@villxsmil?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Luis Villasmil&lt;/a&gt; on &lt;a href=&quot;https://unsplash.com/s/photos/stress?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Unsplash&lt;/a&gt;&lt;/p&gt;
          744 
          745 &lt;p&gt;When it comes to project management, I don’t have any answers or any solid advice. My preference is try and ship regularly(with tests) inspired by a combination of Intercom and Basecamp. I make heavy use of beta flags, staging environments and early user testing to ensure product market fit(or client fit) then have systems in place to offer continuous improvement.&lt;/p&gt;
          746 
          747 &lt;p&gt;However, this article is not about how &lt;em&gt;I&lt;/em&gt; build software.&lt;/p&gt;
          748 
          749 &lt;p&gt;I once contracted with a company where the staff were petrified of mistakes, being wrong or seen to be ignorant. I was brought in as a senior contractor to help them speed up product development.&lt;/p&gt;
          750 
          751 &lt;p&gt;Ignorance was scorned, and employees scolded for not knowing more than the next person. It was a shame that the atmosphere existed because many developers were new to rails and were eager to learn.&lt;/p&gt;
          752 
          753 &lt;p&gt;After a few weeks, I could see the cause of the “slow product development”. The team was using &lt;a href=&quot;https://www.educba.com/what-is-agile-sprint/&quot;&gt;2-week sprints&lt;/a&gt; for project management and didn’t write any tests.&lt;/p&gt;
          754 
          755 &lt;p&gt;After each sprint, there would be new bugs that would arise from new features developed. They would also have bugs from previous sprints. These bugs would get added to the next sprint along with the new features.&lt;/p&gt;
          756 
          757 &lt;p&gt;The Jira tickets assigned to each developer started to compound and grow with each sprint.&lt;/p&gt;
          758 
          759 &lt;p&gt;I’ve observed this pattern in 2 other companies leading me to believe that sprints are not suitable for good Software Development.&lt;/p&gt;
          760 
          761 &lt;p&gt;The first company I was able to help by making a presentation about Continuous Integration, Automated Testing and small iterations to the CEO and Senior Leadership.&lt;/p&gt;
          762 
          763 &lt;p&gt;The other companies I could not rescue.&lt;/p&gt;
          764 
          765 &lt;p&gt;It’s funny reading the &lt;a href=&quot;http://agilemanifesto.org/&quot;&gt;Agile Manifesto&lt;/a&gt; and then doing sprints to see the complete lack of juxtaposition with a good work environment.&lt;/p&gt;
          766 
          767 &lt;p&gt;Even the word sprint implies 100% all-out until you hit the finish line.&lt;/p&gt;
          768 
          769 &lt;h2 id=&quot;retro---lets-talk-about-what-went-wrong-more-than-what-went-right&quot;&gt;Retro - Let’s talk about what went wrong more than what went right&lt;/h2&gt;
          770 
          771 &lt;p&gt;It’s good to talk about how we can improve. When playing any sport, new tactics and innovations can help even the lowly human overcome enormous titans. 

However, talking about what went wrong every two weeks is a one-way trip to the bottom. A retro is where people come to air their dirty laundry whether you like it or not. Sit ten people in a room and ask them for their opinion on what went wrong; you will get hurt feelings.&lt;/p&gt;
          772 
          773 &lt;p&gt;Yet, for some reason, critiquing the process becomes frowned upon. &lt;em&gt;It works for other people&lt;/em&gt; so it must be us that’s doing it wrong.&lt;/p&gt;
          774 
          775 &lt;p&gt;Even worse, people continue on this hedonic treadmill towards burnout.&lt;/p&gt;
          776 
          777 &lt;p&gt;The idea of the retro is to suggest improvements to the process, but inevitably, it becomes about keeping the process intact and more about what individuals can do better.&lt;/p&gt;
          778 
          779 &lt;h2 id=&quot;daily-standup---lets-talk-about-what-we-already-talked-about&quot;&gt;Daily Standup - Let’s talk about what we already talked about&lt;/h2&gt;
          780 
          781 &lt;p&gt;Another strange part of sprints is the daily meeting is the default. It’s supposed to be 10 minutes, but it never is. Plus, when there are ten people in a forum, that’s 100 minutes.&lt;/p&gt;
          782 
          783 &lt;p&gt;Creative work is the result of deep work from hours of focus. Starting the day off with a meeting isn’t setting the proper foundation for getting things done.&lt;/p&gt;
          784 
          785 &lt;p&gt;Let people self-motivate and treat them like adults. Everything else will fall into place.&lt;/p&gt;
          786 
          787 &lt;h2 id=&quot;lifestyle&quot;&gt;Lifestyle&lt;/h2&gt;
          788 
          789 &lt;p&gt;The worst thing I would hate to do to my employees is have a damaging effect on this lifestyle. Overwork, commuting and bi-weekly deadlines are a recipe for burnout.&lt;/p&gt;
          790 
          791 &lt;p&gt;The two-week sprint cycle does not factor in mistakes and meetings. With a crunchtime every two weeks, overtime is inevitable to get things over the line. 

&lt;/p&gt;
          792 
          793 &lt;h2 id=&quot;final-thoughts&quot;&gt;Final thoughts&lt;/h2&gt;
          794 
          795 &lt;p&gt;My sample size is small. Three companies in 5 years is not the best sample size; however, talking to other engineers led me to a pretty dim outlook on sprints.&lt;/p&gt;
          796 
          797 &lt;p&gt;I’ve seen development cycles done well, but it was never sprints. Instead, it was a combination of old school goals and continuous integration.&lt;/p&gt;
          798 
          799 &lt;p&gt;My partner is a product manager, and she regularly exclaims how sprints are brilliant when done well. The problem is that I have never seen them done well.&lt;/p&gt;
          800 
          801 &lt;p&gt;Overall, when starting a project, taking the pain and barriers out of the way is the most important.&lt;/p&gt;
          802 
          803 &lt;p&gt;&lt;strong&gt;Are too many bugs being created?&lt;/strong&gt;&lt;/p&gt;
          804 
          805 &lt;p&gt;Then write tests and use a CI build to help keep them under control.&lt;/p&gt;
          806 
          807 &lt;p&gt;&lt;strong&gt;Is there pressure to get features in?&lt;/strong&gt;&lt;/p&gt;
          808 
          809 &lt;p&gt;Then hold off and make sure the parts you’re bringing in are worth it.&lt;/p&gt;
          810 
          811 &lt;p&gt;&lt;strong&gt;Is it hard to onboard a new team member?&lt;/strong&gt;&lt;/p&gt;
          812 
          813 &lt;p&gt;Lower the barrier to get code to production.&lt;/p&gt;
          814 
          815 &lt;p&gt;Ship small. Ship early. Ship smart. Ship often.&lt;/p&gt;</content><author><name>William Kennedy</name></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://williamkennedy.ninja/assets/images/posts/stress.jpeg" /><media:content medium="image" url="https://williamkennedy.ninja/assets/images/posts/stress.jpeg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Building Cross-Platform Apps has Gotten Easier. Jumpstart is One Reason Why</title><link href="https://williamkennedy.ninja/ios/2021/05/31/jumpstart-turbo-review/" rel="alternate" type="text/html" title="Building Cross-Platform Apps has Gotten Easier. Jumpstart is One Reason Why" /><published>2021-05-31T00:00:00+00:00</published><updated>2021-05-31T00:00:00+00:00</updated><id>repo://posts.collection/_posts/2021-05-31-jumpstart-turbo-review.md</id><content type="html" xml:base="https://williamkennedy.ninja/ios/2021/05/31/jumpstart-turbo-review/">&lt;p&gt;&lt;img src=&quot;/assets/images/posts/hello_iphone.jpg&quot; alt=&quot;alt text&quot; title=&quot;iPhone 8 with Hello text on screen&quot; /&gt;
          816 Photo by &lt;a href=&quot;https://unsplash.com/@lastly?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Tyler Lastovich&lt;/a&gt; on &lt;a href=&quot;https://unsplash.com/s/photos/iphone?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Unsplash&lt;/a&gt;&lt;/p&gt;
          817 
          818 &lt;p&gt;I get asked about mobile apps a lot.&lt;/p&gt;
          819 
          820 &lt;p&gt;My clients, who are not tech people, believe apps are pretty different to websites even though both can involve the same amount of work. They ask if their web app can also be an app.&lt;/p&gt;
          821 
          822 &lt;p&gt;To satisfy this requirement in the past, I turned to React Native. React Native helps and is simple to get started. However, you end up duplicating a lot of work, an API is needed, and the result does not &lt;em&gt;feel&lt;/em&gt; like an iPhone app. Plus, the JavaScript tooling ecosystem is a special kind of hell that I don’t enjoy.&lt;/p&gt;
          823 
          824 &lt;p&gt;I know my feelings are subjective, but I don’t love building things with JavaScript. I’m not alone as there is a &lt;a href=&quot;https://williamkennedy.ninja/javascript/2020/12/23/rebellion-against-spas-has-begun/&quot;&gt;whole cult of people actively making tools to help avoid JavaScript altogether&lt;/a&gt;. 
          825 Building for mobile involves more constraints than building for the web. Apple and Google want you to use their environments even though you can use a cross-platform framework.&lt;/p&gt;
          826 
          827 &lt;p&gt;Out of all the different options for building cross-platform mobile apps such as React Native and Xamarian, Flutter appealed the most except for one issue; Google. I’ve been bitten by Google &lt;a href=&quot;https://killedbygoogle.com/&quot;&gt;shutting down a project&lt;/a&gt; on more than one occasion, so the risk of spending six months learning Flutter only for Google to abandon the project on a whim in a few years seemed too risky for my business.&lt;/p&gt;
          828 
          829 &lt;p&gt;When Basecamp announced the release of &lt;a href=&quot;https://turbo.hotwire.dev/&quot;&gt;Turbo&lt;/a&gt;, I made a bet and started learning about Swift and Swiftui. I’m confident Apple will continue its development, plus I enjoy SwiftUi. Even though Turbo may fall by the wayside, I don’t think SwiftUi will. I also felt it was the best compliment to my existing Rails skillset.&lt;/p&gt;
          830 
          831 &lt;p&gt;After completing &lt;a href=&quot;https://www.hackingwithswift.com/100/swiftui&quot;&gt;Hacking with SwiftUi&lt;/a&gt; by Paul Hudson, I feel like I have a basic handle on building iPhone apps. With each passing day, I get more familiar with Xcode, Swift and the Apple way, as well as the brilliant yet small Swift community.&lt;/p&gt;
          832 
          833 &lt;p&gt;Turbo promised to make turning your Rails app into an iPhone app simple. It does this by wrapping a Turbo-enabled web app in native navigation. Like hybrid apps but with one significant difference, it’s easy to take advantage of native features or delegate to native entirely.&lt;/p&gt;
          834 
          835 &lt;p&gt;However, you still have some complex gaps to fill in yourself.&lt;/p&gt;
          836 
          837 &lt;ul&gt;
          838   &lt;li&gt;Native Authentication, i.e. allow users to log in to your app and store the cookie in the Apple keychain&lt;/li&gt;
          839   &lt;li&gt;Push Notifications - send notifications from your app to the native notifications&lt;/li&gt;
          840 &lt;/ul&gt;
          841 
          842 &lt;p&gt;I started down this road and fiddled away on my own for a few weeks in the evenings, but then I got an email from Chris Oliver of &lt;a href=&quot;http://gorails.com&quot;&gt;GoRails&lt;/a&gt; wondering if I want to be an early user of the new &lt;a href=&quot;https://jumpstartrails.com/ios&quot;&gt;Jumpstart iOS template&lt;/a&gt;.&lt;/p&gt;
          843 
          844 &lt;p&gt;The answer was yes. 
&lt;/p&gt;
          845 
          846 &lt;p&gt;After playing around with it for a few days, it’s hard not to get excited. Jumpstart iOS will enable tons of entrepreneurs to build cross-platform apps in a matter of weeks, if not days. You can have a Rails app up and running with an iPhone app ready to go in no time at all.&lt;/p&gt;
          847 
          848 &lt;p&gt;Aside from wrapping your Rails app in a native view, it’s possible to go even further. Here are some things I have managed:&lt;/p&gt;
          849 
          850 &lt;ul&gt;
          851   &lt;li&gt;From day 1, my current project, &lt;del&gt;Koach&lt;/del&gt; &lt;a href=&quot;https://smartstrengthapp.com/&quot;&gt;Smart Strength&lt;/a&gt; worked as a native iPhone app&lt;/li&gt;
          852   &lt;li&gt;From day 1, I was able to quickly delegate &lt;a href=&quot;https://twitter.com/_williamkennedy/status/1390707352345645061&quot;&gt;certain parts to a native view for a more authentic experience&lt;/a&gt;&lt;/li&gt;
          853   &lt;li&gt;Able to offer native experiences for certain sections of my site e.g anything that ends in new or edit gets the iOS ActionSheet&lt;/li&gt;
          854 &lt;/ul&gt;
          855 
          856 &lt;p&gt;I’m still building the iOS app for Koach, but my other projects wouldn’t need as much custom work for iOS. If you’re wondering whether you should purchase the Jumpstart iOS template, here’s some considerations:&lt;/p&gt;
          857 
          858 &lt;ul&gt;
          859   &lt;li&gt;Your web app needs to be &lt;a href=&quot;https://turbo.hotwire.dev/&quot;&gt;Turbo enabled&lt;/a&gt;(it does not have to be a Rails app but needs to use Turbo)&lt;/li&gt;
          860   &lt;li&gt;Knowledge of Swift is helpful, but I think many developers could pick up enough to work through specific problems. The SwiftUI community is quite good and Apple have &lt;a href=&quot;https://developer.apple.com/videos/&quot;&gt;some amazing videos&lt;/a&gt;.&lt;/li&gt;
          861   &lt;li&gt;Your web app should be mobile friendly by design to accommodate iOS apps. Luckily most new applications are, but I do come across some that are not.&lt;/li&gt;
          862   &lt;li&gt;For non-Jumpstart rails web app apps, you will have to do a bit of configuration, but it’s nothing too demanding (instructions are sent after that you sign up). Essentially, you have to configure a JSON endpoint and look out for iPhone request variants in your requests.&lt;/li&gt;
          863 &lt;/ul&gt;
          864 
          865 &lt;p&gt;Jumpstart does not endorse me, but I hope by writing this, I encourage people to sign up. The reason is simple. I want Turbo iOS(and Turbo Android) to succeed, and the only way that happens is if more people use it. Jumpstart iOS does what it says on the tin. It &lt;strong&gt;&lt;em&gt;“jump starts”&lt;/em&gt;&lt;/strong&gt; your iOS app and gets you past the nitty-gritty and straight into building your app. It saves you a ton of time and energy letting you just build your business.&lt;/p&gt;
          866 
          867 &lt;p&gt;This is a game changer for small businesses. The promise of React Native is that you could build cross-platform apps by writing once but run everywhere. Turbo takes a step further by writing HTML once and running everywhere, foregoing the whole JavaScript pipeline.&lt;/p&gt;
          868 
          869 &lt;p&gt;A world of high-quality hybrid apps awaits us. It should not be in the hands of Facebook with React Native or Google and Flutter but be in the hands of the millions of smaller businesses out there.&lt;/p&gt;
          870 
          871