<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Shadrack Lilan</title><description>Writing, TILs, and book notes from Nairobi — software, mental health tech, and coffee.</description><link>https://shadracklilan.com/</link><language>en</language><atom:link href="https://shadracklilan.com/rss.xml" rel="self" type="application/rss+xml"/><item><title>Akrasia</title><link>https://shadracklilan.com/posts/akrasia/</link><guid isPermaLink="true">https://shadracklilan.com/posts/akrasia/</guid><description>Sometimes we are our own worst enemy. Oh and happy new year!</description><pubDate>Tue, 16 Feb 2021 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;When I started this blog, I hoped to churn out at least one article every two weeks. However, it has been over 8 months since my last post and I felt frustrated because it was not the first time I set a seemingly easy goal but failed to follow through.&lt;/p&gt;
&lt;p&gt;Out of my frustration came a desire to understand why I couldn&amp;#39;t maintain my goal of a post every 2 weeks. I began my research on procrastination around September and I came across an interesting concept called Akrasia. This post is a series of notes I made on the topic.&lt;/p&gt;
&lt;h2&gt;What is Akrasia?&lt;/h2&gt;
&lt;p&gt;According to Google&amp;#39;s dictionary, akrasia is:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;the state of mind in which someone acts against their better judgement through weakness of will.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A student wants to set aside some study time in the next hour. The student knows the benefits of study time, however, they find themselves watching &lt;em&gt;family guy&lt;/em&gt; during this period.&lt;/p&gt;
&lt;p&gt;Here  is another example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;9:00 AM: I have to study at 3PM
2:30 PM: Champions league game is on; Not feeling like studying, I can push it off to 5PM
4:55 PM: Got invited for early diner; I still have time in the evening, I&amp;#39;ll study at 7PM
7:00 PM: Okay enough procrastinating, let me actually get some studying done.
7:30 PM: Oh crap! I have way more material to go through than I thought (panic sets in)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In those two examples we can see two things happening:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Procrastination&lt;/strong&gt;: irrationally delaying a task with immediate cost and delayed benefit.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Preproperation&lt;/strong&gt;:  overindulgence in activities with immediate benefit and delayed cost.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;How is it possible that we do stuff that&amp;#39;s against our best future interests?&lt;/p&gt;
&lt;p&gt;The most compelling explanation for me came from an economics concept known as &lt;strong&gt;time
inconsistency&lt;/strong&gt;.  It&amp;#39;s when your preferences change over time in such a way that what you like
today, is not what you like in the next hour, or tomorrow, or at some other point in the future. An example is how TV time is more preferable than study time in the present, but if asked yesterday on how to spend your time today, you would gladly mention that study time should come on top.&lt;/p&gt;
&lt;p&gt;Unfortunately, Akrasia is a default setting for all humans, and the faster you recognize it, the better the chances of avoiding a potentially deleterious sequence of actions.&lt;/p&gt;
&lt;h2&gt;Let&amp;#39;s start running&lt;/h2&gt;
&lt;p&gt;Let&amp;#39;s say you want to pick up a running habit. If you are a first time runner, you will probably research on the best shoes, proper form etc., and it&amp;#39;s easy to find yourself in forums where people are clocking 10K runs daily, and then you get discouraged because the thought of running 10K in the Nairobi sun is too daunting. However, the initial goal was to pick up a running habit, and not to run a 10K daily so let&amp;#39;s stick with the former. You can break this up into 20 minute run sessions with the basic minimum of giving your best effort, and just like that we have made the goal easier to achieve, just a 20 minute run with no speed requirements. The most important thing is to get started and to get over the initial hump. However there are 2 things that
are likely to happen:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You fail to get over the initial hump&lt;/li&gt;
&lt;li&gt;You get bored after the initial hump&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Certain people may never face these issues, others might quickly recognize things going south and they will correct their path, and others(including myself) might fall into one of the aforementioned situations. However all hope is not lost, in fact, there are tools and strategies out there to help you defeat the tendency to &amp;quot;give up&amp;quot;/&amp;quot;get bored&amp;quot;. I&amp;#39;ll focus on one the one that I found most effective for my own challenges.&lt;/p&gt;
&lt;h2&gt;Commitment Contracts&lt;/h2&gt;
&lt;p&gt;One of the more impactful strategies that I came across was creating a &lt;strong&gt;commitment contract&lt;/strong&gt;. Basically, you need to set penalties for your current self whenever you fail to do an action that you know will cost you in the future.&lt;/p&gt;
&lt;p&gt;An example of a commitment contract would be, you will lose $5 if you do not get out of bed and meditate as soon as your alarm goes off. You set your alarm because you wanted to create time to meditate. When the alarm goes off, you might be tempted to stay in bed because it is warm, and you might end up rationalizing your behavior e.g. &amp;quot;I have never meditated in my life, so one day without meditation is not going to kill me&amp;quot;. Although lack of meditation won&amp;#39;t kill you, you will be denying your future self the upside of a meditation habit. The commitment contract now comes into play by adding a penalty that&amp;#39;s felt in the present i.e. you get charged for not waking up early and meditating. You are now forced to meditate more, but after a certain period of consistent meditation, it becomes a habit, and you may not need that commitment contract anymore. &lt;/p&gt;
&lt;p&gt;How can we apply the commitment contract to our running situation? I can create a contract whereby if I fail to go for a scheduled run, I will lose some money. The money represents the future fitness&amp;quot;points&amp;quot; that I lost because I didn&amp;#39;t go for my run. I&amp;#39;ll be starting off with small 20 minute runs, and I am unfit so I end up doing 2 miles. For some, that running time is awful, but remember our objective is to start running, not to run 4 miles in 20 minutes. Whenever I feel like slacking, I am reminded that I will lose $5, as a penalty from future self. Over time, my body gets accustomed to running, I notice that I am faster, and I am fitter. I am 
finally realizing the gains of running consistently. I may have even reached a point, where I cannot start my day without a solid 5k run.&lt;/p&gt;
&lt;p&gt;How can we apply the commitment contract to our student trying to study?  We could get the student
to study could be to ask them tol donate money to a cause they hate for every hour that they procrastinate.
That way, watching that champions league game means that your least favorite charity gets your money. Although the incentives might be a bit warped, you will be setting up your future self for success.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Commitment contracts are great for getting over the initial hump of the habit forming process, but they can help with just getting things done that maybe spanning a long time horizon e.g. a thesis.&lt;/p&gt;
&lt;p&gt;I created commitment contracts for my most troublesome habits/activities. I used &lt;a href=&quot;https://www.beeminder.com&quot;&gt;beeminder&lt;/a&gt; and it has kept me honest for the last 6 months. You can track some of my activities on &lt;a href=&quot;https://www.beeminder.com/slilan&quot;&gt;beeminder page&lt;/a&gt;, and you&amp;#39;ll see that I still struggle from time to time, but I have also made considerable progress that have translated to real life benefits.&lt;/p&gt;
&lt;p&gt;I plan on reviewing the data towards the end of the year and share any insights I can find.&lt;/p&gt;
&lt;h3&gt;Further reading&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Beeminder Blog : &lt;a href=&quot;https://blog.beeminder.com/&quot;&gt;https://blog.beeminder.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&amp;quot;Deep Work&amp;quot; by Carl Newport&lt;/li&gt;
&lt;li&gt;&amp;quot;Good Habits, Bad Habits: The Science of Making Positive Changes That Stick&amp;quot; by Wendy Wood&lt;/li&gt;
&lt;li&gt;&amp;quot;Getting Things Done&amp;quot; by David Allen&lt;/li&gt;
&lt;/ol&gt;
</content:encoded></item><item><title>A Review Of My First Year As A Software Engineer</title><link>https://shadracklilan.com/posts/software-eng-year-in-review/</link><guid isPermaLink="true">https://shadracklilan.com/posts/software-eng-year-in-review/</guid><description>It&apos;s been an eye opening experience!</description><pubDate>Fri, 26 Jun 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Today marks a month to my one year anniversary as software engineer.
I began working for a local startup in Nairobi without ever doing a
software engineering internship. I am forever thankful to my manager
for taking a chance on an unproven, fresh out of college kid who
barely took enough computer science classes to really understand
what&amp;#39;s happening under the hood of a computer.&lt;/p&gt;
&lt;p&gt;The opinions in this piece are shaped by my experience working in
a startup, therefore some readers may relate, others may not.&lt;/p&gt;
&lt;h2&gt;A little background...&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Disclaimer: This section may have little to do with actual software engineering
but I thought I would open up about my journey leading up to this point. This
section mainly details my self esteem issues, and it&amp;#39;s the first time I am opening
up about this to anyone. Feel free to read this or skip to the next section.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I have to admit the lack of internship experience was entirely my fault.
I was fortunate to attend a school where the largest tech companies in the
world would show up begging for people to apply, however I never took
advantage of this opportunity because I had a strong case of &lt;strong&gt;impostor syndrome&lt;/strong&gt;.
I had a rough start academically in my freshman year and it took me up to up to
spring of sophomore year to get back on track.
However, by then my self esteem was so low that I could never muster the courage to apply for an
internship.&lt;/p&gt;
&lt;p&gt;I took a handful of computer science classes in college and I built some really
cool stuff for final projects. I was quite good at coding assignments but
sucked at proof assignments (to this day I wonder why there was a chasm between
the two assignments yet the former built on the latter).
I would help a bunch of my friends out with these practical assignments, and it reached a
point where they would prefer to see me instead of seeing the teaching assistants.
This was a great self esteem boost and it encouraged me to do an even better job of
helping others with their coding problems, but it wasn&amp;#39;t enough of a boost to deem
myself worthy of a shot at a big tech company.&lt;/p&gt;
&lt;p&gt;The height of my impostor syndrome was in Fall 2018 when a good friend
recommended me to a Facebook recruiter. The recruiter looked at my pet projects
on GitHub&lt;sup class=&quot;fn-ref&quot;&gt;&lt;a href=&quot;#fn-1&quot; id=&quot;fnref-1&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; and decided to give me a chance. However, my mind conjured all
manner of excuses to avoid the interview. I sent an email to the recruiter that
went along the following lines:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Hey, thanks for the interest, I am honoured. However, at this stage I have
not taken the requisite class so I think I will fail the interview, can I
check in again at the end of the semester?&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Some of you will cringe after reading that email, and I feel you. The requisite
course referred to in the email was a DS and algos course. My university split
DS and Algos into two courses, and I had only done the first course, which
focused on implementation over proofs. The second course was where proofs met
implementation, and it introduced concepts like space-time complexity.
In retrospect, I think the first course was enough to power through FAANG
interviews with maybe a month of preparation to touch up on space-time complexity.
The fact that boot-camp graduates land in big tech without taking a rigorous DS
and Algos course vindicates my opinion. However, the first thought in my mind
when the recruiter reached out was &amp;quot;I am not good enough to interview&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;(Reader warning, more cringe to follow...)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;One of the hidden motives of my email response was that by asking for time,
the recruiter would move on to find other candidates, and save
myself from &lt;em&gt;eventual&lt;/em&gt; rejection during a phone screen. To my surprise, the
recruiter was perfectly fine with my request, and she actually waited. In
January 2019, I got an email from the recruiter saying the position was no
longer available. It is at this point I realized ... I am a complete joke.
This email response weighed heavily on the rest of my senior year, and I
was so crushed by how poorly I thought of myself that I could not get myself to
apply for anything else.&lt;/p&gt;
&lt;p&gt;It was time to graduate, but I had nothing to show for it. I had an
average GPA, no serious leadership positions in college, one half-assed
extra-curricular activity, and no internship. I knew that finding a job was going
to be hard. With my back against the wall, I decided to move out&lt;sup class=&quot;fn-ref&quot;&gt;&lt;a href=&quot;#fn-2&quot; id=&quot;fnref-2&quot;&gt;2&lt;/a&gt;&lt;/sup&gt; out of my
comfort zone and do two things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Apply everywhere.&lt;/li&gt;
&lt;li&gt;Accept that rejection is a part of life, embrace it. I will try to limit
it&amp;#39;s occurrences, not by shutting myself out of opportunities but making it
harder for someone to say no to me.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I decided to return to Kenya, and begin my job search there. I felt confident
in the decision to go back home because I knew there was a bustling start-up
scene so there won&amp;#39;t be a dearth of opportunities. I landed two interviews
within a week of getting back home. After two weeks, I had secured a job.&lt;/p&gt;
&lt;h2&gt;Initial Thoughts Of The Profession&lt;/h2&gt;
&lt;p&gt;I really believed that a software engineer only creates applications and that&amp;#39;s
the end. I thought that software engineers never interacted with the business
side of a company. Software engineers lived in this bubble in their office and
their only worry was making something run faster, or release a new feature
so that users are happy and will continue using the product.&lt;/p&gt;
&lt;h2&gt;The Reality&lt;/h2&gt;
&lt;p&gt;Software engineering is one of the components of the business&amp;#39; machine. Depending on
the size or the culture of your organization, you may actually never speak to the business
team. On the other hand, you may find yourself very involved in the business side of things.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll go a little in-depth on some key areas that stood out to me during this past year.&lt;/p&gt;
&lt;h3&gt;Software vs Business&lt;/h3&gt;
&lt;p&gt;I started thinking more about business, and how my work directly impacts the
bottom-line. I have seen how a bad data model can slow down or potentially ruin
a business opportunity. I have come to appreciate the importance of understanding
the problem that you are trying to solve for.&lt;/p&gt;
&lt;p&gt;I have wrestled with the idea that you shouldn&amp;#39;t go asking customers for
requirements, even though conventional thought suggests that &lt;em&gt;&amp;quot;The customer is
always right&amp;quot;&lt;/em&gt;. I have learned that you should not ask developers for
requirements because they tend to operate in a bubble and their suggestions
could be far from the users&amp;#39; reality. I am not saying that you shouldn&amp;#39;t listen
to the users and developers, rather, their opinions and experiences should inform product development&lt;/p&gt;
&lt;h3&gt;Tools and Frameworks&lt;/h3&gt;
&lt;p&gt;If you go to any programming/tech related website, you will find discussions
on the next new thing, or some strong opinion about an existing tool or
framework. Initially I was drawn to such content because I could learn the new
&lt;em&gt;in thing&lt;/em&gt; or have something cool to say when I meet other
people interested in software development. A year later, I have a different
reason for consuming this content. I now read to see if the new tool/framework
addresses a problem that I am facing at work, or if the cost of switching over
to the new tool will pay for itself down the line.&lt;/p&gt;
&lt;p&gt;I have learned it is more important to select the right tool for the
task at hand e.g. you would use C or C++ for embedded systems programming or
something where every millisecond counts, or you should use Python for data
science stuff since it has a robust ecosystem in that area. There are more
examples and use cases I could jump into but that&amp;#39;s not the point here.&lt;/p&gt;
&lt;p&gt;This does not mean that you should not read up on the new stuff or test new
tools. I&amp;#39;d now attach a target outcome when reading about this stuff e.g.
does this tool address a problem I am facing. However, sometimes you just want
to stay in the know and that is absolutely fine too!&lt;/p&gt;
&lt;h3&gt;Trade-offs and Thinking Fast&lt;/h3&gt;
&lt;p&gt;I went into software engineering thinking that the environment/expectations
would be the same as an academic setting i.e. write modular code, test
everything and you are good to go. All of these concepts carry over from the
academic realm to the professional world, but it may not be a 1:1 transition.&lt;/p&gt;
&lt;p&gt;One of the concepts that did not map neatly was testing. Business
requirements are ever changing, which means that code is ever changing, and in
this case, unit tests may become an impediment when refactoring/deleting old code.
I remember reading an article about an engineer working in one of the Silicon
Valley pioneers (think HP, Oracle etc) who had to spend months working on a
small change because he had a test suite that run for almost 2 hours and most
of them were unit tests that were no longer relevant. The point here, is
not to condemn unit tests, but to provoke a discussion of when and where to have
unit tests, especially if the code base is changing quickly. Personally, I
don&amp;#39;t have an answer for this yet, but someday I may be on a podium in some
conference talking about this issue, so stay tuned!&lt;/p&gt;
&lt;p&gt;Another issue that popped up was how to deal with tech debt. There are instances
where business requires a new feature in short time frame. The feature
could be complex and may require significant code overhaul, but the folks
in management want the thing shipped as soon as now. In that case you will have
to make some tough decisions with respect to your code, and possibly monkey
patch some things and add feature flags here and there and add something like this
:point_down:.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;  // TODO: please refactor this block of code.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Voila! Tech debt. The managers are happy that a customer is happy with a new
feature, but as a developer, this &lt;code&gt;TODO&lt;/code&gt; block is an eyesore every time you come
across it. It could be that the block of code is hard to understand for other
developers, or it could be that the block of code is demonstrably slow for some
operations e.g. database calls. The code base will be littered with these TODOs
unless the team schedules a regular clean up. However, business needs to keep
innovating and meet investor demands so the rate of clean up might be slower
than the rate of &lt;code&gt;TODOs&lt;/code&gt; popping up in code despite going through rigorous code
reviews.&lt;/p&gt;
&lt;h2&gt;The Next Steps&lt;/h2&gt;
&lt;p&gt;As I head into year two, the main thing I want to focus on is to get better
at thinking on my feet. This is not to say that I have achieved perfection in
terms of coding style or testing or even the fundamentals of computers. I am
still learning as I go, and they will get better with applied effort
and experience. However, I have learned that this career is full of trade-offs,
and having a good nose for the right trade-offs is really valuable.&lt;/p&gt;
&lt;p&gt;I also want to dive deeper into the inner workings of computers. How does my
JavaScript code move from a &lt;strong&gt;.js&lt;/strong&gt; file into the &lt;strong&gt;V8&lt;/strong&gt; compiler and finally into
machine code? I have some understanding of how this works, but I think it would
also be nice to know these hard concepts.&lt;/p&gt;
&lt;section class=&quot;footnotes&quot; aria-label=&quot;Footnotes&quot;&gt;
&lt;ol&gt;
&lt;li id=&quot;fn-1&quot;&gt;Since then I have deleted these projects because they were one-off projects and I am currently working on more involving projects for my own use. &lt;a href=&quot;#fnref-1&quot; class=&quot;fn-back&quot;&gt;↩&lt;/a&gt;&lt;/li&gt;
&lt;li id=&quot;fn-2&quot;&gt;Note the use of the term &lt;em&gt;move out&lt;/em&gt; as opposed to &lt;em&gt;step out&lt;/em&gt;. I feel like &lt;em&gt;step out&lt;/em&gt; implies that I am still close to my comfort zone. I am a firm believer that language is a manifestation of your thoughts, and in this case I really wanted to &lt;em&gt;move out&lt;/em&gt; of my comfort zone. &lt;a href=&quot;#fnref-2&quot; class=&quot;fn-back&quot;&gt;↩&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;</content:encoded></item><item><title>Setup Vim for Javascript Development</title><link>https://shadracklilan.com/posts/setup-vim-for-javascript-development/</link><guid isPermaLink="true">https://shadracklilan.com/posts/setup-vim-for-javascript-development/</guid><description>You can get Javascript autocomplete and linting in Vim too!</description><pubDate>Tue, 09 Jun 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;There are a lot of tools that you can use to edit your code, and none of them
more intimidating than vim. There is a saying that a good way to freak out
the non computer savvy public or new linux users is to ask them to close
vi/vim/neovim instance from the terminal.&lt;/p&gt;
&lt;p&gt;When I started using linux, I would occassionally end up in situations
where vim was opened by another program (looking at you &lt;strong&gt;git&lt;/strong&gt;) and I did not
know how to manipulate a file, let alone close the program. I would feel very
frustrated, but not sufficiently motivated to learn how to use Vi/Vim.&lt;/p&gt;
&lt;p&gt;My &amp;quot;I must learn Vim&amp;quot; moment came when I saw my engineering manager move code
around using only vim and his keystrokes. However, I couldn&amp;#39;t make
the switch because:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;I needed a language server for JS/TS (though I feel like I need it wean
 myself off language server use)&lt;/li&gt;
&lt;li&gt;I needed a linter running in my IDE/text editor.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I would consider myself an early adopter of VSCode, and what set it apart
from other editors(IMO) for JS development was it&amp;#39;s inbuilt TypeScript langauge
server. This simplified writing Javascript because you had autocomplete on your
side and a rudimentary linting service provided by the language server.&lt;/p&gt;
&lt;p&gt;The de facto linting tool for JavaScript is &lt;strong&gt;eslint&lt;/strong&gt;. Visual Studio does not
ship direct support for eslint but one can download the eslint extension from
the marketplace to get linting on the fly. After installation, you would see
red squiggly lines on offending lines of code. You could right click on the
line and you would be presented with different options for handling the error.&lt;/p&gt;
&lt;p&gt;A direct jump to Vim for JS work would mean I would keep syntax highlighting but
I would lose the language server and IDE linting.... or did it? Turns out Vim
can support a language server and a linting service. This can be done using
plugins or scripts, but for this tutorial I shall be using the former. The next
steps assume that you are using &lt;a href=&quot;https://github.com/junegunn/vim-plug&quot;&gt;VimPlug&lt;/a&gt;
as your plugin manager. If that&amp;#39;s not the case, you can substitute your package
management system/scripts wherever VimPlug is mentioned.&lt;/p&gt;
&lt;h2&gt;Setting up a language server&lt;/h2&gt;
&lt;p&gt;We have &lt;strong&gt;VimPlug&lt;/strong&gt; up and running, so let&amp;#39;s install a language server.
There are several language server packages out there but I chose
&lt;a href=&quot;https://github.com/neoclide/coc.nvim&quot;&gt;coc.nvim&lt;/a&gt;, becuase it&amp;#39;s an
IntelliSense engine i.e. the same as VSCode. Just like that I have VSCode like
language server engine in my terminal. Shout out to the team that develops this
package.&lt;/p&gt;
&lt;p&gt;Open up your &lt;strong&gt;.vimrc&lt;/strong&gt; file and add the following lines in the &lt;strong&gt;VimPlug&lt;/strong&gt;
section.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-vim&quot;&gt;# rest of you configuration

call plug#begin()
Plug &amp;#39;neoclide/coc.nvim&amp;#39;, {&amp;#39;branch&amp;#39;: &amp;#39;release&amp;#39;}
call plug#end()

# rest of your configuration
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Save the document, but don&amp;#39;t close Vim yet. Type &lt;code&gt;:PlugInstall&lt;/code&gt; and watch
VimPlug do it&amp;#39;s magic.&lt;/p&gt;
&lt;p&gt;Once that&amp;#39;s done, we can now install the TypeScript language server by running
the following command in Vim:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-vim&quot;&gt;:CocInstall coc-tsserver coc-json
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;coc-tsserver&lt;/code&gt; and &lt;code&gt;coc-json&lt;/code&gt; are language servers for TypScript and JSON
respectively&lt;/p&gt;
&lt;p&gt;And just like that you have a language server up and running. See the GIF
below to see it in action.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;/img/language_server.gif&quot; alt=&quot;Language Server GIF&quot;&gt;
  &lt;figcaption&gt;Language server at work in Vim&lt;/figcaption&gt;
&lt;/figure&gt;&lt;h2&gt;Setting up a linter&lt;/h2&gt;
&lt;p&gt;Last step is to setup a linter a.k.a the developer&amp;#39;s first defense againt bugs.
I chose &lt;a href=&quot;https://github.com/dense-analysis/ale&quot;&gt;ALE&lt;/a&gt; for this simply becuase of
the internet activity around it. I have not yet reached the technical
proficiency to tell you how it get&amp;#39;s its business done, but I plan to revisit
this topic later so stay tuned for another post.&lt;/p&gt;
&lt;p&gt;ALE comes with sensible defaults, but it is highly configurable, including
prettier configuration. I encourage the reader to checkout the documentation
and learn what can be changed.&lt;/p&gt;
&lt;p&gt;See some language server + linting action in vim below:&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;/img/ale_coc_server.gif&quot; alt=&quot;Language Server and Linter GIF&quot;&gt;
  &lt;figcaption&gt;&quot;Language Server + Linter at work&quot;&lt;/figcaption&gt;
&lt;/figure&gt;&lt;p&gt;As you can see in the GIF above, ALE will list the errors in the status bar
when you navigate to the &amp;quot;offending line&amp;quot;.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;With two easy installation steps, we can go on with JavaScript development in
Vim. I guess the next challenge for me is to become a keystroke guru in Vim.&lt;/p&gt;
</content:encoded></item><item><title>Building this blog using Hugo and Netlify</title><link>https://shadracklilan.com/posts/setting-up-blog-hugo/</link><guid isPermaLink="true">https://shadracklilan.com/posts/setting-up-blog-hugo/</guid><description>Documenting the steps I took to set up this blog</description><pubDate>Thu, 21 May 2020 14:44:58 GMT</pubDate><content:encoded>&lt;p&gt;For my first post, I thought it would be nice to share how I set up this blog.
I wanted to set up a blog for a while so that I could share my thoughts
and learnings with the world, and improve my writing while at it. I figured that
since I would write about some technical stuff, I would have to really interrogate
my understanding of things before I could post about them.&lt;/p&gt;
&lt;p&gt;Building this blog was 99% fun. The 1% bad part was dealing with GoDaddy&amp;#39;s
crappy and slow UI. I&amp;#39;ll go ahead and outline my steps&lt;/p&gt;
&lt;h2&gt;Choosing the blogging platform/tool&lt;/h2&gt;
&lt;h3&gt;A blogging website&lt;/h3&gt;
&lt;p&gt;I think the default option for most people would be to use
&lt;a href=&quot;https://www.wordpress.com&quot;&gt;Wordpress&lt;/a&gt;. The free plan works fine however,
I didn&amp;#39;t like the fact that my website would come with wordpress
ads. If I didn&amp;#39;t want ads, I would have to pay a minimum of $4/month, and this
was too high for me because I knew that I could away with cheaper.&lt;/p&gt;
&lt;p&gt;The other, more technical option, was to download the source code and manage
the build, deploy and hosting processes myself. This should tickle some
developer&amp;#39;s fancy, but I wasn&amp;#39;t ready to start tinkering with &lt;strong&gt;PHP&lt;/strong&gt; code,
so this was a non starterd.&lt;/p&gt;
&lt;p&gt;There are a ton of other blogging sites that one could use, but I didn&amp;#39;t bother
looking after realizing that I could build one to my liking without spending a
dime (though I will have to spend some time 😀️).&lt;/p&gt;
&lt;h3&gt;Building my own&lt;/h3&gt;
&lt;p&gt;The main reason I chose to build my own, was that I was looking for a very
minimal blog. I wanted the reader and myself to focus on the writing. I was
inspired by &lt;a href=&quot;https://macwright.org/&quot;&gt;Tom MacWright&amp;#39;s&lt;/a&gt; blog, and how simple it
looked (there is some good stuff on that blog feel free to check it out).&lt;/p&gt;
&lt;p&gt;One thing about building your own, is that you will have to fiddle around with
setup, layout, deployment etc. While this could be a good learning experience,
I did not want to reinvent the wheel for some of those tasks, especially,
building and deployment.&lt;/p&gt;
&lt;p&gt;In comes static site generators. These generators basically handle the building
part and enforce some convention to allow you to focus on crafting your content.
Some of the popular ones are &lt;a href=&quot;https://jekyllrb.com&quot;&gt;Jekyll&lt;/a&gt;,
&lt;a href=&quot;https://gohugo.io/&quot;&gt;Hugo&lt;/a&gt;, &lt;a href=&quot;https://https://www.gatsbyjs.org/&quot;&gt;Gatsby&lt;/a&gt; etc.&lt;/p&gt;
&lt;p&gt;I started off with Jekyll, because I saw more references to it. I created
another version of this site and tried to host it on GitLab using Gitlab pages.
However, setting up the domain name on GitLab and GoDaddy was annoying and
frustrating. I tried adding Gitlab&amp;#39;s &lt;strong&gt;TXT&lt;/strong&gt; record to GoDaddy so I could
encrypt my domain and I expected the DNS records to propagate, but this was not
the case. I decided to delete the site&amp;#39;s repo, and consequently ditch the
domain.&lt;/p&gt;
&lt;p&gt;After that horrible exprience, I decided to start afresh with Hugo. Working
with Hugo is conceptually similar to Jekyll with a few differences including
choice of language. One difference that was noticably obvious was the build
time. I tried comparing the &lt;strong&gt;pixyll&lt;/strong&gt; theme implemenation on Jekyll and Hugo,
and I found that the latter built the site faster. I found Hugo&amp;#39;s documentation
to be extensive, which is always a good thing in software.&lt;/p&gt;
&lt;p&gt;The next step was choosing a theme. As mentioned earlier, I wanted a super
minimal site with these requirements:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Fast render time&lt;/li&gt;
&lt;li&gt;No fancy transitions&lt;/li&gt;
&lt;li&gt;No ads&lt;/li&gt;
&lt;li&gt;No fancy interactions&lt;/li&gt;
&lt;li&gt;No flashy images(unless it&amp;#39;s an image attachment for a blog post)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;There are many hugo themes and templates out there, and I settled on
&lt;a href=&quot;https://github.com/mitrichius/hugo-theme-anubis&quot;&gt;Anubis&lt;/a&gt;. It was very minimal,
looked good on mobile and desktop, and it had pretty good LightHouse scores.&lt;/p&gt;
&lt;p&gt;I deliberately didn&amp;#39;t explore Gatsby because I did not want to use React, and
I think it&amp;#39;s a bit of an overkill for simple static websites. In Jekyll and
Hugo, I only needed to put my markdown files in &lt;code&gt;content/&lt;/code&gt; but for Gatsby, I
needed to install plugins and handle some GraphQL, and that&amp;#39;s a bit much for me,
possibly overengineered for my particular use case.&lt;/p&gt;
&lt;p&gt;Alright, we have our site setup with Hugo, and a theme, the next and final step
was figuring out hosting. I settled on Netlify, since I was quite familiar with
it&amp;#39;s product offering, I liked ability to deploy straight from GitLab, and I
would get an encrypted domain. Setting up a domain with them was super easy,
and after the intial deploy, my secure site was global in less than 3 hours.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;I am quite happy that I have this blog up and running. This was a high level
description of the process that I went through to get things up and running.
I have left some details out e.g. installing Hugo, or setting up deploys from
GitLab to Netlify, because these processes are well documented.&lt;/p&gt;
&lt;p&gt;There are still more things I would like to add/change e.g improve constrast of
the theme, dark mode etc. but I am happy with this start.&lt;/p&gt;
</content:encoded></item></channel></rss>