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/"><div class="flex flex-col items-center justify-center mt-4 mx-auto">
2 <svg class="animate-spin text-center -ml-1 mr-3 h-40 w-40 text-indigo" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
3 <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
4 <path class="opacity-75" fill="currentColor" d="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"></path>
5 </svg>
6 <p>Loading article...</p>
7 </div></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/"><p>If you run into trouble upgrading your Bridgetown site, this might help you.</p>
8
9 <p>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.</p>
10
11 <p>Even though it has evolved in ambitions, Bridgetown remains a static site generator.</p>
12
13 <p>What is a static site generator?</p>
14
15 <p>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.</p>
16
17 <p>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.</p>
18
19 <p>Tangent aide, I have been using Bridgetown for about two years on this site, and recently <a href="https://jaredwhite.com/">Jared Whyte</a> announced that <a href="https://www.bridgetownrb.com/">Bridgetown Version 1</a> was ready. I have been so impressed that I even sponsor <a href="https://github.com/sponsors/jaredcwhite">Jared on Github</a>.</p>
20
21 <p>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.</p>
22
23 <p>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.</p>
24
25 <p>After following <a href="https://www.bridgetownrb.com/docs/installation/upgrade">the upgrade guide</a> and <a href="https://github.com/matoni109/matoni_portfolio/pull/8">running the script</a> to switch webpack to esbuild, I ran into some errors.</p>
26
27 <div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">config</span><span class="o">/</span><span class="n">esbuild</span><span class="p">.</span><span class="nf">defaults</span><span class="p">.</span><span class="nf">js</span><span class="p">:</span><span class="mi">68</span><span class="p">:</span><span class="mi">10</span><span class="p">:</span> <span class="ss">note: </span><span class="no">This</span> <span class="n">error</span> <span class="n">came</span> <span class="n">from</span> <span class="n">the</span> <span class="s2">"onLoad"</span> <span class="n">callback</span> <span class="n">registered</span> <span class="n">here</span>
28 <span class="mi">68</span> <span class="err">│</span> <span class="n">build</span><span class="p">.</span><span class="nf">onLoad</span><span class="p">({</span> <span class="ss">filter: </span><span class="sr">/\.(css)$/</span> <span class="p">},</span> <span class="n">async</span> <span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">=&gt;</span>
29 <span class="err">╵</span> <span class="o">~~~~~~</span>
30 </code></pre></div></div>
31
32 <p><img src="/assets/images/posts/pokemon_meme.jpeg" alt="Wild Stacktrace appeared" /></p>
33
34 <p>In the end, it turned out that this was because I updated TailwindCSS, and my old <code class="highlighter-rouge">tailwind.config.js</code> was incorrectly formatted.</p>
35
36 <p>After I corrected my <code class="highlighter-rouge">tailwind.config.js</code> file, everything worked.</p>
37
38 <p>Here is every step I followed:</p>
39
40 <ol>
41 <li>Visited this <a href="https://www.bridgetownrb.com/docs/installation/upgrade">site</a></li>
42 <li>Add the <code class="highlighter-rouge">gem puma</code> to the Gemfile and ran <code class="highlighter-rouge">bundle update</code></li>
43 <li>Ran bundle <code class="highlighter-rouge">binstubs bridgetown-core</code></li>
44 <li>Created a separate bridgetown site and copied over files <code class="highlighter-rouge">config.ru</code>, <code class="highlighter-rouge">Rakefile</code>, <code class="highlighter-rouge">config/puma.rb</code>, and everything under <code class="highlighter-rouge">server/*</code></li>
45 <li>Ran <code class="highlighter-rouge">bin/bridgetown esbuild migrate-from-webpack</code> created by <a href="https://andrewm.codes/">Andrew Mason</a></li>
46 <li>Removed <code class="highlighter-rouge">start.js</code>, <code class="highlighter-rouge">sync.js</code></li>
47 <li>removed browser-sync and concurrently from my <code class="highlighter-rouge">package.json</code></li>
48 <li>Changed the <code class="highlighter-rouge">Rakefile</code> to use <a href="https://esbuild.github.io/">esbuild</a></li>
49 </ol>
50
51 <div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># Rakefile</span>
52 <span class="nb">require</span> <span class="s2">"bridgetown"</span>
53
54 <span class="no">Bridgetown</span><span class="p">.</span><span class="nf">load_tasks</span>
55
56 <span class="c1"># Run rake without specifying any command to execute a deploy build by default.</span>
57 <span class="n">task</span> <span class="ss">default: :deploy</span>
58
59 <span class="c1">#</span>
60 <span class="c1"># Standard set of tasks, which you can customize if you wish:</span>
61 <span class="c1">#</span>
62 <span class="n">desc</span> <span class="s2">"Build the Bridgetown site for deployment"</span>
63 <span class="n">task</span> <span class="ss">:deploy</span> <span class="o">=&gt;</span> <span class="p">[</span><span class="ss">:clean</span><span class="p">,</span> <span class="s2">"frontend:build"</span><span class="p">]</span> <span class="k">do</span>
64 <span class="no">Bridgetown</span><span class="o">::</span><span class="no">Commands</span><span class="o">::</span><span class="no">Build</span><span class="p">.</span><span class="nf">start</span>
65 <span class="k">end</span>
66
67 <span class="n">desc</span> <span class="s2">"Build the site in a test environment"</span>
68 <span class="n">task</span> <span class="ss">:test</span> <span class="k">do</span>
69 <span class="no">ENV</span><span class="p">[</span><span class="s2">"BRIDGETOWN_ENV"</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"test"</span>
70 <span class="no">Bridgetown</span><span class="o">::</span><span class="no">Commands</span><span class="o">::</span><span class="no">Build</span><span class="p">.</span><span class="nf">start</span>
71 <span class="k">end</span>
72
73 <span class="n">desc</span> <span class="s2">"Runs the clean command"</span>
74 <span class="n">task</span> <span class="ss">:clean</span> <span class="k">do</span>
75 <span class="no">Bridgetown</span><span class="o">::</span><span class="no">Commands</span><span class="o">::</span><span class="no">Clean</span><span class="p">.</span><span class="nf">start</span>
76 <span class="k">end</span>
77
78 <span class="n">namespace</span> <span class="ss">:frontend</span> <span class="k">do</span>
79 <span class="n">desc</span> <span class="s2">"Build the frontend with esbuild for deployment"</span>
80 <span class="n">task</span> <span class="ss">:build</span> <span class="k">do</span>
81 <span class="n">sh</span> <span class="s2">"yarn run esbuild"</span>
82 <span class="k">end</span>
83
84 <span class="n">desc</span> <span class="s2">"Watch the frontend with esbuild during development"</span>
85 <span class="n">task</span> <span class="ss">:dev</span> <span class="k">do</span>
86 <span class="n">sh</span> <span class="s2">"yarn run esbuild-dev"</span>
87 <span class="k">rescue</span> <span class="no">Interrupt</span>
88 <span class="k">end</span>
89 <span class="k">end</span>
90
91 <span class="c1">#</span>
92 <span class="c1"># Add your own Rake tasks here! You can use `environment` as a prerequisite</span>
93 <span class="c1"># in order to write automations or other commands requiring a loaded site.</span>
94 <span class="c1">#</span>
95 <span class="c1"># task :my_task =&gt; :environment do</span>
96 <span class="c1"># puts site.root_dir</span>
97 <span class="c1"># automation do</span>
98 <span class="c1"># say_status :rake, "I'm a Rake tast =) #{site.config.url}"</span>
99 <span class="c1"># end</span>
100 <span class="c1"># end</span>
101
102 </code></pre></div></div>
103
104 <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bin/bridgetown configure bt-postcss
105 </code></pre></div></div>
106
107 <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bin/bridgetown configure stimulus
108 </code></pre></div></div>
109
110 <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bin/bridgetown configure tailwindcss
111 </code></pre></div></div>
112
113 <p>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.</p>
114
115 <p>Next, I had to update my liquid templated because collections work differently.</p>
116 <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Before</span>
117 <span class="k">for </span>post <span class="k">in </span>site.posts %<span class="o">}</span>
118 <span class="c">#After</span>
119 <span class="o">{</span>% <span class="k">for </span>post <span class="k">in </span>collections.posts.resources %<span class="o">}</span>
120
121 In one of my components, I did the following to keep the same a tag href
122 <span class="c"># Before</span>
123 post.url
124 <span class="c"># After</span>
125 post.relative_url
126
127 </code></pre></div></div>
128
129 <p>Then I changed my Netlify to run <code class="highlighter-rouge">bridgetown deploy</code> instead of yarn deploy.</p>
130
131 <p>After that, I had to update my head to use <code class="highlighter-rouge">resource title</code> instead of <code class="highlighter-rouge">page.title</code>.</p>
132
133 <div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">&lt;!-- src/_components/head.liquid --&gt;</span>
134 <span class="nt">&lt;meta</span> <span class="na">charset=</span><span class="s">"utf-8"</span> <span class="nt">/&gt;</span>
135 <span class="nt">&lt;meta</span> <span class="na">name=</span><span class="s">"viewport"</span> <span class="na">content=</span><span class="s">"width=device-width, initial-scale=1.0"</span> <span class="nt">/&gt;</span>
136 {% capture resource_title %}{{ title | strip_html | strip_newlines }}{% endcapture %}
137 <span class="nt">&lt;title&gt;</span>{% if resource_title != "Index" %}{{ resource_title | escape }} | {{ metadata.title | escape }}{% else %}{{ metadata.title | escape }}: {{ metadata.tagline | escape }}{% endif %}<span class="nt">&lt;/title&gt;</span>
138
139 <span class="nt">&lt;meta</span> <span class="na">name=</span><span class="s">"description"</span> <span class="na">content=</span><span class="s">"{{ metadata.description }}"</span> <span class="nt">/&gt;</span>
140 <span class="nt">&lt;link</span> <span class="na">rel=</span><span class="s">"stylesheet"</span> <span class="na">href=</span><span class="s">"{% asset_path css %}"</span> <span class="nt">/&gt;</span>
141 <span class="nt">&lt;script </span><span class="na">src=</span><span class="s">"{% asset_path js %}"</span> <span class="na">defer</span><span class="nt">&gt;&lt;/script&gt;</span>
142 </code></pre></div></div>
143
144 <p>Finally, for the sitemap, I just installed this <a href="#">handy gem</a>(https://github.com/ayushn21/bridgetown-sitemap), which did what my code previously did.</p>
145
146 <p>Hopefully, that helps anyone who has run into trouble updating their Bridgetown site to version 1.</p>
147
148 <p>Long live Bridgetown.</p></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/"><p><img src="/assets/images/posts/what-now.jpeg" alt="alt text" />
149 <span>Photo by <a href="https://unsplash.com/@timmossholder?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Tim Mossholder</a> on <a href="https://unsplash.com/s/photos/question-mark?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>
150 </span></p>
151
152 <h1 id="what-does-scale-mean-anyway">What does scale mean anyway?</h1>
153
154 <p>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.</p>
155
156 <h2 id="performance">Performance</h2>
157
158 <p>One of the first definitions of scale is performance. Can your software scale to the needs of its demand?</p>
159
160 <p>In the Rails community, there is a meme <em>but does it scale?</em> 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.</p>
161
162 <p>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.</p>
163
164 <ul>
165 <li>Network optimization</li>
166 <li>performant technology practices (such as caching and database optimizations)</li>
167 </ul>
168
169 <h2 id="ability-to-build-fast">Ability to Build Fast</h2>
170
171 <p>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.</p>
172
173 <p>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…</p>
174
175 <p>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.</p>
176
177 <p>As an application grows, it gets harder to change, update and improve. However, TDD can mitigate against this.</p>
178
179 <h2 id="support-staff">Support Staff</h2>
180
181 <p>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?</p>
182
183 <p>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?</p>
184
185 <h2 id="sales">Sales</h2>
186
187 <p>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.</p>
188
189 <p>If the product is complex, your sales process might include a traditional salesperson, sales engineer, account manager, and customer success agent.</p>
190
191 <h2 id="processes">Processes</h2>
192
193 <p>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.</p>
194
195 <p>You can focus on picking the right area, getting the initial finance and staff and voila. You’re good.</p>
196
197 <p>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.</p>
198
199 <p>No matter what, we need to look at scale as something more than a physical limit of our machines.</p></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'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/"><p><img src="/assets/images/posts/kimberly-farmer-books.jpeg" alt="alt text" title="Books" />
200 Photo by <a href="https://unsplash.com/@kimberlyfarmer?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Kimberly Farmer</a> on <a href="https://unsplash.com/s/photos/books?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></p>
201 <h1 id="recently-read-2---irelands-dark-past-an-entrepreneur-who-pioneered-wind-energy-and-how-browsers-work">Recently Read #2 - Ireland’s dark past, an entrepreneur who pioneered wind energy and how browsers work</h1>
202
203 <p>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 <a href="https://williamkennedy.ninja/books">here</a>.</p>
204
205 <h2 id="high-performance-browser-networking-by-ilya-grigorik"><a href="https://www.oreilly.com/library/view/high-performance-browser/9781449344757/">High-Performance Browser Networking</a> by Ilya Grigorik</h2>
206
207 <h3 id="why-read-it">Why read it?</h3>
208
209 <p>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.</p>
210
211 <p>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.</p>
212
213 <p>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.</p>
214
215 <p>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.</p>
216
217 <h3 id="what-i-learned">What I Learned?</h3>
218
219 <p>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.</p>
220
221 <h3 id="read-if">Read if</h3>
222
223 <p>You’re a web developer.</p>
224
225 <h2 id="the-prince-by-niccolò-machiavelli"><a href="https://en.wikipedia.org/wiki/The_Prince">The Prince</a> by Niccolò Machiavelli</h2>
226
227 <h3 id="why-read-it-1">Why read it?</h3>
228
229 <p>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.</p>
230
231 <p>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.</p>
232
233 <p>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.</p>
234
235 <h3 id="what-i-learned-1">What I Learned?</h3>
236
237 <p>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.</p>
238
239 <p>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.</p>
240
241 <p>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.</p>
242
243 <p>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.</p>
244
245 <h3 id="read-if-1">Read if</h3>
246
247 <p>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?</p>
248
249 <p>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?</p>
250
251 <p>Probably. Certainly, we can look to leaders such as Putin who have silenced opponents and ascribe machiavellian traits to them.</p>
252
253 <p>This book has inspired great stories throughout the years and I’ve no doubt it will continue to intrigue us for many years.</p>
254
255 <h2 id="a-dangerous-visionary-by-eddie-oconnor"><a href="https://www.books.ie/a-dangerous-visionary">A Dangerous Visionary</a> by Eddie O’Connor</h2>
256
257 <h3 id="why-read-it-2">Why read it?</h3>
258
259 <p>I have been <a href="https://williamkennedy.ninja/reviews/2021/09/06/recently-read-1/">learning more and more about clean energy in the past year</a>. 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.</p>
260
261 <h3 id="what-i-learned-2">What I Learned?</h3>
262 <p>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.</p>
263
264 <p>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.</p>
265
266 <p>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.</p>
267
268 <p>“The problem with a lazy worker is that they want to make other people lazy”</p>
269
270 <p>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.</p>
271
272 <p>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.</p>
273
274 <h3 id="read-if-2">Read if</h3>
275
276 <p>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.</p>
277
278 <p>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.</p>
279
280 <h2 id="republic-of-shame-by-caelainn-hogan"><a href="https://gutterbookshop.com/product/republic-of-shame-by-caelainn-hogan/">Republic Of Shame</a> by Caelainn Hogan</h2>
281
282 <h3 id="why-read-it-3">Why read it?</h3>
283
284 <p>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.</p>
285
286 <p>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.</p>
287
288 <p>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’.</p>
289
290 <p>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.</p>
291
292 <p>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.</p>
293
294 <p>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.</p>
295
296 <p>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.</p>
297
298 <h3 id="what-i-learned-3">What I learned</h3>
299
300 <p>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.</p>
301
302 <p>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.</p>
303
304 <p>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.</p>
305
306 <p>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).</p>
307
308 <p>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.</p>
309
310 <p>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.</p>
311
312 <p>The choice these women had was an illusion. In some cases, the choice was made for them by their family.</p>
313
314 <h3 id="read-if-3">Read if</h3>
315
316 <p>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.</p></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/"><p><img src="/assets/images/posts/dog-coding.jpeg" alt="alt text" title="Dog with glasses siting with iPad" />
317 <span>Photo by <a href="https://unsplash.com/@cookiethepom?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Cookie the Pom</a> on <a href="https://unsplash.com/s/photos/fix?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></span></p>
318
319 <p>No matter how much you try, refactoring is a hard sell. Why change code that works, so a developers job is more straightforward?</p>
320
321 <p>Refactoring is specific to software development as code is malleable. Users can’t see it, and it doesn’t affect them.</p>
322
323 <p>However, bad code can make life difficult for the next developer(or you in six months).</p>
324
325 <p>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 <em>small change</em> to make life better for you and your fellow developers.</p>
326
327 <h2 id="adopt-a-good-citizen-culture-at-work">Adopt a Good Citizen Culture at Work</h2>
328
329 <p>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.</p>
330
331 <p>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.</p>
332
333 <p>Nothing needs to be said to anyone outside of the development team. It’s fast, clean and your fellow team will be happier.</p>
334
335 <h2 id="keep-refactoring-small">Keep refactoring small</h2>
336
337 <p>If you try to refactor too much, it may take focus away from the task.</p>
338
339 <p>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</p>
340
341 <div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">class</span> <span class="nc">PostsContoller</span> <span class="o">&lt;</span> <span class="no">ApplicationController</span>
342 <span class="k">def</span> <span class="nf">edit</span>
343 <span class="vi">@post</span> <span class="o">=</span> <span class="n">current_user</span><span class="p">.</span><span class="nf">posts</span><span class="p">.</span><span class="nf">find</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="ss">:id</span><span class="p">])</span>
344 <span class="o">...</span>
345 <span class="k">end</span>
346
347 <span class="k">def</span> <span class="nf">show</span>
348 <span class="vi">@post</span> <span class="o">=</span> <span class="n">current_user</span><span class="p">.</span><span class="nf">posts</span><span class="p">.</span><span class="nf">find</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="ss">:id</span><span class="p">])</span>
349 <span class="o">...</span>
350 <span class="k">end</span>
351
352 <span class="k">def</span> <span class="nf">destroy</span>
353 <span class="vi">@post</span> <span class="o">=</span> <span class="n">current_user</span><span class="p">.</span><span class="nf">posts</span><span class="p">.</span><span class="nf">find</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="ss">:id</span><span class="p">])</span>
354 <span class="o">...</span>
355 <span class="k">end</span>
356
357 <span class="k">def</span> <span class="nf">publish</span>
358 <span class="vi">@post</span> <span class="o">=</span> <span class="n">current_user</span><span class="p">.</span><span class="nf">posts</span><span class="p">.</span><span class="nf">find</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="ss">:id</span><span class="p">])</span>
359 <span class="o">...</span>
360 <span class="k">end</span>
361 <span class="k">end</span>
362 </code></pre></div></div>
363
364 <p>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.</p>
365
366 <div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">class</span> <span class="nc">PostsContoller</span> <span class="o">&lt;</span> <span class="no">ApplicationController</span>
367 <span class="n">before_acton</span> <span class="ss">:set_post</span>
368
369 <span class="k">def</span> <span class="nf">edit</span>
370 <span class="o">...</span>
371 <span class="k">end</span>
372
373 <span class="k">def</span> <span class="nf">show</span>
374 <span class="o">...</span>
375 <span class="k">end</span>
376
377 <span class="k">def</span> <span class="nf">destroy</span>
378 <span class="o">...</span>
379 <span class="k">end</span>
380
381 <span class="k">def</span> <span class="nf">publish</span>
382 <span class="o">...</span>
383 <span class="k">end</span>
384
385 <span class="kp">private</span>
386
387 <span class="k">def</span> <span class="nf">set_post</span>
388 <span class="vi">@post</span> <span class="o">=</span> <span class="n">current_user</span><span class="p">.</span><span class="nf">posts</span><span class="p">.</span><span class="nf">find</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="ss">:id</span><span class="p">])</span>
389 <span class="k">end</span>
390 <span class="k">end</span>
391 </code></pre></div></div>
392
393 <p>Now we have removed four lines of code by adding a <code class="highlighter-rouge">before_action</code> 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.</p>
394
395 <p>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.</p>
396
397 <p>And that is what being a good citizen is all about.</p></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/"><p><img src="/assets/images/posts/kimberly-farmer-books.jpeg" alt="alt text" title="Books" />
398 Photo by <a href="https://unsplash.com/@kimberlyfarmer?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Kimberly Farmer</a> on <a href="https://unsplash.com/s/photos/books?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></p>
399
400 <h2 id="intro">Intro</h2>
401
402 <p>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 <a href="https://www.indiebound.org/search/book?keys=Atlas+Shrugged">Atlas Shrugged</a> by Ayn Rand. It’s easily the longest novel I read in the last few years.</p>
403
404 <p>However, most of the recent books I enjoyed were non-fiction.</p>
405
406 <h2 id="how-to-avoid-climate-disaster-by-bill-gates"><a href="https://www.penguinrandomhouse.com/books/633968/how-to-avoid-a-climate-disaster-by-bill-gates/">How to Avoid Climate Disaster</a> by Bill Gates</h2>
407
408 <h3 id="why-i-wanted-to-read-it">Why I wanted to read It?</h3>
409
410 <p>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.</p>
411
412 <h3 id="what-i-learned">What I Learned?</h3>
413
414 <p>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.</p>
415
416 <ul>
417 <li>Making things(cement, steel, plastic) 31%</li>
418 <li>Electricity 27%</li>
419 <li>Growing Things(plants, animals) 19%</li>
420 <li>Getting around (cars, planes, trucks, cargo ships) 16%</li>
421 <li>Keeping warm and cool(heating, cooling, refrigeration) 7%</li>
422 </ul>
423
424 <p>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.</p>
425
426 <p>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, <a href="https://www.sciencedaily.com/releases/2015/05/150512104023.htm">they will save on road maintenance</a> as car infrastructure is one of the most expensive parts of running a city.</p>
427
428 <h3 id="read-if">Read if</h3>
429
430 <p>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.</p>
431
432 <h2 id="atlas-shrugged-by-ayn-rand"><a href="https://www.indiebound.org/search/book?keys=Atlas+Shrugged">Atlas Shrugged</a> by Ayn Rand</h2>
433
434 <h3 id="why-i-wanted-to-read-it-1">Why I wanted to read It?</h3>
435
436 <p>One of my favourite games is called <a href="https://en.wikipedia.org/wiki/BioShock">Bioshock</a>. 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.</p>
437
438 <blockquote>
439 <p>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.</p>
440 </blockquote>
441
442 <p>Ayn Rand calls the parasites ‘looters’ in <a href="https://www.indiebound.org/search/book?keys=Atlas+Shrugged">Atlas Shrugged</a>, but it’s effectively the same thing.</p>
443
444 <p>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.</p>
445
446 <h3 id="what-i-learned-1">What I Learned</h3>
447
448 <p>I joke that this is the most exciting book about building a railway line ever created.
</p>
449
450 <p>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.</p>
451
452 <p>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.</p>
453
454 <h3 id="read-if-1">Read if</h3>
455
456 <p>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.</p>
457
458 <p>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.</p>
460
461 <h2 id="amusing-ourselves-to-death-by-neil-postman"><a href="https://en.wikipedia.org/wiki/Amusing_Ourselves_to_Death">Amusing Ourselves to Death</a> by Neil Postman</h2>
462
463 <h3 id="why-i-wanted-to-read-it-2">Why I wanted to read It?</h3>
464
465 <p>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.</p>
466
467 <p>This book espouses the values of a ‘typographic mind’ and culture. <a href="https://en.wikipedia.org/wiki/Amusing_Ourselves_to_Death">Amusing Ourselves to Death</a> was written in 1986, but if written today, replacing the word TV with the internet, it would still be relevant.</p>
468
469 <h3 id="what-i-learned-2">What I Learned</h3>
470
471 <p>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.</p>
472
473 <p>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.</p>
474
475 <p>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.</p>
476
477 <p>Contrast this with today, where key figures use a combination of camera tricks, good looks and clever editing to entertain to influence.</p>
478
479 <p>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.</p>
480
481 <p>If Postman lived till 2021, he would see that Huxley and Orwell were both half right.</p>
482
483 <h3 id="read-if-2">Read If</h3>
484
485 <p>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.</p>
486
487 <p>However, this book does not use science or statistics. Instead, it relies on some intellectual arguments.</p>
488
489 <h2 id="deep-sea-and-foreign-going-by-rose-george"><a href="https://en.wikipedia.org/wiki/Ninety_Percent_of_Everything">Deep Sea and Foreign Going</a> by Rose George</h2>
490
491 <h3 id="why-i-wanted-to-read-it-3">Why I wanted to read It?</h3>
492
493 <p>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.</p>
494
495 <p>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.</p>
496
497 <h3 id="what-i-learned-3">What I learned</h3>
498
499 <p>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.</p>
500
501 <p>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.</p>
502
503 <p>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.</p>
504
505 <p>Piracy is still a problem. Somalian pirates can make more from one pirate job than they can from a lifetime of work in Somalia.</p>
506
507 <p>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.</p>
508
509 <h3 id="read-if-3">Read If</h3>
510
511 <p>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.
</p>
512
513 <p>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.</p></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'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/"><p><img src="/assets/images/posts/editing.jpg" alt="alt text" title="Macbook pro with two hands typing" />
514 Photo by <a href="https://unsplash.com/@kaitlynbaker?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Kaitlyn Baker</a> on <a href="https://unsplash.com/s/photos/writing?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></p>
515
516 <p>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.</p>
517
518 <p>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.</p>
519
520 <p>However, changes are inevitably requested. There are generally three kinds of code changes.</p>
521
522 <ol>
523 <li>
524 <h4 id="design-changes">Design Changes</h4>
525 </li>
526 <li>
527 <h4 id="business-logic-changes">Business Logic Changes</h4>
528 </li>
529 <li>
530 <h4 id="static-content-changes">Static Content Changes</h4>
531 </li>
532 </ol>
533
534 <p>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.</p>
535
536 <p>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.</p>
537
538 <p>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.</p>
539
540 <p>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.</p>
541
542 <p>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.</p>
543
544 <h2 id="stop-back-and-forth">Stop Back And Forth</h2>
545
546 <p>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, <a href="https://editmode.com/">install edit mode</a> and remove the development cycle bottleneck.</p>
547
548 <p>For me, Editmode is a step in the right direction for teams to collaborate even more on making a great product.</p>
549
550 <p>So how does it work?</p>
551
552 <p>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.</p>
553
554 <p>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”.</p>
555
556 <p>Then your product manager, co-founder or copywriter can press CMD+SHIFT+E and voila, they can then edit text on the page.</p>
557
558 <p>They can also update the text using the Editmode website.</p>
559
560 <p>The content is aggressively cached and served via Cloudflare.</p>
561
562 <p>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.</p>
563
564 <iframe width="560" height="315" src="https://www.youtube.com/embed/0MJrdYjMYu4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>
565
566 <h2 id="when-not-to-install-editmode">When Not To Install Editmode</h2>
567
568 <p>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.</p>
569
570 <p>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.</p>
571
572 <p>The next time I start a project with a non-technical person, this will be my go-to tool.</p></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/"><p><img src="/assets/images/posts/storybook.jpeg" alt="alt text" title="How to Setup Storybook with Rails View Components in under 10 Minutes" /></p>
573
574 <p>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.</p>
575
576 <p>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.
</p>
577
578 <p><em>Consistency.</em></p>
579
580 <p>View Components along with Storybook, can help solve this issue while also providing an excellent collaboration experience with your team members.</p>
581
582 <h2 id="why-use-storybook-with-view-components">Why use Storybook with View Components</h2>
583
584 <p>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.</p>
585
586 <ul>
587 <li>Test edge cases with your design dynamically</li>
588 <li>Share your style guide with your team, including your managers, product managers and designers, so that they can iterate on it</li>
589 <li>Document use cases</li>
590 <li>Test components for accessibility issues.</li>
591 </ul>
592
593 <p>If I have convinced you at all, feel free to follow along.</p>
594
595 <h2 id="1-set-up-a-rails-app-optional">1. Set up a rails app (Optional)</h2>
596
597 <p>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:</p>
598
599 <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>rails new Storybook
600 </code></pre></div></div>
601
602 <h2 id="2-install-the-necessary-gems">2. Install the necessary gems</h2>
603
604 <p>To note. As of writing, there is no generator for the <a href="">View Component Storybook gem</a>, 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.</p>
605
606 <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bundle add view_component
607 </code></pre></div></div>
608 <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bundle add view_component_storybook
609 </code></pre></div></div>
610 <p>Add <code class="highlighter-rouge">require "view_component/storybook/engine"</code> to <code class="highlighter-rouge">config/application.rb</code></p>
611
612 <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code># config/application.rb
613 require_relative 'boot'
614
615 require 'rails/all'
616 require "view_component/storybook/engine"
617 ....
618 </code></pre></div></div>
619
620 <p>Add <code class="highlighter-rouge">*/*.stories.json</code> to <code class="highlighter-rouge">.gitignore</code></p>
621
622 <h2 id="2-configure-asset-hosts">2. Configure Asset Hosts</h2>
623
624 <p>If your view components depend on Javascript, CSS or other assets served by the Rails application, you will need to configure <code class="highlighter-rouge">asset_hosts</code> appropriately for your various environments. For local development, this is a simple as adding to <code class="highlighter-rouge">config/development.rb</code>:</p>
625
626 <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Rails.application.configure do
627 config.action_controller.asset_host = 'http://localhost:3000'
628 end
629 </code></pre></div></div>
630
631 <p>Naturally, you can do the same for staging and production.</p>
632
633 <h2 id="3-install-storybook-via-yarn">3. Install Storybook via yarn</h2>
634
635 <ol>
636 <li>Add Storybook server as a dev dependency. The Storybook Controls addon isn’t needed but comes recommended.
637 <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>yarn add @storybook/server @storybook/addon-controls --dev
638 </code></pre></div> </div>
639 </li>
640 <li>Add an NPM script to your package.json to start your Storybook later.
641 <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>// package.json
642 {
643 "scripts": {
644 "storybook": "start-storybook"
645 }
646 }
647 </code></pre></div> </div>
648 </li>
649 <li>Create a folder called <code class="highlighter-rouge">.storybook</code>. It is a dotfolder. From the command line, do the following:
650 <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
mkdir .storybook
651 </code></pre></div> </div>
652 </li>
653 <li>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 <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>touch .storybook/main.js
655 </code></pre></div> </div>
656 <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>// .storybook/main.js
657 module.exports = {
658 stories: ['../test/components/**/*.stories.json'],
659 // stories: ['../spec/components/**/*.stories.json'], if using RSpec
660 addons: [
661 '@storybook/addon-controls',
662 ],
663 };
664 </code></pre></div> </div>
665 </li>
666 <li>Create the .storybook/preview.js file to configure Storybook with the Rails application URL to call for the HTML content of the stories
667 <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>touch .storybook/preview.js
668 </code></pre></div> </div>
669 <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>//.storybook/preview.js
670 export const parameters = {
671 server: {
672 url: `http://localhost:3000/rails/stories`,
673 },
674 };
675 </code></pre></div> </div>
676 <h2 id="4-your-first-storybook-component">4. Your First StoryBook Component</h2>
677 </li>
678 </ol>
679
680 <p><code class="highlighter-rouge">ViewComponent::Storybook::Stories</code> provides a way to preview components in Storybook.
681 Suppose our app has a <code class="highlighter-rouge">ButtonComponent</code> that takes a <code class="highlighter-rouge">button_text</code> parameter:</p>
682 <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>class ButtonComponent &lt; ViewComponent::Base
683 def initialize(button_text:)
684 @button_text = button_text
685 end
686 end
687 </code></pre></div></div>
688 <p>We can write a stories describing the <code class="highlighter-rouge">ButtonComponent.</code>
689
So in spec/components/stories or test/components/stories, put in the following
</p>
690 <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>class ButtonComponentStories &lt; ViewComponent::Storybook::Stories
691 story(:with_short_text) do
692 constructor(title: "my title")
693 end
694
695 story(:with_long_text) do
696 constructor(title: "my title")
697 end
698 end
699 </code></pre></div></div>
700
701 <h2 id="5--generate-storybook-json">5. Generate Storybook JSON</h2>
702
703 <p>Generate the Storybook JSON stories by running the rake task:</p>
704
705 <p><code class="highlighter-rouge">rake view_component_storybook:write_stories_json</code></p>
706
707 <p>Now you should be able to start the rails app and run the Storybook
708 rails s
709 yarn storybook # in separate tab</p>
710
711 <h2 id="configuration-rspec-only"><strong>Configuration</strong> (RSpec Only)</h2>
712
713 <p>By Default ViewComponent::Storybook expects to find stories in the folder <code class="highlighter-rouge">test/components/stories</code>. This can be configured by setting <code class="highlighter-rouge">stories_path</code> in <code class="highlighter-rouge">config/application.rb</code>. For example if you’re using RSpec you might set the following configuration:</p>
714
715 <p><code class="highlighter-rouge">config.view_component_storybook.stories_path = Rails.root.join("spec/components/stories")</code></p>
716
717 <h2 id="gotchas">Gotcha’s</h2>
718
719 <p>I had to add rack-cors gem and configure wildcard access for development.</p>
720 <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code> bundle add rack-cors
721 </code></pre></div></div>
722 <p>In config/development.rb, I added the following lines:</p>
723
724 <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code># config/development.rb
725 config.action_controller.asset_host = 'http://localhost:5000'
726 config.middleware.insert_before 0, Rack::Cors do
727 allow do
728 origins '*'
729 resource '/rails/stories/*', :headers =&gt; :any, :methods =&gt; [:get]
730 end
731 end
732 </code></pre></div></div>
733
734 <p>Another Gotcha, I ran into. After you update the HTML for the component, you have to rerun the rake task.</p>
735
736 <h2 id="conclusion">Conclusion</h2>
737
738 <p>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 <a href="https://github.com/jonspalmer/view_component_storybook/tree/main/docs/guide">check out the docs</a>. This gem is still under development and was even updated while I was writing this article.</p>
739
740 <p>Happy coding.</p>
741
742 <p>
</p></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/"><p><img src="/assets/images/posts/stress.jpeg" alt="alt text" title="man covered in post-it notes" />
743 Photo by <a href="https://unsplash.com/@villxsmil?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Luis Villasmil</a> on <a href="https://unsplash.com/s/photos/stress?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></p>
744
745 <p>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.</p>
746
747 <p>However, this article is not about how <em>I</em> build software.</p>
748
749 <p>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.</p>
750
751 <p>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.</p>
752
753 <p>After a few weeks, I could see the cause of the “slow product development”. The team was using <a href="https://www.educba.com/what-is-agile-sprint/">2-week sprints</a> for project management and didn’t write any tests.</p>
754
755 <p>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.</p>
756
757 <p>The Jira tickets assigned to each developer started to compound and grow with each sprint.</p>
758
759 <p>I’ve observed this pattern in 2 other companies leading me to believe that sprints are not suitable for good Software Development.</p>
760
761 <p>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.</p>
762
763 <p>The other companies I could not rescue.</p>
764
765 <p>It’s funny reading the <a href="http://agilemanifesto.org/">Agile Manifesto</a> and then doing sprints to see the complete lack of juxtaposition with a good work environment.</p>
766
767 <p>Even the word sprint implies 100% all-out until you hit the finish line.</p>
768
769 <h2 id="retro---lets-talk-about-what-went-wrong-more-than-what-went-right">Retro - Let’s talk about what went wrong more than what went right</h2>
770
771 <p>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.</p>
772
773 <p>Yet, for some reason, critiquing the process becomes frowned upon. <em>It works for other people</em> so it must be us that’s doing it wrong.</p>
774
775 <p>Even worse, people continue on this hedonic treadmill towards burnout.</p>
776
777 <p>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.</p>
778
779 <h2 id="daily-standup---lets-talk-about-what-we-already-talked-about">Daily Standup - Let’s talk about what we already talked about</h2>
780
781 <p>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.</p>
782
783 <p>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.</p>
784
785 <p>Let people self-motivate and treat them like adults. Everything else will fall into place.</p>
786
787 <h2 id="lifestyle">Lifestyle</h2>
788
789 <p>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.</p>
790
791 <p>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.
</p>
792
793 <h2 id="final-thoughts">Final thoughts</h2>
794
795 <p>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.</p>
796
797 <p>I’ve seen development cycles done well, but it was never sprints. Instead, it was a combination of old school goals and continuous integration.</p>
798
799 <p>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.</p>
800
801 <p>Overall, when starting a project, taking the pain and barriers out of the way is the most important.</p>
802
803 <p><strong>Are too many bugs being created?</strong></p>
804
805 <p>Then write tests and use a CI build to help keep them under control.</p>
806
807 <p><strong>Is there pressure to get features in?</strong></p>
808
809 <p>Then hold off and make sure the parts you’re bringing in are worth it.</p>
810
811 <p><strong>Is it hard to onboard a new team member?</strong></p>
812
813 <p>Lower the barrier to get code to production.</p>
814
815 <p>Ship small. Ship early. Ship smart. Ship often.</p></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/"><p><img src="/assets/images/posts/hello_iphone.jpg" alt="alt text" title="iPhone 8 with Hello text on screen" />
816 Photo by <a href="https://unsplash.com/@lastly?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Tyler Lastovich</a> on <a href="https://unsplash.com/s/photos/iphone?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></p>
817
818 <p>I get asked about mobile apps a lot.</p>
819
820 <p>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.</p>
821
822 <p>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 <em>feel</em> like an iPhone app. Plus, the JavaScript tooling ecosystem is a special kind of hell that I don’t enjoy.</p>
823
824 <p>I know my feelings are subjective, but I don’t love building things with JavaScript. I’m not alone as there is a <a href="https://williamkennedy.ninja/javascript/2020/12/23/rebellion-against-spas-has-begun/">whole cult of people actively making tools to help avoid JavaScript altogether</a>.
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.</p>
826
827 <p>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 <a href="https://killedbygoogle.com/">shutting down a project</a> 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.</p>
828
829 <p>When Basecamp announced the release of <a href="https://turbo.hotwire.dev/">Turbo</a>, 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.</p>
830
831 <p>After completing <a href="https://www.hackingwithswift.com/100/swiftui">Hacking with SwiftUi</a> 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.</p>
832
833 <p>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.</p>
834
835 <p>However, you still have some complex gaps to fill in yourself.</p>
836
837 <ul>
838 <li>Native Authentication, i.e. allow users to log in to your app and store the cookie in the Apple keychain</li>
839 <li>Push Notifications - send notifications from your app to the native notifications</li>
840 </ul>
841
842 <p>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 <a href="http://gorails.com">GoRails</a> wondering if I want to be an early user of the new <a href="https://jumpstartrails.com/ios">Jumpstart iOS template</a>.</p>
843
844 <p>The answer was yes.
</p>
845
846 <p>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.</p>
847
848 <p>Aside from wrapping your Rails app in a native view, it’s possible to go even further. Here are some things I have managed:</p>
849
850 <ul>
851 <li>From day 1, my current project, <del>Koach</del> <a href="https://smartstrengthapp.com/">Smart Strength</a> worked as a native iPhone app</li>
852 <li>From day 1, I was able to quickly delegate <a href="https://twitter.com/_williamkennedy/status/1390707352345645061">certain parts to a native view for a more authentic experience</a></li>
853 <li>Able to offer native experiences for certain sections of my site e.g anything that ends in new or edit gets the iOS ActionSheet</li>
854 </ul>
855
856 <p>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:</p>
857
858 <ul>
859 <li>Your web app needs to be <a href="https://turbo.hotwire.dev/">Turbo enabled</a>(it does not have to be a Rails app but needs to use Turbo)</li>
860 <li>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 <a href="https://developer.apple.com/videos/">some amazing videos</a>.</li>
861 <li>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.</li>
862 <li>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.</li>
863 </ul>
864
865 <p>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 <strong><em>“jump starts”</em></strong> 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.</p>
866
867 <p>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.</p>
868
869 <p>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.</p>
870
871