<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>elpachongco's blog</title><link>https://earlps.net/</link><description>Recent content on elpachongco's blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 07 Mar 2026 08:05:00 +0800</lastBuildDate><atom:link href="https://earlps.net/index.xml" rel="self" type="application/rss+xml"/><item><title>How to get update notifications from this blog (and all other blogs and sites)</title><link>https://earlps.net/post/2026-03-07-how-to-get-update-notifications-from-this-blog-and-all-other-blogs-and-sites/</link><pubDate>Sat, 07 Mar 2026 08:05:00 +0800</pubDate><guid>https://earlps.net/post/2026-03-07-how-to-get-update-notifications-from-this-blog-and-all-other-blogs-and-sites/</guid><description>To get notified of new posts in this blog, an RSS feed reader is required. It&amp;rsquo;s a software that scans the blog&amp;rsquo;s RSS feed from time to time and notifies the user for new posts.
As an example, mobile users can install the app inoreader. Inside the app, add the link to my blog&amp;rsquo;s feed: https://earlps.net/index.xml The RSS reader is not limited to one site, it can subscribe to other blogs, news sites, and most sites that continuously get updates.</description><content:encoded><![CDATA[<p>To get notified of new posts in this blog, an RSS feed reader is required. It&rsquo;s a software that scans the blog&rsquo;s RSS feed from time to time and notifies the user for new posts.</p>
<p>As an example, mobile users can install the app <code>inoreader</code>. Inside the app, add the link to my blog&rsquo;s feed: <a href="https://earlps.net/index.xml">https://earlps.net/index.xml</a>


  

</p>
<p>The RSS reader is not limited to one site, it can subscribe to other blogs, news sites, and most sites that continuously get updates. Checkout this RSS feed compilation for more: <a href="https://github.com/plenaryapp/awesome-rss-feeds">awesome-rss-feeds</a>


  

.</p>
]]></content:encoded></item><item><title>Decisions point toward things that are easy to flex</title><link>https://earlps.net/shorts/2025-05-16-decisions-point-toward-things-that-are-easy-to-flex/</link><pubDate>Fri, 16 May 2025 14:08:00 +0800</pubDate><guid>https://earlps.net/shorts/2025-05-16-decisions-point-toward-things-that-are-easy-to-flex/</guid><description>People are travelling a lot nowadays, it&amp;rsquo;s starting to feel like a FOMO pyramid scheme. My social media feed as a GenZ is filled with it but information about building wealth is a rare occurence.</description><content:encoded>&lt;p>People are travelling a lot nowadays, it&amp;rsquo;s starting to feel like a FOMO pyramid scheme. My social media feed as a GenZ is filled with it but information about building wealth is a rare occurence.&lt;/p></content:encoded></item><item><title>Scraping Facebook to scratch an itch</title><link>https://earlps.net/post/2024-10-21-scraping-facebook-to-scratch-an-itch/</link><pubDate>Mon, 21 Oct 2024 16:02:00 +0800</pubDate><guid>https://earlps.net/post/2024-10-21-scraping-facebook-to-scratch-an-itch/</guid><description>I made a website that scrapes the posts of local Facebook pages.
I did this because I&amp;rsquo;m forced to open Facebook when checking for local news. I published a rant about this.
I&amp;rsquo;m currently collecting posts of 4 specific pages but I&amp;rsquo;m planning to add more. The pages I&amp;rsquo;ve added are the ones I almost always look which is limited to my region. I plan to include pages relevant in the other regions of the Philippines so I&amp;rsquo;ve added a link to a Google Form for suggesting new pages to add.</description><content:encoded><![CDATA[<p>I made a website that scrapes the posts of local Facebook pages.</p>
<p>I did this because I&rsquo;m forced to open Facebook when checking for local news. I published a <a href="https://earlps.net/post/2024-09-29-facebook/">rant</a>


  

 about this.</p>
<p>I&rsquo;m currently collecting posts of 4 specific pages but I&rsquo;m planning to add more. The pages I&rsquo;ve added are the ones I almost always look which is limited to my region. I plan to include pages relevant in the other regions of the Philippines so I&rsquo;ve added a link to a Google Form for suggesting new pages to add.</p>
<p>I&rsquo;m strictly limiting this to the Philippines but if you&rsquo;re interested in hosting the same service locally, it&rsquo;s very easy to do, and I&rsquo;ve set up the code to be easy to modify.</p>
<p>The backend code is in Django, frontend in Vue options, and PicoCSS. It&rsquo;s very simple. Check it out: <a href="https://filinfo.earlps.net">filinfo.earlps.net</a>


  

</p>
<p>Screenshot:</p>
<p><img src="/post/2024-10-21-scraping-facebook-to-scratch-an-itch//img/filinfo.png" title="Website screenshot of the project"></p>
]]></content:encoded></item><item><title>Learning Linux? Try not to reformat.</title><link>https://earlps.net/post/2024-10-12-learning-linux-try-not-to-reformat/</link><pubDate>Sat, 12 Oct 2024 20:11:00 +0800</pubDate><guid>https://earlps.net/post/2024-10-12-learning-linux-try-not-to-reformat/</guid><description>When I was learning Linux, if something went horribly wrong when I&amp;rsquo;m configuring something, my instinct was to reformat.
You can reformat but don&amp;rsquo;t depend on it every time. Try to debug or fix the issue you have. If you can&amp;rsquo;t fix it, you can learn what caused the issue and then reformat. That way, you learn more and not repeat the same mistake.
I&amp;rsquo;ve reformatted multiple times and at one point I just got familiar with enough things that I was able to maintain the OS and fix issues every time.</description><content:encoded><![CDATA[<p>When I was learning Linux, if something went horribly wrong when I&rsquo;m configuring something, my instinct was to reformat.</p>
<p>You can reformat but don&rsquo;t depend on it every time. Try to debug or fix the issue you have. If you can&rsquo;t fix it, you can learn what caused the issue and then reformat. That way, you learn more and not repeat the same mistake.</p>
<p>I&rsquo;ve reformatted multiple times and at one point I just got familiar with enough things that I was able to maintain the OS and fix issues every time.</p>
]]></content:encoded></item><item><title>mutlithreading bug</title><link>https://earlps.net/shorts/2024-10-04-mutlithreading-bug/</link><pubDate>Fri, 04 Oct 2024 10:00:00 +0800</pubDate><guid>https://earlps.net/shorts/2024-10-04-mutlithreading-bug/</guid><description/><content:encoded><![CDATA[<p><img src="/shorts/2024-10-04-mutlithreading-bug//img/threadmultibug.png" alt="&amp;gt; This is the worst multithrading bug of my life \n &amp;gt; so far The worst of your life threading multibug" title="How it feels to convert a single-threaded function into a multithreaded one"></p>
]]></content:encoded></item><item><title>Programming tip</title><link>https://earlps.net/shorts/2024-10-02-programming-tip/</link><pubDate>Wed, 02 Oct 2024 09:00:00 +0800</pubDate><guid>https://earlps.net/shorts/2024-10-02-programming-tip/</guid><description>Programming tip: differentiate indexes and counts in code. Index starts at 0, count starts at 1. Count is also equal to array length. In python, one can do this
1for count, fruit in enumrate(fruits, start=1): This has saved me a lot of confusion.</description><content:encoded><![CDATA[<p>Programming tip: differentiate indexes and counts in code.
Index starts at 0, count starts at 1.
Count is also equal to array length.
In python, one can do this</p>


<pre><code><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1</span><span><span style="color:#66d9ef">for</span> count, fruit <span style="color:#f92672">in</span> enumrate(fruits, start<span style="color:#f92672">=</span><span style="color:#ae81ff">1</span>):</span></span></code></pre>
<p>This has saved me a lot of confusion.</p>
]]></content:encoded></item><item><title>TIL: `tac` command</title><link>https://earlps.net/shorts/2024-09-30-til-tac-command/</link><pubDate>Mon, 30 Sep 2024 09:20:00 +0800</pubDate><guid>https://earlps.net/shorts/2024-09-30-til-tac-command/</guid><description>tac is like cat but the output is reversed.
I used it for finding the most recent error log:
tac err.log | grep -m 1 ERROR source</description><content:encoded><![CDATA[<p><code>tac</code> is like <code>cat</code> but the output is reversed.</p>
<p>I used it for finding the most recent error log:</p>


<pre><code><pre tabindex="0"><code>
tac err.log | grep -m 1 ERROR</code></pre></code></pre>
<p><a href="https://www.unix.com/shell-programming-and-scripting/140254-grep-only-last-occurred-error-error-log.html">source</a>


  

</p>
]]></content:encoded></item><item><title>The Philippines can't survive without Facebook</title><link>https://earlps.net/post/2024-09-29-facebook/</link><pubDate>Sun, 29 Sep 2024 20:35:00 +0800</pubDate><guid>https://earlps.net/post/2024-09-29-facebook/</guid><description>Note: this is an unorganized, low-effort rant of how I feel about Facebook and how the Philippines&amp;rsquo; depends too much on it.
Public Information Office # In the Philippines, updates for most cities will come from the city&amp;rsquo;s own &amp;ldquo;Public Information Office&amp;rdquo; which posts updates on their Facebook page. They do not have their own website. Sometimes I open Facebook on my phone with the intent to catch up on information but when the site loads, my attention is immediately drawn towards the news feed.</description><content:encoded><![CDATA[<p>Note: this is an unorganized, low-effort rant of how I feel about Facebook and how the Philippines&rsquo; depends too much on it.</p>
<h2 id="public-information-office">
  Public Information Office
  <a href="#public-information-office" class="article-heading-anchor">#</a>
</h2>
<p>In the Philippines, updates for most cities will come from the city&rsquo;s own &ldquo;Public Information Office&rdquo; which posts updates on their Facebook page. They do not have their own website. Sometimes I open Facebook on my phone with the intent to catch up on information but when the site loads, my attention is immediately drawn towards the news feed. I end up scrolling for 5-15 minutes, sometimes causing me to forget why I even opened the site.</p>
<h2 id="crucial-information--fb-algorithm--dangerous">
  Crucial information + FB algorithm = dangerous
  <a href="#crucial-information--fb-algorithm--dangerous" class="article-heading-anchor">#</a>
</h2>
<p>Facebook is not a news platform but because it tends to be the fastest way to see updates, it kind of feels like one. Sometimes it is the only way to know about local information. Unless an incident near you is reported by big organizations, it will probably only be on Facebook.</p>
<p>The problem is, Facebook has to filter all this information and put it behind an algorithm that is a black box.</p>
<p>One cannot be certain that Facebook will prioritize showing a crucial weather update rather than a really funny meme, a shocking revelation about a celebrity, or a new product. It probably depends on which ones get the most reactions.</p>
<p>For example, sometimes I feel like people don&rsquo;t realize how dangerous an upcoming typhoon is because Facebook doesn&rsquo;t seem to amplify this sentiment enough. If only it knew how to emphasize how dangerous the typhoon could be, more people can be prepared. But instead, you see one post about an upcoming typhoon, scroll past it, see a new meme/product/scandal, and you forget about it.</p>
<h2 id="messaging">
  Messaging
  <a href="#messaging" class="article-heading-anchor">#</a>
</h2>
<p>Everyone uses Facebook Messenger to communicate in the Philippines. Unsurprisingly, it requires a Facebook account to use. So, if you need to abandon Facebook, you&rsquo;ll have to also disconnect from your relatives and friends. SMS messaging doesn&rsquo;t work because it is expensive.</p>
<p>Facebook Messenger is also used as a workplace messaging application. I know some who work on enterprises owned by Filipinos and they mostly communicate using Messenger.</p>
<h2 id="cost">
  Cost
  <a href="#cost" class="article-heading-anchor">#</a>
</h2>
<p>It is literally FREE to use Facebook in the Philippines.</p>
<p>Since 2010, mobile carriers have enabled access to Facebook and its services for free. It allowed us to view a <a href="https://en.wikipedia.org/wiki/Facebook_Zero">simplified version of our Facebook news feeds</a>


  

 and send messages for free. No payment or data plan required. The only limitation is that you will not be able to see images. This strategy worked really well, as evidenced by how much we currently depend on this private service that is Facebook.</p>
<p>At the time it was really difficult to switch to other platforms because they require mobile data and data plans are expensive. Meanwhile, Facebook is free.</p>
<p>It feels like the presence of Facebook denied Filipinos of hand-crafted websites.</p>
<p>I truly hope that by writing this, more people talk about this issue. I really encourage the government to start its own website for centralized information distribution.</p>
<h2 id="how-to-help">
  How to help
  <a href="#how-to-help" class="article-heading-anchor">#</a>
</h2>
<h3 id="if-youre-a-programmer">
  If you&rsquo;re a programmer
  <a href="#if-youre-a-programmer" class="article-heading-anchor">#</a>
</h3>
<ul>
<li>If you&rsquo;re looking to make web projects for your portfolio, try looking for non-profit organizations in your community and ask them if they want a website and collaborate with them. Deploy it for free on Github pages.</li>
<li>Ask friends and family who have businesses, if they want a website</li>
</ul>
<h3 id="if-youre-a-business-owner">
  If you&rsquo;re a business owner
  <a href="#if-youre-a-business-owner" class="article-heading-anchor">#</a>
</h3>
<ul>
<li>You can make your own website using Wordpress for free.</li>
<li>If possible, hire an IT or CS student or a newly-grad to create a simple website.</li>
</ul>
<p>Update (Oct 22, 2024): I have created a website for scraping FB pages of local news: <a href="https://earlps.net/post/2024-10-21-scraping-facebook-to-scratch-an-itch/">Scraping Facebook to scratch an itch</a>


  

.</p>
<p>Update (Oct 24, 2024):</p>
<p><img src="/post/2024-09-29-facebook//img/fb-amnesty-intl.png"></p>
]]></content:encoded></item><item><title>Applying design principles to my website - visual hierarchy</title><link>https://earlps.net/post/2024-09-28-blog-visual-hierarchy/</link><pubDate>Sat, 28 Sep 2024 22:58:00 +0800</pubDate><guid>https://earlps.net/post/2024-09-28-blog-visual-hierarchy/</guid><description>I realized that my website&amp;rsquo;s article view looks weird. Here&amp;rsquo;s the screenshot:
There are a few things that can be improved here but I recently realized how important visual hierarchy is to a design.
The problem here is, there&amp;rsquo;s no one element that particularly stands out when the page is viewed. The user will either look at the logo or the title. This is a bit weird as we always want to point the user to where we want them to look - that&amp;rsquo;s the job of the design.</description><content:encoded><![CDATA[<p>I realized that my website&rsquo;s article view looks weird. Here&rsquo;s the screenshot:</p>
<p><img src="/post/2024-09-28-blog-visual-hierarchy//img/blog-visual-revamp-before.png"></p>
<p>There are a few things that can be improved here but I recently realized how important visual hierarchy is to a design.</p>
<p>The problem here is, there&rsquo;s no one element that particularly stands out when the page is viewed. The user will either look at the logo or the title. This is a bit weird as we always want to point the user to where we want them to look - that&rsquo;s the job of the design.</p>
<p>The first step was to decide which element I want the user to look at upon opening the page. I decided that the title is the one they should be looking at.</p>
<p>So the next step is to make the title stand out. How? By adding contrast.</p>
<p>Currently the contrast between the size of the site&rsquo;s name and the title is too narrow. The contrast can be expanded by making the two elements different enough.</p>
<p>Here&rsquo;s the final output:</p>
<p><img src="/post/2024-09-28-blog-visual-hierarchy//img/blog-visual-revamp-after.png"></p>
<p>There are a lot of changes here but the ones notable for improving visual hierarchy is:</p>
<ol>
<li>Smaller site badge size - this shaves off the emphasis to the site badge which makes the title more noticeable.</li>
<li>Change in the size of the title&rsquo;s font size - the bigger font size increased the title&rsquo;s contrast against its surrounding elements.</li>
<li>A new font of the title - I chose a font that looks a bit thicker than the previous one. It is a semi-condensed font in semi-bold style. I felt like the condensed design of the font improved its contrast versus the previous font.</li>
</ol>
<p>That&rsquo;s it. I&rsquo;ve removed the weirdness of the design by adding more contrast to elements and helping the user&rsquo;s eye to focus on one element.</p>
]]></content:encoded></item><item><title>Important advice from simonwillison</title><link>https://earlps.net/shorts/2024-09-15-/</link><pubDate>Sun, 15 Sep 2024 09:54:00 +0800</pubDate><guid>https://earlps.net/shorts/2024-09-15-/</guid><description> This is the most important tip: avoid side projects with user accounts.
If you build something that people can sign into, that’s not a side-project, it’s an unpaid job. It’s a very big responsibility, avoid at all costs!
Taken from Coping strategies for the serial project hoarder</description><content:encoded><![CDATA[<blockquote>
<p>This is the most important tip: avoid side projects with user accounts.</p>
<blockquote>
</blockquote>
<p>If you build something that people can sign into, that’s not a side-project, it’s an unpaid job. It’s a very big responsibility, avoid at all costs!</p>
</blockquote>
<p>Taken from <a href="https://simonwillison.net/2022/Nov/26/productivity/">Coping strategies for the serial project hoarder</a>


  

</p>
]]></content:encoded></item><item><title>Tracking my expenses using CSV</title><link>https://earlps.net/post/2024-09-14-tracking-expenses/</link><pubDate>Sat, 14 Sep 2024 22:02:00 +0800</pubDate><guid>https://earlps.net/post/2024-09-14-tracking-expenses/</guid><description>I woke up one day and realized that I need to be more responsible financially. I wanted to start by tracking my expenses.
Tools # I started by sticking to my usual tools, Markor on Android, Synthing and a CSV file expenses.csv.
I can say it works really well. Entering expenses is quick on mobile, maybe because I&amp;rsquo;m used to working with CSV. The UX is mostly just the keyboard and the comma character.</description><content:encoded><![CDATA[<p>I woke up one day and realized that I need to be more responsible financially. I wanted to start by tracking my expenses.</p>
<h2 id="tools">
  Tools
  <a href="#tools" class="article-heading-anchor">#</a>
</h2>
<p>I started by sticking to my usual tools, Markor on Android, Synthing and a CSV file <code>expenses.csv</code>.</p>
<p>I can say it works really well. Entering expenses is quick on mobile, maybe because I&rsquo;m used to working with CSV. The UX is mostly just the keyboard and the comma character.</p>
<p>You&rsquo;re probably asking, why not use any other financial application out there?</p>
<p>Simple, I want to keep my tools simple. My current &ldquo;ecosystem&rdquo; already works pretty well. Adding another application probably means that it will not fit right in with the tools I use, which means I&rsquo;ll have to adjust things again.</p>
<p>Why not a spreadsheet?</p>
<p>I&rsquo;ve tried that, and on mobile, the UX is too clunky. I need to be able to add items while I&rsquo;m out buying stuff.</p>
<p>And most importantly, I just like creating my own applications.</p>
<h3 id="structure-of-the-csv-file">
  Structure of the CSV File
  <a href="#structure-of-the-csv-file" class="article-heading-anchor">#</a>
</h3>
<p>The file is structured like this:</p>


<pre><code><pre tabindex="0"><code>DATE, ITEM, QUANTITY, PRICE, TOTAL, CATEGORY</code></pre></code></pre>
<p>If <code>DATE</code> is empty in a row, the date of the previous row will be used. This makes it easier to add rows when I&rsquo;m outside.</p>
<h2 id="a-simple-no-build-dashboard-using-vue-and-picocss">
  A simple, no build dashboard using Vue and PicoCSS
  <a href="#a-simple-no-build-dashboard-using-vue-and-picocss" class="article-heading-anchor">#</a>
</h2>
<p>After a month of doing this, I realized I need a tool to analyze my expenses. I started with a command line Python script
but I later realized a webpage would allow me to analyze my expenses on any device.</p>
<h3 id="why-vue">
  Why Vue
  <a href="#why-vue" class="article-heading-anchor">#</a>
</h3>
<p>I&rsquo;ve been using Vue with the options API at work. I think it&rsquo;s really good and I wanted to explore it a more. What&rsquo;s nice about it is the way logic is organized with options API. The complexity of the UI is more manageable this way. And that&rsquo;s without a build step needed.</p>
<h3 id="picocss">
  PicoCSS
  <a href="#picocss" class="article-heading-anchor">#</a>
</h3>
<p>I&rsquo;ve been using <a href="https://watercss.kognise.dev/">water.css</a>


  

 for my small projects but after hearing too many people talk about PicoCSS, I wanted to try it.</p>
<p>PicoCSS is small enough, like water.css but unlike water.css, it still gives the user some control. The dashboard is really just a collection of tables that works by using the <code>details</code> and <code>summary</code> elements.</p>
<p>I&rsquo;m curious if I&rsquo;ll still be using it months or years from now, but so far, I&rsquo;ve been loving this tool and I&rsquo;m looking to improve it with new features.</p>
<p>The dashboard is available here: <a href="https://earlps.net/expenses-cli/">earlps.net/expenses-cli</a>


  

</p>
<p>The repo: <a href="https://github.com/elpachongco/expenses-cli">github.com/elpachongco/expenses-cli</a>


  

</p>
<p><a href="https://github.com/elpachongco/expenses-cli"></a>


  

Screenshots (Sept 15, 2024):</p>
<p><img src="/post/2024-09-14-tracking-expenses//img/expenses-cli-desktop.png" alt="Desktop screenshot of the dashboard"></p>
<p><a href="https://github.com/elpachongco/expenses-cli"></a>


</p>
<p><img src="/post/2024-09-14-tracking-expenses//img/expenses-cli-mobile.png" alt="Mobile screenshot of the dashboard"></p>
]]></content:encoded></item><item><title>Process</title><link>https://earlps.net/post/2024-06-15-process/</link><pubDate>Sat, 15 Jun 2024 21:32:00 +0800</pubDate><guid>https://earlps.net/post/2024-06-15-process/</guid><description>I&amp;rsquo;ve been developing applications for around 3 years now. Mostly just for fun, and for my personal use. But now, with a new job, I have to work with a team.
In this job, I noticed myself making a lot of small mistakes repeatedly: Forgetting to push commits before asking for code review, forgetting to set a variable to False before pushing, or outright forgetting to test before pushing.
A kind coworker, understandably, probably got tired of me making these small mistakes and offered help.</description><content:encoded><![CDATA[<p>I&rsquo;ve been developing applications for around 3 years now. Mostly just for fun, and for my personal use. But now, with a new job, I have to work with a team.</p>
<p>In this job, I noticed myself making a lot of small mistakes repeatedly: Forgetting to push commits before asking for code review, forgetting to set a variable to False before pushing, or outright forgetting to test before pushing.</p>
<p>A kind coworker, understandably, probably got tired of me making these small mistakes and offered help. We did a one-on-one chat, and he asked some questions. It basically felt like being debugged.</p>
<p><img src="/post/2024-06-15-process//img/human-debugging-human.jpg" alt="stick figure man standing beside human lying in the bed with a &amp;lsquo;bug&amp;rsquo; coming out." title="Human debugging human"></p>
<p>The most important part of our conversation was when he asked me to outline what I do when I work, from start to finish. So I thought it through, outlined my rough steps when working, and came up with the steps on the fly by thinking of what I always do.</p>
<p>Why am I telling this? Because he asked me exactly if I just came up with it from memory. I did, and that&rsquo;s the problem. I was only relying on memory - which is unpredictable (well, it&rsquo;s probably predictable by how much sleep I had).</p>
<p>From my outline he mentioned things that I missed and gave me an example. We wrote it down, and turned the steps into checklist items. This file is now known as &lsquo;workflow.md&rsquo;. It contains a simple checklist of the ideal process:</p>


<pre><code><pre tabindex="0"><code>- [ ] When starting a task, create a Trello card.
- [ ] After creation of a card, create a Slack thread.
- [ ] Ask questions/gather data:
  - [ ] How often will this be used?
  - [ ] How many users will use this feature?
 ...
 - [ ] After working on a task, list all features added
 - [ ] Test all the features
 - [ ] List all existing features that are affected of the changes
 - [ ] Test them as well
 - [ ] If a test fails, revise code
   - [ ] Test feature again after revising
 - [ ] If all tests succeed, review the code
 - [ ] Ask questions
   - [ ] Are the variables named properly
   - [ ] Are the comments formatted according to standard
   </code></pre></code></pre>
<p>When I start a new task, I copy this file to /tmp/ and go through the items one by one. By following a document, and not relying on memory or instinct, mistakes are lessened.</p>
<p>But the best part is that this file can be enhanced. Whenever we make a mistake, we ask ourselves, is this a mistake that could have been prevented by a better process? If yes, we revise the workflow file.</p>
<p>For example, a task I worked on nearly required a redo because there&rsquo;s a step I missed. I forgot about it and it&rsquo;s not in the workflow file. So I added it to the file. By doing this we&rsquo;re reducing the amount of small issues that could easily be prevented by not relying on memory alone.</p>
<p>If you&rsquo;re going to build a workflow/process file, here&rsquo;s a tip:</p>
<ul>
<li>Consider previous mistakes and add a check for what caused the mistake.</li>
</ul>
<p>Some examples:</p>
<ul>
<li>If you&rsquo;re forgetful or careless, like me, then add a double check to your process.</li>
<li>If you tend to over engineer stuff, then add a part where you gather data (i.e. ask questions) and define requirements before working on a task.</li>
</ul>
<p>Having a defined process improves efficiency. It&rsquo;s much better than relying on memory alone because it can easily be replicated, improved and reviewed. It&rsquo;s not a solution for everyone or every scenario but I think it&rsquo;s worth trying out.</p>
]]></content:encoded></item><item><title>Reply demo</title><link>https://earlps.net/shorts/2024-06-15-reply-demo/</link><pubDate>Sat, 15 Jun 2024 18:55:00 +0800</pubDate><guid>https://earlps.net/shorts/2024-06-15-reply-demo/</guid><description>replying to blog.bhread.com/how-to-comment Hey it works! 🙂</description><content:encoded><![CDATA[<p>replying to <a href="https://blog.bhread.com/posts/how-to-comment/">blog.bhread.com/how-to-comment</a>


  

</p>
<p>Hey it works! 🙂</p>
]]></content:encoded></item><item><title>Blog redesign complete!</title><link>https://earlps.net/shorts/2024-06-02-blog-redesign-complete/</link><pubDate>Sun, 02 Jun 2024 21:23:00 +0800</pubDate><guid>https://earlps.net/shorts/2024-06-02-blog-redesign-complete/</guid><description>Just finished the redesign of the blog. It&amp;rsquo;s missing a lot of features (no dark mode) but I&amp;rsquo;m really itching to get this out. Here&amp;rsquo;s a comparison before and after image:</description><content:encoded><![CDATA[<p>Just finished the redesign of the blog. It&rsquo;s missing a lot of features (no dark mode) but I&rsquo;m really itching to get this out. Here&rsquo;s a comparison before and after image:</p>
<p><img src="/shorts/2024-06-02-blog-redesign-complete//img/redesign-vs-old-blog.png" alt="Before vs After of the blog redesign" title="Before vs After of blog redesign"></p>
]]></content:encoded></item><item><title>Blog redesign checklist</title><link>https://earlps.net/post/2023-11-12-blog-redesign-checklist/</link><pubDate>Sun, 12 Nov 2023 16:34:54 +0000</pubDate><guid>https://earlps.net/post/2023-11-12-blog-redesign-checklist/</guid><description>I recently posted this: New plans for the blog To summarize, I&amp;rsquo;ll be redesigning this blog.
In this article, I&amp;rsquo;ll list the things that I want my blog to have.
Must haves # User-clickable anchors for each post&amp;rsquo;s headers (h1,h2,h3,h4,h5,h6) If possible, must highlight if scrolled or by clicking table of contents. Dark mode Table of contents for each post Must be visible while scrolling. If possible, should also highlight current section.</description><content:encoded><![CDATA[<p>I recently posted this: <a href="https://elpachongco.github.io/shorts/2023-11-12-new-plans-for-the-blog.htm">New plans for the blog</a>


  

</p>
<p>To summarize, I&rsquo;ll be redesigning this blog.</p>
<p>In this article, I&rsquo;ll list the things that I want my blog to have.</p>
<h2 id="must-haves">
  Must haves
  <a href="#must-haves" class="article-heading-anchor">#</a>
</h2>
<ul>
<li><input disabled="" type="checkbox"> User-clickable anchors for each post&rsquo;s headers (h1,h2,h3,h4,h5,h6)
<ul>
<li><input disabled="" type="checkbox"> If possible, must highlight if scrolled or by clicking table of contents.</li>
</ul>
</li>
<li><input disabled="" type="checkbox"> Dark mode</li>
<li><input disabled="" type="checkbox"> Table of contents for each post
<ul>
<li><input disabled="" type="checkbox"> Must be visible while scrolling. If possible, should also highlight current section.</li>
</ul>
</li>
<li><input disabled="" type="checkbox"> /shorts/ - of course</li>
<li><input disabled="" type="checkbox"> Last updated information</li>
<li><input disabled="" type="checkbox"> Retain StaticCMS. It&rsquo;s very convinient.</li>
<li><input disabled="" type="checkbox"> A <code>draft</code> indicator, Gwern-style. Since I&rsquo;ll be using the blog as my personal notes website, every change I make to it WILL be pushed, even drafts.</li>
<li><input disabled="" type="checkbox"> Code snippets must have a built-in header for filename.</li>
<li><input disabled="" type="checkbox"> Static site search (like papermod)</li>
<li><input disabled="" type="checkbox"> Captions for each image</li>
<li><input disabled="" type="checkbox"> Post thumbnails
<ul>
<li><input disabled="" type="checkbox"> Get a post&rsquo;s first image file and use as thumbnail</li>
<li><input disabled="" type="checkbox"> If not present, use a default thumbnail</li>
<li><input disabled="" type="checkbox"> Allow setting custom thumbnail in frontmatter/settings</li>
</ul>
</li>
</ul>
<h2 id="optional">
  Optional
  <a href="#optional" class="article-heading-anchor">#</a>
</h2>
<ul>
<li><input disabled="" type="checkbox"> A way to manage and view history of updates of an article (since it&rsquo;s managed in git). E.g. arrow buttons to navigate history of the article.</li>
<li><input disabled="" type="checkbox"> Comment section. (Discuss? Bhread?)</li>
</ul>
]]></content:encoded></item><item><title>New plans for the blog</title><link>https://earlps.net/shorts/2023-11-12-new-plans-for-the-blog/</link><pubDate>Sun, 12 Nov 2023 11:38:35 +0800</pubDate><guid>https://earlps.net/shorts/2023-11-12-new-plans-for-the-blog/</guid><description>I recently saw Gwern&amp;rsquo;s blog . The design and content are great. I want my blog to be like this — a page in the internet that has its own personality and feels crafted. Currently, It&amp;rsquo;s just a dump of my thoughts and it&amp;rsquo;s using the default Jekyll theme. Though I like the look of it, I want to add more quality of life features to it while keeping it static.</description><content:encoded><![CDATA[<p>I recently saw <a href="https://gwern.net/">Gwern&rsquo;s blog</a>


  

. The design and content are great. I want my blog to be like this — a page in the internet that has its own personality and feels <em>crafted</em>. Currently, It&rsquo;s just a dump of my thoughts and it&rsquo;s using the default Jekyll theme. Though I like the look of it, I want to add more quality of life features to it while keeping it static.</p>
]]></content:encoded></item><item><title>I should have used the debugger</title><link>https://earlps.net/post/2023-11-11-i-should-have-used-the-debugger/</link><pubDate>Sat, 11 Nov 2023 23:35:37 +0000</pubDate><guid>https://earlps.net/post/2023-11-11-i-should-have-used-the-debugger/</guid><description>A week ago I was implementing a dynamic logo in a website which would change if the navbar has a dark background and change back if it&amp;rsquo;s light.
My approach was to add two &amp;lt;img&amp;gt; tags, overlapping each other and toggling the front element (greater z-index) when the conditions are right.
Seems good right?
Well, It worked as expected but after some testing, I noticed something: scrolling up would lag the browser on my 4-core i7 8550u 16gb memory machine.</description><content:encoded><![CDATA[<p>A week ago I was implementing a dynamic logo in a website which would change if the navbar has a dark background and change back if it&rsquo;s light.</p>
<p>My approach was to add two <code>&lt;img&gt;</code> tags, overlapping each other and toggling the front element (greater z-index) when the conditions are right.</p>
<p>Seems good right?</p>
<p>Well, It worked as expected but after some testing, I noticed something: scrolling up would lag the browser on my 4-core i7 8550u 16gb memory machine. It&rsquo;s probably half a second of the browser refusing to do anything before allowing me to scroll up.</p>
<p>Of course I immediately assumed it was the logo. Because previously, the site used plain text as its only branding.</p>
<p>I immediately thought that the CSS may be causing a <a href="[https://developer.mozilla.org/en-US/docs/Glossary/Reflow]%28https://developer.mozilla.org/en-US/docs/Glossary/Reflow%29">DOM reflow</a>


  

. So I changed the logo toggle logic to use opacity, instead of <code>display: none</code>. My thinking was that it could be triggering the browser to re-validate the DOM tree every time the element is removed. I tested this, but the lag is still present with no noticeable change.</p>
<p>Next, I searched for ideas. The one that stood out was that maybe my selectors are too complex for this. This gave me an idea.</p>
<p>The implementation for the logo toggling depended on a single class that is added everytime the background changes. This behavior is handled by jquery.</p>
<p>My idea was to move the toggle from CSS to the jquery.</p>
<p>I spent some time with that and then tested it. Still no change. At this point, I&rsquo;m out of ideas.</p>
<p>I called it a day maybe I just need to rest.</p>
<p>The next day, I had an idea: why not debug this with the devtools?</p>
<p>I&rsquo;ve never used the more complicated tools because honestly, flame graphs intimidate me.</p>
<p>Hoping to finally fix the bug, I used the performance tab and recorded a sample interaction where I scroll up and then stop the recording. The timeline shows an interesting data: when I scroll up, a task happens. This task takes a good 460ms to finish. The task is <code>Image Decode</code>.</p>
<p>That&rsquo;s when I realized what was really happening. It&rsquo;s doing some processing on the logo because the file I used was a PNG file. I rushed to a random svg download site and downloaded two random SVGs, replaced the image sources, and tested. I was right, the lag is gone.</p>
<p>What&rsquo;s the takeaway from this?</p>
<p>Reach for the most effective tool you have before doing trial-and-error. Often times, it&rsquo;s easy to resort to trial-and-error approach when debugging. But knowing how long a debugging task is going to take you is a skill you should master. if you think it&rsquo;s going to take a long time, use the tool for the job. Use the debugger.</p>
<p>More importantly, keeping track of the <a href="https://alan.norbauer.com/articles/browser-debugging-tricks">tools available to you</a>


  

 and being WILLING to use them when appropriate is a good habit to have. Expect yourself to resist using a debugger because it&rsquo;s usually not as quick to do as trial-end-error.</p>
]]></content:encoded></item><item><title>Posting to a group</title><link>https://earlps.net/shorts/2023-10-25-group-reply/</link><pubDate>Wed, 25 Oct 2023 13:55:13 +0000</pubDate><guid>https://earlps.net/shorts/2023-10-25-group-reply/</guid><description>replying to bhread/tech Hello There!</description><content:encoded><![CDATA[<p>replying to <a href="http://localhost:4000/shorts/2023-10-25-group-test.html">bhread/tech</a>


  

</p>
<p>Hello There!</p>
]]></content:encoded></item><item><title>I posted a project on HN that got some (~&lt;10) attention</title><link>https://earlps.net/shorts/2023-10-16-i-posted-a-project-on-hn-that-got-some-~-10-attention/</link><pubDate>Mon, 16 Oct 2023 22:25:39 +0800</pubDate><guid>https://earlps.net/shorts/2023-10-16-i-posted-a-project-on-hn-that-got-some-~-10-attention/</guid><description>Context .</description><content:encoded><![CDATA[<p><img src="/shorts/2023-10-16-i-posted-a-project-on-hn-that-got-some-~-10-attention//img/meme.png" alt="meme">
<a href="https://news.ycombinator.com/item?id=37897859">Context</a>


  

.</p>
]]></content:encoded></item><item><title>Things I Use</title><link>https://earlps.net/uses/</link><pubDate>Fri, 06 Oct 2023 23:12:50 +0000</pubDate><guid>https://earlps.net/uses/</guid><description>I&amp;rsquo;m used to being frugal. Because of that, most of my equipment and tool decisions are focused on being economical. Most of my hardware is second hand. I rarely pay for software.
The Phone - LG V20 # A highly-repairable phone with good camera hardware and software.
It&amp;rsquo;s already 2023. LG has left the smartphone market, and this phone was released in 2016.
I love this phone, it&amp;rsquo;s just good quality hardware.</description><content:encoded><![CDATA[<p>I&rsquo;m used to being frugal. Because of that, most of my equipment and tool
decisions are focused on being economical. Most of my hardware is second hand.
I rarely pay for software.</p>
<h2 id="the-phone---lg-v20">
  The Phone - LG V20
  <a href="#the-phone---lg-v20" class="article-heading-anchor">#</a>
</h2>
<p>A highly-repairable phone with good camera hardware and software.</p>
<p>It&rsquo;s already 2023. LG has left the smartphone market, and this phone was
released in 2016.</p>
<p>I love this phone, it&rsquo;s just good quality hardware. Only problem is its size &ndash;
It&rsquo;s too big for one hand operations. I prefer smaller phones because I don&rsquo;t
play a lot of games and I won&rsquo;t benefit from the extra screen space since I only
use it for communication and when I&rsquo;m stuck outside the house waiting for a
jeepney.</p>
<p>Most of my phones are second-hand phones. This means that I don&rsquo;t have much
control on which ones I can get. What I&rsquo;ve noticed is that they&rsquo;re almost
always too big. My theory is that smaller phones are not as popular, possibly
break easier (battery?), is not as repairable as the bigger phones or their
owners just like them so much that not a lot of them end up in the second hand
market.</p>
<p>Being in the Philippines, I have access to Chinese sellers overseas selling
second-hand hardware. I bought my second hand LG phone last 2022 for 60USD
(second hand + not a popular brand in the PH). This phone superseded my trusty
Exynos Samsung Note 4 (its micro-USB port has worn down. In my little
experience, I think USB type-C is the more robust connector).</p>
<p>I came across this phone in a Youtube comment claiming that it&rsquo;s the &rsquo;newest'
phone with the earphone jack, IR blaster, easily replaceable battery. It&rsquo;s
true, the battery is replaceable, and the phone can be taken apart (and
assembled) very easily. See this <a href="https://www.youtube.com/watch?v=KNgSDmkn96c">teardown
video</a>


  

. (It&rsquo;s just 3 mins!).</p>
<p>Repairability is underrated today. I broke the camera glass cover last
month and it took me less than 10 minutes to replace it. If the battery
degrades, I can replace it in less than a minute. I don&rsquo;t have a lot of money
or time so this phone works great for me.</p>
<p>The best thing about it is its Snapdragon processor. If you&rsquo;re not in the
android scene, the Snapdragon is the most popular CPU. Because of this, most
custom ROMs (Custom Android OS) is made for processors by Snapdragon. My
previous Note 4 sported an Exynos which was a bummer because I couldn&rsquo;t install
a custom ROM on it.</p>
<p>I&rsquo;m running a custom ROM in this phone that allows it to be upgradeable to
Android 9. In 2023, that&rsquo;s old but it works fine for me.</p>
<h3 id="software">
  software
  <a href="#software" class="article-heading-anchor">#</a>
</h3>
<ul>
<li>OS: Android 9 Custom ROM. Rooted.
<ul>
<li>Banking apps will usually not run on rooted phones but there are ways to
bypass that and I don&rsquo;t have any problems with using those. I have five
banking apps and they all work after toggling some settings.</li>
</ul>
</li>
<li>F-droid
<ul>
<li>Installed in every single phone I have. This is the first place I check
for apps.</li>
</ul>
</li>
<li>Terminal emulator
<ul>
<li>In case I need to do a quick network scan.</li>
</ul>
</li>
<li>Syncthing
<ul>
<li>I used Google Docs for everything because I need my files to be
accessible everywhere (cloud sync). It was reliable but Syncthing replaces
that functionality pretty well. At home, files from my laptop are synced to
the phone. At work, files from phone are synced to the work computer. When
I&rsquo;m outside, I can edit these files in my phone and it will sync to the
other devices. I sync my markdown files with it. It&rsquo;s truly a personal
cloud. I think it&rsquo;s the <em>correct</em> solution for me. I can&rsquo;t think of
anything that will be better than this.</li>
</ul>
</li>
<li>Markor
<ul>
<li>The reason I don&rsquo;t use google docs is because of Markor. It&rsquo;s a really
good markdown editor. That&rsquo;s it, I don&rsquo;t need to say anything. If you&rsquo;re
using Android, it&rsquo;s on F-droid. Though, I still have a Google Docs app in
my phone for work-related purposes.</li>
</ul>
</li>
<li>G-Cam
<ul>
<li>It&rsquo;s the camera app for Pixel phones but configured for other phones. The
software features are amazing. It takes great photos but controls are
limited compared to the stock app which has manual controls for almost
everything (LG proprietary app). This app is a basic camera that applies
advanced image processing compared to the stock app.</li>
</ul>
</li>
<li>Firefox for Android
<ul>
<li>The key to a good experience in Android.</li>
<li>uBlock Origin installed to block ads and make websites run faster, and
consume less bandwidth.</li>
<li>I watch Youtube a lot but I don&rsquo;t have their app. I use it in Firefox. No
ads, and plays in the background, even picture-in-picture mode. I used to
install YT Vanced for this. Not anymore.</li>
<li>Surprisingly, plenty of apps are usable in the browser (Upwork, Skype).
Though without the notifications (last I tried).</li>
</ul>
</li>
</ul>
<h2 id="the-computer---thinkpad-t480">
  The computer - Thinkpad T480
  <a href="#the-computer---thinkpad-t480" class="article-heading-anchor">#</a>
</h2>
<p>It&rsquo;s a typical machine I got it last 2021 for around 600USD. Second hand. What
I like about it is its repairability, its ruggedness (I&rsquo;m clumsy and careless),
and its popularity.</p>
<p>I also consider how popular something is when shopping for a device. This is
because it&rsquo;s more likely to be updated faster, the bugs will be documented and
resolved faster.</p>
<h3 id="hardware">
  Hardware
  <a href="#hardware" class="article-heading-anchor">#</a>
</h3>
<ul>
<li>16GB Ram</li>
<li>128GB SSD</li>
<li>i7 8550u</li>
<li>6-cell battery</li>
<li>I3 WM</li>
<li>USB Type C Magnetic charging</li>
<li>Bavin 65W PD GAN charger</li>
<li>This laptop has a metal lid. Most reviews online don&rsquo;t have this. I think it&rsquo;s the magnesium lid.</li>
</ul>
<h3 id="software-1">
  Software
  <a href="#software-1" class="article-heading-anchor">#</a>
</h3>
<p>For most of my tasks, Neovim is the first thing I reach for.</p>
<ul>
<li>Neovim
<ul>
<li>Treesitter</li>
<li>Packer package manager</li>
<li>Mason for managing LSP stuff</li>
<li>Telescope
<ul>
<li>I used to install a vscode like sidebar for nvim but I found
telescope and realize it&rsquo;s the better solution.</li>
</ul>
</li>
</ul>
</li>
<li>urxvt-d
<ul>
<li>I still use urxvt because it&rsquo;s the best terminal out there.</li>
<li>It&rsquo;s almost always available in the Debian repositories, it works on
almost any hardware. Even on an Intel atom with 2gb of ram, it&rsquo;s fast.</li>
<li>I run the daemon at startup (urvt-d) and call the client (urxvt) for
every terminal. It starts fast. Kitty is faster but it&rsquo;s not as light.</li>
</ul>
</li>
<li>IBM Plex Mono.
<ul>
<li>I love this font for coding.</li>
<li>I don&rsquo;t worry about double underscores (dunder, there&rsquo;s a lot of them in
python).</li>
<li>I just like the aesthetics of it.</li>
</ul>
</li>
<li>Google chrome and Firefox
<ul>
<li>I use anything depending on my mood.</li>
</ul>
</li>
<li>Vimium-C
<ul>
<li>I browse the web the vim way. I don&rsquo;t have the mouse with me most of the
time and it&rsquo;s definitely better than using the trackpad for the kind of
work I do</li>
</ul>
</li>
</ul>
<h2 id="software-stack">
  Software Stack
  <a href="#software-stack" class="article-heading-anchor">#</a>
</h2>
<p>I use Python and Javascript. Sometimes I dabble with Go just for its
concurrency features which I find fun to use.</p>
<p>To build full-stack apps I use:</p>
<ul>
<li>Django rest framework</li>
<li>React</li>
<li>Material-UI</li>
</ul>
<p>Although, right now I&rsquo;m moving to plain old Django templates, with HTMX,
Alpine, and Tailwind. It&rsquo;s a really ergonomic setup. I wrote a lot of JS in my
previous job so I think I got the JS fatigue. I&rsquo;m currently trying this out on
my project <a href="https://bhread.com">Bhread.com</a>


  

.</p>
<h2 id="work-setup">
  Work Setup
  <a href="#work-setup" class="article-heading-anchor">#</a>
</h2>
<p>I work on the dining table. Here&rsquo;s my setup:</p>
<p><img src="/uses//img/setup.jpg" alt="Home setup"></p>
<p>I put the laptop on top of the box so I can work standing up from time to time.</p>
<p>I&rsquo;m looking to improve this situation. Right now, the house is too small for
us, 40sqm (430 square foot) a family of 5.</p>
<p>I recently got hired so I&rsquo;d like to commit on building a house of our own.
We&rsquo;ve been renting for the past 8 years.</p>
<h2 id="bikes">
  Bikes
  <a href="#bikes" class="article-heading-anchor">#</a>
</h2>
<p>A folding bike and a folding e-bike. I use a bike for transportation even if
most people in the Philippines would get a motorcycle in my situation. Because
bikes or e-bikes don&rsquo;t need to be registered here and electricity and
maintenance of these are cheaper.</p>
<p>I&rsquo;m thankful that I don&rsquo;t have to take the time every year to stand up in a
long line to register yearly, and mess with legality because I have an e-bike.</p>
<p>I also used to pay 40USD (2,000 PHP) a month for the gym but because of the
bike, I didn&rsquo;t renew. Though I will probably register to a cheaper one again.</p>
<p>My parents have two motorcycles which are also reliable. It&rsquo;s the only
economical option if you&rsquo;re going to need to bring a kid to school everyday.
I think it could also work well for couples living together.</p>
<h2 id="clothing">
  Clothing
  <a href="#clothing" class="article-heading-anchor">#</a>
</h2>
<p>I live in a tropical climate. Most of the time it rains here every afternoon.
Because of this, I wear things that dry easily and that I don&rsquo;t mind getting
wet.</p>
<p>I treat the rain as though it&rsquo;s inevitable. You will get wet. Outside, I wear
shorts, sandals, and a nylon jacket but I bring my clothes with me to change
when I arrive at the destination. This way,  I can still walk and take the
public transportation (which I like doing because it&rsquo;s cheap and convenient
when it&rsquo;s not peak hours).</p>
<p>I also bring an umbrella and sometimes sunglasses. I feel much more comfortable
walking outside on a sunny day with sunglasses and an umbrella. The umbrella is
also helpful when it&rsquo;s raining so I always carry it.</p>
]]></content:encoded></item><item><title>Building a New Social Media Platform</title><link>https://earlps.net/post/2023-09-21-building-a-new-social-media-platform/</link><pubDate>Thu, 21 Sep 2023 22:18:32 +0000</pubDate><guid>https://earlps.net/post/2023-09-21-building-a-new-social-media-platform/</guid><description>I recently created a /shorts/ page in my blog . This page is intended for shorter content. It&amp;rsquo;s a place I can use to share memes, tips, and small stories.
My blog&amp;rsquo;s shorts page.
I liked the idea of this. I thought it&amp;rsquo;s a good way to use the blog as my own twitter of sorts.
And then I had an idea: If I encourage people to create a /shorts/ page on their blog, and I create a central hub for these pages, where they can interact, we basically have a new twitter!</description><content:encoded><![CDATA[<p>I recently created a <a href="https://elpachongco.github.io/shorts/">/shorts/ page in my blog</a>


  

. This page is intended for shorter content. It&rsquo;s a place I can use to share memes, tips, and small stories.</p>
<p><img src="/post/2023-09-21-building-a-new-social-media-platform//img/elpachongco-shorts.png"></p>
<blockquote>
<p>My blog&rsquo;s shorts page.</p>
</blockquote>
<p>I liked the idea of this. I thought it&rsquo;s a good way to use the blog as my own twitter of sorts.</p>
<p>And then I had an idea: If I encourage people to create a /shorts/ page on their blog, and I create a central hub for these pages, where they can interact, we basically have a new twitter!</p>
<p>And that&rsquo;s what I&rsquo;ve been doing since August.</p>
<p>I&rsquo;ve been building a website that will be a central hub for blogs. The website is called <a href="https://bhread.com">bhread.com</a>


  

. Yes, it&rsquo;s pronounced like bread.</p>
<p>For this project, I wanted to try building a full-fledged application in Django. I have some experience with django rest framework so I thought plain Django would be familliar. I was wrong. Templates are hell.</p>
<p>Anyway, I found out about htmx and I really wanted to try it. I also wanted to  try <a href="https://alpinejs.dev/">alpine.js</a>


  

 and tailwind. I&rsquo;m used to plain css because I haven&rsquo;t done any project that requires a lot of styling. I usually use a UI library.</p>
<h3 id="development">
  Development
  <a href="#development" class="article-heading-anchor">#</a>
</h3>
<p>So I got into developing this project. I started with planning the application, and then I wrote it.</p>
<p>The planning part wasn&rsquo;t thorough enough as I didn&rsquo;t know what is needed to aggregate blogs. I don&rsquo;t have an idea about parsing feeds. But I knew I should store urls of feeds and posts.</p>
<p>At first I was conflicted whether to require accounts for feed submissions.  But I went straight to programming anyway. I figured that I should just write a kind of exploratory project to just know enough to be able to iterate to a better version. I wrote an initial version as fast as possible. In the end, I went through three iterations of data models to finally determine the best design.</p>
<p>The code was very unorganized but it helped me determine the requirements.</p>
<p><img src="/post/2023-09-21-building-a-new-social-media-platform//img/bhread-initial-version.png"></p>
<blockquote>
<p>The initial bhread design. Thanks to water.css and material icons for its looks.</p>
</blockquote>
<p>I showed it to some friends and there was not a lot of reaction. It&rsquo;s to be expected for an early product but it made me realize that this UI will not work for everyone. I like it because I like reading. It&rsquo;s my job to read. Hacker News looks like a big wall of text to other people. This looks like a wall of text.</p>
<p>To start the new iteration, I removed a lot of the code, and made new plans. This time, the UI is inspired by twitter and elk.zone (a mastodon client).</p>
<p>I tried a few designs. At first, I designed with CSS but I got tired easily and thought I needed to design it properly first before programming.</p>
<p>I used figma to design some components and the experience is really good. I used to do these things in Illustrator and I&rsquo;m glad I tried out figma.</p>
<p><img src="/post/2023-09-21-building-a-new-social-media-platform//img/bhread-design-figma.png"></p>
<blockquote>
<p>Bhread&rsquo;s prototype components. These are the basis for the current website&rsquo;s designs. I abandoned some of the ideas here as they&rsquo;re too distracting and it consumed a lot of space in the user&rsquo;s screen.</p>
</blockquote>
<p>I discovered a youtube channel that&rsquo;s focused on recreating UI of famous sites. I watched his videos and I can highly recommend it. It&rsquo;s <a href="https://www.youtube.com/@DemystifyingDesign">Demistifying Design on Youtube</a>


  

. I learned a lot of UX concepts by watching the videos.</p>
<p>After deciding on the look of the website, it was time to implement.</p>
<p>This is the first complicated project where I&rsquo;m not using a UI library. CSS is too hard for me. I&rsquo;m using tailwind to develop this site and I like it. Sure, it&rsquo;s discouraging to open an html file and see really long lines of tailwind classes but it&rsquo;s easier to debug because the style is directly in the html element. My only problem is that the tooling with django is not fully developed. The prettier plugin for arranging tailwind classes does not work on django templates.</p>
<p>Playing with HTMX for a bit, I realized how easy it makes the backend-frontend integration. It&rsquo;s amazing. Like everybody else, I used to build a frontend app and a json API for my web applications. I&rsquo;m too tired of it. This is why I wanted to try HTMX. The only problem I see with using HTMX is if I want to create mobile apps for bhread, I will have to create a JSON API anyway.</p>
<p>I haven&rsquo;t used [<a href="Alpine.js">Alpine.js</a>


  

](Alpine.js) a lot as of now but I&rsquo;m so excited to use it. Once I get the layout sorted, I&rsquo;ll start scripting.</p>
<h3 id="deployment">
  Deployment
  <a href="#deployment" class="article-heading-anchor">#</a>
</h3>
<p>I usually use python-poetry for development but I decided to learn docker for this project. It&rsquo;s amazing. The code will still work with poetry but it&rsquo;s so much easier to use docker. I decided to deploy with docker as well and apart from the mistakes I made while learning docker and deploying a django project at the same time, it&rsquo;s working pretty well. With a single command, I can start postgresql, redis, nginx, and gunicorn. The project runs on a $6 digital ocean droplet. I don&rsquo;t know how it will handle a lot of traffic but that&rsquo;s a problem I&rsquo;m excited to have. Right now it&rsquo;s scary that it&rsquo;s using 800mb of ram on idle, with only me as the user. I&rsquo;m still looking into it.</p>
<h3 id="to-open-source-or-not">
  To open source or not?
  <a href="#to-open-source-or-not" class="article-heading-anchor">#</a>
</h3>
<p>Initially, I planned on open sourcing it after a year of development. I didn&rsquo;t want to reveal the idea to the public until I&rsquo;m sure it&rsquo;s ready. But I thought I should just get the site out there and build a community around it as early as possible.</p>
<p>One concern about open sourcing the project is monetization. I was scared that I might not be able to monetize it if I open source it. Sustainability is a big part of a project. I sure as hell won&rsquo;t be putting ads on it. It runs on a $6 machine, I can afford that. So that&rsquo;s not a problem right now.</p>
<p><img src="/post/2023-09-21-building-a-new-social-media-platform//img/bhread-to-hn.png"></p>
<blockquote>
<p>Me doing a shameless plug on HN. It&rsquo;s a post about webrings. I couldn&rsquo;t resist.</p>
</blockquote>
<p>That&rsquo;s it for now, this is what the website looks like right now (Sept 21, 2023):</p>
<p><img src="/post/2023-09-21-building-a-new-social-media-platform//img/bhread-screenshot-09-21-2023.png">
It&rsquo;s getting pretty close :D</p>
<p>Bonus:</p>
<p><img src="/post/2023-09-21-building-a-new-social-media-platform//img/bhread-styles-injected-fail.png"></p>
<blockquote>
<p>I forgot to sanitize the verification post. The wordpress theme of the post infected the whole site. Makes me think about the design of my code.</p>
</blockquote>
<p>If you want to know more about the project, visit [<a href="Bhread.com">Bhread.com</a>


  

](<a href="https://bhread.com">https://bhread.com</a>


  

) or visit the <a href="https://blog.bhread.com">Bhread blog</a>


  

.</p>
]]></content:encoded></item><item><title>Welcome to Bhread.com</title><link>https://earlps.net/shorts/2023-09-15-welcome-to-bhread-com/</link><pubDate>Fri, 15 Sep 2023 14:04:54 +0800</pubDate><guid>https://earlps.net/shorts/2023-09-15-welcome-to-bhread-com/</guid><description>Hello World! I&amp;rsquo;m now joining bhread.com as elpachongco. See you! 🍞🍞🍞</description><content:encoded><![CDATA[<p>Hello World! I&rsquo;m now joining bhread.com <a href="https://bhread.com/feeds/elpachongco/verification">as elpachongco.</a>


  

 See you! 🍞🍞🍞</p>
]]></content:encoded></item><item><title>Animated favicons</title><link>https://earlps.net/shorts/2023-08-07-animated-favicons/</link><pubDate>Tue, 08 Aug 2023 00:40:09 +0800</pubDate><guid>https://earlps.net/shorts/2023-08-07-animated-favicons/</guid><description>I was looking at uses.tech website . I wondered how I can have an animated favicon because this is probably the first time I saw one.
Then I came accross this: an arcade game played in the favicon . How cool is that!</description><content:encoded><![CDATA[<p><a href="https://uses.tech/"> </a>


  

I was looking at <a href="https://uses.tech/">uses.tech website</a>


  

. I wondered how I can have an animated favicon because this is probably the first time I saw one.</p>
<p>Then I came accross this: <a href="http://www.p01.org/defender_of_the_favicon/">an arcade game played in the favicon</a>


  

. How cool is that!</p>
]]></content:encoded></item><item><title>Thinking of creating /uses</title><link>https://earlps.net/shorts/2023-08-05-thinking-of-creating-uses/</link><pubDate>Sat, 05 Aug 2023 13:55:13 +0000</pubDate><guid>https://earlps.net/shorts/2023-08-05-thinking-of-creating-uses/</guid><description>Found this post on hn . I&amp;rsquo;m thinking of adding a /uses page on the site…
I will also include a workspace setup like found on this site . But right now I work on the dining table so&amp;hellip; 🤔
See also this site and this setup by Aaron Schwartz .</description><content:encoded><![CDATA[<p>Found this <a href="https://news.ycombinator.com/item?id=36613543">post on hn</a>


  

. I&rsquo;m thinking of adding a /uses page on the site…</p>
<p>I will also include a workspace setup like <a href="https://www.workspaces.xyz/">found on this site</a>


  

. But right now I work on the dining table so&hellip; 🤔</p>
<p>See also <a href="https://usesthis.com/">this site</a>


  

 and <a href="https://usesthis.com/interviews/aaron.swartz/">this setup by Aaron Schwartz</a>


  

.</p>
]]></content:encoded></item><item><title>Introducing Shorts</title><link>https://earlps.net/shorts/hello/</link><pubDate>Thu, 03 Aug 2023 18:11:26 +0800</pubDate><guid>https://earlps.net/shorts/hello/</guid><description>Every platform has shorts now. It&amp;rsquo;s new, it&amp;rsquo;s addicting, and I want it on my blog!
Introducing Shorts # This site is going to get a lot more updates from now on. Social media platforms are unstable right now. It&amp;rsquo;s time for blogs to rise!
See https://elpachongco.github.io/shorts</description><content:encoded><![CDATA[<p>Every platform has <code>shorts</code> now. It&rsquo;s new, it&rsquo;s addicting, and I want it on my blog!</p>
<h2 id="introducing-shorts">
  Introducing Shorts
  <a href="#introducing-shorts" class="article-heading-anchor">#</a>
</h2>
<p>This site is going to get a lot more updates from now on. Social media
platforms are unstable right now. It&rsquo;s time for blogs to rise!</p>
<p>See <a href="https://elpachongco.github.io/shorts"><code>https://elpachongco.github.io/shorts</code></a>


  

</p>
]]></content:encoded></item><item><title>Code Snippets #1: What the heck is hardhat's console.log?</title><link>https://earlps.net/post/2023-03-24-hardhat-console-log/</link><pubDate>Fri, 24 Mar 2023 21:07:26 +0000</pubDate><guid>https://earlps.net/post/2023-03-24-hardhat-console-log/</guid><description>I was tasked to create ethereum smart contracts in my previous job.
the library most recommended by other developers to create smart contracts was hardhat.
to create and debug the smart contracts, I developed them using test-driven-development methods. The tests gave me a way to print out and inspect variables.
just as I was done with the development I read somewhere that hardhat has a console.log() utility. You import it with import hardhat/console.</description><content:encoded><![CDATA[<p>I was tasked to create ethereum smart contracts in my previous job.</p>
<p>the library most recommended by other developers to create
smart contracts was <code>hardhat</code>.</p>
<p>to create and debug the smart contracts, I developed them using
test-driven-development methods. The tests gave  me a way to print out
and inspect variables.</p>
<p>just as I was done with the development I read somewhere that hardhat has a
<code>console.log()</code> utility. You import it with <code>import hardhat/console.sol</code> and
use it like JS&rsquo;s <code>console.log</code>. I wondered how it worked. Upon testing, it
seemed to only allow a maximum amount of parameters.</p>
<p>so i decided to look at hardhat&rsquo;s internals and find out how they do it.</p>
<p>the first step was to find the <code>console.log()</code> utility function.</p>
<p>this is their repository
<a href="https://github.com/NomicFoundation/hardhat">https://github.com/NomicFoundation/hardhat</a>


  

</p>


<pre><code><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1</span><span>$ ls 
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2</span><span>config  CONTRIBUTING.md  crates  docs  LICENSE  package.json  packages  README.md  scripts  yarn.lock</span></span></code></pre>
<p>im not familliar with their file structure conventions. But I can guess that
the source code is not in <code>config/</code>, <code>docs/</code>, or <code>scipts/</code>.</p>


<pre><code><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1</span><span>$ ls crates packages
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2</span><span>crates:
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3</span><span>rethnet_evm_napi
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">4</span><span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">5</span><span>packages:
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">6</span><span>common                 hardhat-core       hardhat-foundry          hardhat-solhint  hardhat-truffle4  hardhat-waffle
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">7</span><span>eslint-plugin          hardhat-ethers     hardhat-network-helpers  hardhat-solpp    hardhat-truffle5  hardhat-web3
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">8</span><span>hardhat-chai-matchers  hardhat-etherscan  hardhat-shorthand        hardhat-toolbox  hardhat-vyper     hardhat-web3-legacy</span></span></code></pre>
<p>i didn&rsquo;t know what <code>crates/</code> were so I also tried it.
anyway, <code>packages/</code> contains <code>hardhat-core/</code>. Inside it we&rsquo;ll find
<code>console.sol</code>.</p>
<p>let&rsquo;s see the code.</p>


<pre><code><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1</span><span>$ cat packages/hardhat-core/console.log</span></span></code></pre>
<p>link to it:
<a href="https://github.com/NomicFoundation/hardhat/blob/main/packages/hardhat-core/console.sol">https://github.com/NomicFoundation/hardhat/blob/main/packages/hardhat-core/console.sol</a>


  

</p>
<p>opening it, we find 1513 lines of repetitive, possibly auto-generated code.</p>
<p>here&rsquo;s an interesting part of the code:</p>


<pre><code><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1</span><span>$ cat packages/hardhat-core/console.sol  -n | tail -n <span style="color:#ae81ff">30</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2</span><span><span style="color:#ae81ff">1503</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3</span><span><span style="color:#ae81ff">1504</span>          <span style="color:#66d9ef">function</span> log<span style="color:#f92672">(</span>address p0, address p1, bool p2, string memory p3<span style="color:#f92672">)</span> internal view <span style="color:#f92672">{</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4</span><span><span style="color:#ae81ff">1505</span>                  _sendLogPayload<span style="color:#f92672">(</span>abi.encodeWithSignature<span style="color:#f92672">(</span><span style="color:#e6db74">&#34;log(address,address,bool,string)&#34;</span>, p0, p1, p2, p3<span style="color:#f92672">))</span>;
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5</span><span><span style="color:#ae81ff">1506</span>          <span style="color:#f92672">}</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6</span><span><span style="color:#ae81ff">1507</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7</span><span><span style="color:#ae81ff">1508</span>          <span style="color:#66d9ef">function</span> log<span style="color:#f92672">(</span>address p0, address p1, bool p2, bool p3<span style="color:#f92672">)</span> internal view <span style="color:#f92672">{</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8</span><span><span style="color:#ae81ff">1509</span>                  _sendLogPayload<span style="color:#f92672">(</span>abi.encodeWithSignature<span style="color:#f92672">(</span><span style="color:#e6db74">&#34;log(address,address,bool,bool)&#34;</span>, p0, p1, p2, p3<span style="color:#f92672">))</span>;
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9</span><span><span style="color:#ae81ff">1510</span>          <span style="color:#f92672">}</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10</span><span><span style="color:#ae81ff">1511</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11</span><span><span style="color:#ae81ff">1512</span>          <span style="color:#66d9ef">function</span> log<span style="color:#f92672">(</span>address p0, address p1, bool p2, address p3<span style="color:#f92672">)</span> internal view <span style="color:#f92672">{</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12</span><span><span style="color:#ae81ff">1513</span>                  _sendLogPayload<span style="color:#f92672">(</span>abi.encodeWithSignature<span style="color:#f92672">(</span><span style="color:#e6db74">&#34;log(address,address,bool,address)&#34;</span>, p0, p1, p2, p3<span style="color:#f92672">))</span>;
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13</span><span><span style="color:#ae81ff">1514</span>          <span style="color:#f92672">}</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14</span><span><span style="color:#ae81ff">1515</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15</span><span><span style="color:#ae81ff">1516</span>          <span style="color:#66d9ef">function</span> log<span style="color:#f92672">(</span>address p0, address p1, address p2, uint256 p3<span style="color:#f92672">)</span> internal view <span style="color:#f92672">{</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16</span><span><span style="color:#ae81ff">1517</span>                  _sendLogPayload<span style="color:#f92672">(</span>abi.encodeWithSignature<span style="color:#f92672">(</span><span style="color:#e6db74">&#34;log(address,address,address,uint256)&#34;</span>, p0, p1, p2, p3<span style="color:#f92672">))</span>;
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17</span><span><span style="color:#ae81ff">1518</span>          <span style="color:#f92672">}</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18</span><span><span style="color:#ae81ff">1519</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">19</span><span><span style="color:#ae81ff">1520</span>          <span style="color:#66d9ef">function</span> log<span style="color:#f92672">(</span>address p0, address p1, address p2, string memory p3<span style="color:#f92672">)</span> internal view <span style="color:#f92672">{</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">20</span><span><span style="color:#ae81ff">1521</span>                  _sendLogPayload<span style="color:#f92672">(</span>abi.encodeWithSignature<span style="color:#f92672">(</span><span style="color:#e6db74">&#34;log(address,address,address,string)&#34;</span>, p0, p1, p2, p3<span style="color:#f92672">))</span>;
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">21</span><span><span style="color:#ae81ff">1522</span>          <span style="color:#f92672">}</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">22</span><span><span style="color:#ae81ff">1523</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">23</span><span><span style="color:#ae81ff">1524</span>          <span style="color:#66d9ef">function</span> log<span style="color:#f92672">(</span>address p0, address p1, address p2, bool p3<span style="color:#f92672">)</span> internal view <span style="color:#f92672">{</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">24</span><span><span style="color:#ae81ff">1525</span>                  _sendLogPayload<span style="color:#f92672">(</span>abi.encodeWithSignature<span style="color:#f92672">(</span><span style="color:#e6db74">&#34;log(address,address,address,bool)&#34;</span>, p0, p1, p2, p3<span style="color:#f92672">))</span>;
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">25</span><span><span style="color:#ae81ff">1526</span>          <span style="color:#f92672">}</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">26</span><span><span style="color:#ae81ff">1527</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">27</span><span><span style="color:#ae81ff">1528</span>          <span style="color:#66d9ef">function</span> log<span style="color:#f92672">(</span>address p0, address p1, address p2, address p3<span style="color:#f92672">)</span> internal view <span style="color:#f92672">{</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">28</span><span><span style="color:#ae81ff">1529</span>                  _sendLogPayload<span style="color:#f92672">(</span>abi.encodeWithSignature<span style="color:#f92672">(</span><span style="color:#e6db74">&#34;log(address,address,address,address)&#34;</span>, p0, p1, p2, p3<span style="color:#f92672">))</span>;
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">29</span><span><span style="color:#ae81ff">1530</span>          <span style="color:#f92672">}</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">30</span><span><span style="color:#ae81ff">1531</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">31</span><span><span style="color:#ae81ff">1532</span>  <span style="color:#f92672">}</span></span></span></code></pre>
<p>this looks fascinating to me. I&rsquo;m less familiar with statically-typed
languages, so I don&rsquo;t know how common this method is. I&rsquo;ll explain why it
intrigues me.</p>
<p>most of the file consist of functions with the name <code>log</code>. In python or
probably any dynamically-typed languages, this would not work. For example, if <code>log()</code> is
called, The interpreter would not know which <code>log</code>, to use out of the many <code>log</code>s defined.</p>


<pre><code><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1</span><span><span style="color:#ae81ff">1524</span>          <span style="color:#66d9ef">function</span> log<span style="color:#f92672">(</span>address p0, address p1, address p2, bool p3<span style="color:#f92672">)</span> internal view <span style="color:#f92672">{</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2</span><span><span style="color:#ae81ff">1525</span>                  _sendLogPayload<span style="color:#f92672">(</span>abi.encodeWithSignature<span style="color:#f92672">(</span><span style="color:#e6db74">&#34;log(address,address,address,bool)&#34;</span>, p0, p1, p2, p3<span style="color:#f92672">))</span>;
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3</span><span><span style="color:#ae81ff">1526</span>          <span style="color:#f92672">}</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">4</span><span><span style="color:#ae81ff">1527</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">5</span><span><span style="color:#ae81ff">1528</span>          <span style="color:#66d9ef">function</span> log<span style="color:#f92672">(</span>address p0, address p1, address p2, address p3<span style="color:#f92672">)</span> internal view <span style="color:#f92672">{</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">6</span><span><span style="color:#ae81ff">1529</span>                  _sendLogPayload<span style="color:#f92672">(</span>abi.encodeWithSignature<span style="color:#f92672">(</span><span style="color:#e6db74">&#34;log(address,address,address,address)&#34;</span>, p0, p1, p2, p3<span style="color:#f92672">))</span>;
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">7</span><span><span style="color:#ae81ff">1530</span>          <span style="color:#f92672">}</span></span></span></code></pre>
<p>in solidity, this is a completely valid use case. Although the function
names are the same, the compiler can determine which <code>log</code> to use by looking at
the data types of the arguments, and finding which <code>log</code> function has  the
correct parameter data types.</p>


<pre><code><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1</span><span><span style="color:#ae81ff">1524</span>          <span style="color:#66d9ef">function</span> log<span style="color:#f92672">(</span>address p0, address p1, address p2, bool p3<span style="color:#f92672">)</span> internal view <span style="color:#f92672">{</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2</span><span><span style="color:#ae81ff">1528</span>          <span style="color:#66d9ef">function</span> log<span style="color:#f92672">(</span>address p0, address p1, address p2, address p3<span style="color:#f92672">)</span> internal view <span style="color:#f92672">{</span></span></span></code></pre>
<p>For example, these two function definitions are almost the same, except the
fourth parmeter. Line <code>1524</code> handles <code>log</code> calls with specifically 4 parameters
with respective types: <code>address</code>,  <code>address</code> ,  <code>address</code>, and <code>bool</code>.</p>
<p>Whereas Line <code>1528</code> handles <code>log</code> calls that pass exactly 4 address data types.</p>


<pre><code><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1</span><span><span style="color:#ae81ff">1524</span>          <span style="color:#66d9ef">function</span> log<span style="color:#f92672">(</span>address p0, address p1, address p2, bool p3<span style="color:#f92672">)</span> internal view <span style="color:#f92672">{</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2</span><span><span style="color:#ae81ff">1525</span>                  _sendLogPayload<span style="color:#f92672">(</span>abi.encodeWithSignature<span style="color:#f92672">(</span><span style="color:#e6db74">&#34;log(address,address,address,bool)&#34;</span>, p0, p1, p2, p3<span style="color:#f92672">))</span>;
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3</span><span><span style="color:#ae81ff">1526</span>          <span style="color:#f92672">}</span></span></span></code></pre>
<p>This design means that only a fixed number of arguments can be accepted by hardhat&rsquo;s console.log.
Console.log will not work if it&rsquo;s supplied with arguments that are not pre-defined in <code>console.sol</code>.</p>
<p>I later found the script that generates this code. It&rsquo;s in
<code>hardhat/packages/hardhat-core/scripts/console-library-generator.js</code>.</p>
<p>The parameters <code>p0</code> to <code>p3</code>, are passed to
<code>abi.encodeWithSignature</code> which is then passed to <code>_sendLogPayload</code>.</p>


<pre><code><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1</span><span>$ cat packages/hardhat-core/console.log -n | head -n <span style="color:#ae81ff">14</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2</span><span> <span style="color:#ae81ff">1</span>  // SPDX-License-Identifier: MIT
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3</span><span> <span style="color:#ae81ff">2</span>  pragma solidity &gt;<span style="color:#f92672">=</span> 0.4.22 &lt;0.9.0;
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4</span><span> <span style="color:#ae81ff">3</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5</span><span> <span style="color:#ae81ff">4</span>  library console <span style="color:#f92672">{</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6</span><span> <span style="color:#ae81ff">5</span>          address constant CONSOLE_ADDRESS <span style="color:#f92672">=</span> address<span style="color:#f92672">(</span>0x000000000000000000636F6e736F6c652e6c6f67<span style="color:#f92672">)</span>;
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7</span><span> <span style="color:#ae81ff">6</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8</span><span> <span style="color:#ae81ff">7</span>          <span style="color:#66d9ef">function</span> _sendLogPayload<span style="color:#f92672">(</span>bytes memory payload<span style="color:#f92672">)</span> private view <span style="color:#f92672">{</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9</span><span> <span style="color:#ae81ff">8</span>                  uint256 payloadLength <span style="color:#f92672">=</span> payload.length;
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10</span><span> <span style="color:#ae81ff">9</span>                  address consoleAddress <span style="color:#f92672">=</span> CONSOLE_ADDRESS;
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11</span><span><span style="color:#ae81ff">10</span>                  assembly <span style="color:#f92672">{</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12</span><span><span style="color:#ae81ff">11</span>                          let payloadStart :<span style="color:#f92672">=</span> add<span style="color:#f92672">(</span>payload, 32<span style="color:#f92672">)</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13</span><span><span style="color:#ae81ff">12</span>                          let r :<span style="color:#f92672">=</span> staticcall<span style="color:#f92672">(</span>gas<span style="color:#f92672">()</span>, consoleAddress, payloadStart, payloadLength, 0, 0<span style="color:#f92672">)</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14</span><span><span style="color:#ae81ff">13</span>                  <span style="color:#f92672">}</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15</span><span><span style="color:#ae81ff">14</span>          <span style="color:#f92672">}</span></span></span></code></pre>
<p>At first glance, I can deduce that Hardhat sends the messages from <code>console.log</code>
to a dedicated public address. It then scans the address for messages and
outputs any messages that are sent to it to the terminal.</p>
<p>So that&rsquo;s Hardhat&rsquo;s console.log. We looked at its internals and found
mysterious code that turned out to be a smart solution to the problem.</p>
]]></content:encoded></item><item><title>My first year of being a professional programmer</title><link>https://earlps.net/post/2023-02-11-reflections-one-year/</link><pubDate>Sat, 11 Feb 2023 21:30:26 +0000</pubDate><guid>https://earlps.net/post/2023-02-11-reflections-one-year/</guid><description>I met my goal. # I posted a blog post on August 6, 2021 stating that I want to get a job before april 2022. During that time, I was creating projects for my resume. I was reading up on what people in the industry have to say about landing a job without a degree. The most common advice is to have projects that demonstrate my skills to potential employers.</description><content:encoded><![CDATA[<h2 id="i-met-my-goal">
  I met my goal.
  <a href="#i-met-my-goal" class="article-heading-anchor">#</a>
</h2>
<p>I posted a blog post on August 6, 2021 stating that I want to get a job before
april 2022. During that time, I was creating projects for my resume. I was
reading up on what people in the industry have to say about landing a job
without a degree. The most common advice is to have projects that demonstrate
my skills to potential employers.</p>
<p>It was an effective advice. By January I was started looking for local jobs.
February of 2022, I found a job that fit my criteria well. The interview went
well. I demonstrated some of my projects and one of their programmers asked me
programming questions. The questions were about programming best practices,
what I do when I can&rsquo;t solve a programming problem.</p>
<p>I was hired by a team of data scientists developing a product from their
university research. They&rsquo;re funded by the government and partnered with their
university.</p>
<p>Our core team is composed of 4 people. I&rsquo;m the one in charged of programming the
product. Our project leader is a Cs doctorate and a professor in the university.
the working environment is what you&rsquo;d expect from a government and academic
environment &ndash; they&rsquo;re pretty formal, and buzzwords amaze them. Especially that
the project is focused on blockchain tech. It’s a unique experience to be
surrounded by non-programming (but otherwise technical) people speculating on
the technology.</p>
<p>In the office, I get to meet different kinds of people. It&rsquo;s great to be
surrounded by people smarter than me, especially programmers. I can ask them
advice on technical topics and most of the time that&rsquo;s when I learn new things.</p>
<h2 id="i-have-never-made-a-complete-system-until-now">
  I have never made a complete system until now
  <a href="#i-have-never-made-a-complete-system-until-now" class="article-heading-anchor">#</a>
</h2>
<p>Now that I&rsquo;m hired, I realized I will be creating a complete system. I used to
only create scripts for my amusement and portfolio. Developing a whole system
&ndash; one that should be able to perform its functions well and be easy to use is
different from programming simple scripts.</p>
<p>I remember being overwhelmed of how I will plan things out. As always, you&rsquo;ll
never realize how important planning is until you&rsquo;re in the middle of
development. In our case, I wasn&rsquo;t able to plan much because of uncertainties
on the hardware and its communications.</p>
<p>For context, The project is a renewable energy trading platform based on
blockchain.</p>
<p>The development of this project taught me a lot of things as a
programmer. I wrote code from low level hardware code, react js frontend code,
django backend code, solidity code, and bash. Bash was really useful for me
when it came to testing and automating things.</p>
<h2 id="x-by-example-x-styleguide">
  x by example, x styleguide
  <a href="#x-by-example-x-styleguide" class="article-heading-anchor">#</a>
</h2>
<p>Most of the software I wrote were new languages or concepts to me.</p>
<p>Being already familiar with multiple programming languages, reading <code>x by example</code>, was the fastest way to get coding. Now, when I encounter a new
language, I&rsquo;ll read x by example. This works fine for small programs and
programming languages that I probably will not use much. Reading <code>solidity by example</code> supplemented with the solidity style guide, I wrote decent smart
contracts (I think)</p>
<h2 id="tdd-is-great-if-the-project-is-complex">
  TDD is great if the project is complex.
  <a href="#tdd-is-great-if-the-project-is-complex" class="article-heading-anchor">#</a>
</h2>
<p>For complex projects such as our backend server (django), test-driven
devleopment helped a lot. I can&rsquo;t imagine how much time i saved by creating
tests to implement features in such a complex system. Compared to just using
<code>print()</code> like I&rsquo;m used to. Now, If i&rsquo;m going to work on a project where
printing will be cumbersome (solidity is another example), I will instead write
tests to develop software function by function. For simple scripts, I will
still stick to <code>print()</code>. BTW, using <code>debugger;</code> is great for frontend
javascript projects.</p>
<h2 id="templates-are-great">
  Templates are great
  <a href="#templates-are-great" class="article-heading-anchor">#</a>
</h2>
<p>For the frontend, we used an open source dashboard template written in react
and material-ui. This helped the project progress fast. It was better for our
small team to spend our time modifying the defaults of the template instead of
starting from scatch. Existing components were used as basis for creating our
own new components. Being written in react, any new member of the team will
most likely be able to contribute to the frontend.</p>
<h2 id="thoughts-on-blockchain">
  Thoughts on blockchain
  <a href="#thoughts-on-blockchain" class="article-heading-anchor">#</a>
</h2>
<p>Gas is still a problem. I think, currently that blockchain is great for
creating organizations because of its ability to store simple data and make it
available to everyone globally with not much infrastructure.</p>
<p>In my opinion, the current state of the art is only at the tip of the
iceberg of what blockchain can offer. Currently, we mostly see applications
that can theoretically be made using basic web architectures (server and
client). Blockchain only acts as improvement to the previous architectures.
Many people don&rsquo;t bother with it because the improvements it brings are not
worth the additional complexity that come with it.</p>
<p>More reasearch is needed. I can&rsquo;t say whether blockchain is a useless tool or
not because we still haven&rsquo;t discovered its true properties. The project
that I am working on made me see how it can be a useful innovation for
the technology of the incoming generation. I&rsquo;ll probably write a research
article about it soon.</p>
<h2 id="failures">
  Failures
  <a href="#failures" class="article-heading-anchor">#</a>
</h2>
<ul>
<li>
<p>Deciding architecture</p>
<p>Back when we were starting to develop the project, I hit a roadblock.
I didn&rsquo;t know how I would integrate the whole project. It&rsquo;s not that I didn&rsquo;t
know what to do, I was stuck deciding which design was the best. My first
choice was to put react inside of django so I can use django&rsquo;s templating
capabilities with react. I tried that and modified a lot of code for the
react material-ui frontend but in the end, it was janky. I realized that a
backend server serving an api will be the better design. So I reverted most
of the changes that I did and had the frontend and backend be separate
entities. I&rsquo;m glad that I did. The seperation made the program code cleaner
and flexible.</p>
<p>I was lucky that it was just mostly me and my other coworker doing
development that time. the size of our team allowed us to flexibly change the
architecture without anyone else complaining. I was really close to having a
really bad developer experience for the rest of my time there.</p>
</li>
<li>
<p>Not knowing lower-level side of computers</p>
<p>Being a self-taught programmer who learned programming by creating simple
python scripts for automation, I never really bothered to learn binary
arithmetic and communications. That mistake hit me. I had to write programs
for two kinds of devices which had different communications. Good thing some
other developers created packages for easy communication with these
hardware. I still had to learn their communication protocols and binary
arithmetic to fully use and understand the hardware. It took me quite some
time to learn.</p>
</li>
<li>
<p>Plans after getting a job</p>
<p>Before getting a job, I told myself that if I ever get one, I will work from 9
to 5 then study more programming at home. That didn&rsquo;t happen. I told a
programmer co-worker about this and they told me they actually had the same
plans but were also not able to do it after getting hired. This led me to
believe that having an onsite job is actually a lot more draining than working
at home.</p>
</li>
</ul>
<p>It&rsquo;s been a year now and the project is near completion. I met new people,
learned new things, encountered problems I was able to solve, and got paid. The
project is a one year contract so I&rsquo;ll be jobless again soon. I need to think
of another plan. Should I get a new job? Study in a university? Both?</p>
]]></content:encoded></item><item><title>Code Snippets #0: Deploy when port exists using recursion</title><link>https://earlps.net/post/2022-07-13-code-snippets-0/</link><pubDate>Wed, 13 Jul 2022 20:40:26 +0000</pubDate><guid>https://earlps.net/post/2022-07-13-code-snippets-0/</guid><description>I&amp;rsquo;m starting a new category of posts called &amp;ldquo;Code Snippets&amp;rdquo; where I share code I find interesting.
In this first installment is a simple code snippet I originally wrote in Powershell to scan a local port continuously and do something when the port is found:
1function deploy(): 2 if ( port_exists(port) ): 3 do_something() 4 else: 5 deploy() 6 7deploy() Recursion has been a hard concept for me to put into practice and this served as a good introduction to it.</description><content:encoded><![CDATA[<p>I&rsquo;m starting a new category of posts called &ldquo;Code Snippets&rdquo; where I share code
I find interesting.</p>
<p>In this first installment is a simple code snippet I originally wrote in Powershell
to scan a local port continuously and do something when the port is
found:</p>


<pre><code><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1</span><span>function deploy(): 
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2</span><span>	<span style="color:#66d9ef">if</span> ( port_exists(port) ):
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3</span><span>		do_something()
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">4</span><span>	<span style="color:#66d9ef">else</span>: 
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">5</span><span>		deploy()
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">6</span><span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">7</span><span>deploy()</span></span></code></pre>
<p>Recursion has been a hard concept for me to put into practice and this served
as a good introduction to it. However, this doesn&rsquo;t feel like a &lsquo;proper&rsquo;
recursion to me.</p>
<p>I was so satisfied with this code so I showed it to my programmer co-worker
friend. He asked me what will happen if the program doesn&rsquo;t ever find the port?
I didn&rsquo;t think much of it because I know the user can just close the program
and the port scanning is slow enough (around 1 sec for each function call).</p>
<p>I later realized what he meant. Being a better programmer than me, he knew
something was missing. And so, let&rsquo;s try to improve the code.</p>


<pre><code><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1</span><span>function deploy(retries):
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2</span><span>	
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3</span><span>	<span style="color:#66d9ef">if</span> ( retries <span style="color:#f92672">&lt;</span> <span style="color:#ae81ff">1</span> ): 
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4</span><span>		<span style="color:#66d9ef">raise</span> <span style="color:#a6e22e">Exception</span>(<span style="color:#e6db74">&#34;Port not found, Maximum retries reached.&#34;</span>)
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5</span><span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6</span><span>	<span style="color:#66d9ef">if</span> ( port_exists(port) ):
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7</span><span>		do_something()
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8</span><span>	<span style="color:#66d9ef">else</span>: 
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9</span><span>		deploy(retries<span style="color:#f92672">-</span><span style="color:#ae81ff">1</span>)
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10</span><span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11</span><span><span style="color:#75715e"># Limit retries to n</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12</span><span>n <span style="color:#f92672">=</span> <span style="color:#ae81ff">10</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13</span><span>deploy(n) </span></span></code></pre>
<p>This feels more like recursion. The program will now only do a maximum of <code>n</code>
retries. After that, if the port still doesn&rsquo;t exist, it will throw an error.</p>
<p>The reason why I said the previous code didn&rsquo;t feel like a proper recursion was
because it didn&rsquo;t limit the number of times it can call itself.</p>
<p>This limit is called the base case. In the code:</p>


<pre><code><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1</span><span>function deploy(retries):
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2</span><span>	
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3</span><span>	<span style="color:#66d9ef">if</span> (retries <span style="color:#f92672">&lt;</span> <span style="color:#ae81ff">1</span> ): <span style="color:#75715e"># &lt;--- This is the Base case</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4</span><span>		<span style="color:#66d9ef">raise</span> <span style="color:#a6e22e">Exception</span>(<span style="color:#e6db74">&#34;Port not found, Maximum retries reached.&#34;</span>)
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5</span><span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6</span><span>	<span style="color:#66d9ef">if</span> ( port_exists(port) ):
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7</span><span>		do_something()
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8</span><span>	<span style="color:#66d9ef">else</span>: 
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9</span><span>		deploy(retries<span style="color:#f92672">-</span><span style="color:#ae81ff">1</span>) 
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10</span><span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11</span><span><span style="color:#75715e"># Limit retries to n</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12</span><span>n <span style="color:#f92672">=</span> <span style="color:#ae81ff">10</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13</span><span>deploy(n) </span></span></code></pre>
<p>The base case is a condition where if it is true, it stops the recursion.</p>
<p>Without the base case, some recursive functions could result to infinite
recursions — something that should not happen, hence why the computer will
throw an error (usually a stack overflow) when it finds an infinite recursive
function.</p>
<p>For example, you can try to run this python code:</p>


<pre><code><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1</span><span><span style="color:#66d9ef">def</span> <span style="color:#a6e22e">a</span>(b):
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2</span><span>	<span style="color:#66d9ef">return</span> a(b<span style="color:#f92672">+</span><span style="color:#ae81ff">1</span>)
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3</span><span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">4</span><span>a(<span style="color:#ae81ff">1</span>)</span></span></code></pre>
<p>In this code, nothing will stop <code>a</code> from calling itself again which could be
problematic. This is why adding the base case and a way to achieve the base
case is important.</p>
<p>Back to the code snippet, what else can we do to improve the code?</p>
<p>Here&rsquo;s an idea: add a time.sleep() before each recurse to prevent the code
from executing too fast and eating unnecessary memory:</p>


<pre><code><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1</span><span><span style="color:#f92672">import</span> time
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2</span><span>function deploy(retries):
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3</span><span>	
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4</span><span>	<span style="color:#66d9ef">if</span> (retries <span style="color:#f92672">&lt;</span> <span style="color:#ae81ff">1</span> ): 
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5</span><span>		<span style="color:#66d9ef">raise</span> <span style="color:#a6e22e">Exception</span>(<span style="color:#e6db74">&#34;Port not found, Maximum retries reached.&#34;</span>)
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6</span><span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7</span><span>	<span style="color:#66d9ef">if</span> ( port_exists(port) ):
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8</span><span>		do_something()
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9</span><span>	<span style="color:#66d9ef">else</span>: 
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10</span><span>		time<span style="color:#f92672">.</span>sleep(<span style="color:#ae81ff">1</span>) <span style="color:#75715e"># &lt;--- Do a 1-second sleep before every recurse</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11</span><span>		deploy(retries<span style="color:#f92672">-</span><span style="color:#ae81ff">1</span>)
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12</span><span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13</span><span><span style="color:#75715e"># Limit retries to n</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14</span><span>n <span style="color:#f92672">=</span> <span style="color:#ae81ff">10</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15</span><span>deploy(n) </span></span></code></pre>
<p>Without the <code>time.sleep(1)</code>, the program will loop as fast as it can, faster
than what the code needs to be which will just waste our computer&rsquo;s resources
especially if the <code>port_exists</code> function consumes a lot of memory or cpu when
called.</p>
<p>Note: I mentioned earlier that the port scanning takes 1 second so adding a
time.sleep(1) will make the program scan every 2 seconds. I didn&rsquo;t add that to
my original code but in this case, I added it since it&rsquo;s a different program.</p>
<p>That&rsquo;s it for this code snippet. Try to improve the code, and maybe publish it.
I will be happy to read them :).</p>
<p>To end this episode, I&rsquo;ll give you something to think about. Here&rsquo;s the same
program but instead of recursion, it uses a while loop:</p>


<pre><code><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1</span><span>function deploy(retries):
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2</span><span>	
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3</span><span>	<span style="color:#66d9ef">while</span> <span style="color:#f92672">not</span> port_exists(port):
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4</span><span>		<span style="color:#66d9ef">if</span> ( retries <span style="color:#f92672">&lt;</span> <span style="color:#ae81ff">1</span> ): 
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5</span><span>			<span style="color:#66d9ef">raise</span> <span style="color:#a6e22e">Exception</span>(<span style="color:#e6db74">&#34;Port not found, Maximum retries reached.&#34;</span>)
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6</span><span>		retries <span style="color:#f92672">-=</span> <span style="color:#ae81ff">1</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7</span><span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8</span><span>	do_something()
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9</span><span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10</span><span><span style="color:#75715e"># Limit retries to n</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11</span><span>n <span style="color:#f92672">=</span> <span style="color:#ae81ff">10</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12</span><span>deploy(n) </span></span></code></pre>
<p>Practice your programming skills and think of these questions:</p>
<ol>
<li>What are the advantages and disadvantages of using recursion or
iteration (i.e. a while loop)?</li>
<li>What types of situations does it make sense to use recursion versus
iteration?</li>
</ol>
<p>I will leave you, the reader to answer these questions. See you in the next
Code Snippet!</p>
]]></content:encoded></item><item><title>Prevent pinky strain caused by typing all day</title><link>https://earlps.net/post/2022-06-17-keyboard-layouts/</link><pubDate>Fri, 17 Jun 2022 00:14:54 +0000</pubDate><guid>https://earlps.net/post/2022-06-17-keyboard-layouts/</guid><description>Typing all day makes my pinky sore. This is how I got rid of it:
Superuser.com: How do I hit the “Ctrl” key without straining my pinky? I press both ctrl keys with the edge of my palm. It&amp;rsquo;s perfect; I don&amp;rsquo;t have to stretch my pinkies, and my fingers don&amp;rsquo;t have to move away from where they&amp;rsquo;re supposed to be.
Only downside is that this technique won&amp;rsquo;t work flat keyboards like the ones laptops have.</description><content:encoded><![CDATA[<p>Typing all day makes my pinky sore. This is how I got rid of it:</p>
<p><a href="https://superuser.com/a/317593">Superuser.com: How do I hit the “Ctrl” key without straining my pinky?</a>


  

</p>
<p>I press both ctrl keys with the edge of my palm. It&rsquo;s perfect; I don&rsquo;t have to
stretch my pinkies, and my fingers don&rsquo;t have to move away from where they&rsquo;re
supposed to be.</p>
<p>Only downside is that this technique won&rsquo;t work flat keyboards like the ones
laptops have. For those, I use an ANSI layout with a few modifications:</p>
<ul>
<li>
<p>CapsLock key is remapped to OS key
Reasons why I do it this way:</p>
<ul>
<li>I use the OS key more often than the caps lock key.</li>
<li>I use the CTRL key too much (emacs, terminal) that this placement
will still hurt my pinky</li>
</ul>
</li>
<li>
<p>And a bottom row layout where the control and alt keys are beside the space
bar respectively:</p>


<pre><code><pre tabindex="0"><code>| CapsLock (optional) | alt | ctrl | space bar | ctrl | alt | </code></pre></code></pre>
<p>This allows me to use my thumb for both the alt and ctrl keys which is
powerful for me.</p>
</li>
</ul>
<p>These techniques and layouts here mostly focus on making ctrl and alt keys very
accessible because I use them a lot (the shell, emacs).</p>
<p>That&rsquo;s it. It solves my problem, it works for me, and it&rsquo;s simple enough.</p>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
]]></content:encoded></item><item><title>Introducing Myself</title><link>https://earlps.net/post/2021-08-06-introducing-myself/</link><pubDate>Fri, 06 Aug 2021 00:14:54 +0000</pubDate><guid>https://earlps.net/post/2021-08-06-introducing-myself/</guid><description>Hi. Starting today, I&amp;rsquo;ll start this blog as a personal log of everything that I want to say. I mainly plan to add my opinions on some topics that interest me (I&amp;rsquo;ll stay away from rants) and helpful things that I learn and encounter as I go.
Since I am coming into the computer industry without formal education on the topic, this blog could also be helpful for me to getting a job as one of my projects that employers can refer to.</description><content:encoded><![CDATA[<p>Hi. Starting today, I&rsquo;ll start this blog as a personal log of everything that I
want to say. I mainly plan to add my opinions on some topics that interest me
(I&rsquo;ll stay away from rants) and helpful things that I learn and encounter as I
go.</p>
<p>Since I am coming into the computer industry without formal education on the
topic, this blog could also be helpful for me to getting a job as one of my
projects that employers can refer to. And if I do succeed in getting a job, I
hope other people who would be in the same situation as me can refer to my blog
as a reference.</p>
<p>I&rsquo;m currently 20 years old, and my plan is to get hired when I turn 21. This is
a deadline I imposed on myself that I&rsquo;d give myself time to learn the things
necessary to get hired. I don&rsquo;t really have to have a job but I aim to have at
least a source of income by that time.</p>
<p>Now I say that but I still feel like I want a job even if by that time I have a
proper source of income (business or  something) because I think the &ldquo;developer
experience&rdquo; is not complete without the interaction with other developers who I
can learn from and v./v.. I watched some of the google talks and they make it a
point that success mostly comes from good communication which I think I still
lack. I still don&rsquo;t have any experience on working on other projects with other
developers. Not to say that it&rsquo;s the only solution because I also think that I
can achieve the same by contributing to other open source projects. I&rsquo;ll just
have to see for myself but those are the things that I&rsquo;m considering.</p>
]]></content:encoded></item><item><title>About the author</title><link>https://earlps.net/about/about-the-author/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://earlps.net/about/about-the-author/</guid><description>About the author # I&amp;rsquo;m a software developer based in the Philippines. I like inventing stuff. I like seeing new things come from my work.
Editor # I use Neovim with NVChad as my editor. I don&amp;rsquo;t need a lot, I only write Python, and some JS and CSS for my day job. In the past, I&amp;rsquo;ve used VSCode and Emacs. VSCode is nice but I hate that there are times where I&amp;rsquo;ll need a mouse to use it.</description><content:encoded><![CDATA[<h2 id="about-the-author">
  About the author
  <a href="#about-the-author" class="article-heading-anchor">#</a>
</h2>
<p>I&rsquo;m a software developer based in the Philippines. I like inventing stuff. I like seeing new things come from my work.</p>
<h2 id="editor">
  Editor
  <a href="#editor" class="article-heading-anchor">#</a>
</h2>
<p>I use Neovim with NVChad as my editor. I don&rsquo;t need a lot, I only write Python, and some JS and CSS for my day job.
In the past, I&rsquo;ve used VSCode and Emacs. VSCode is nice but I hate that there are times where I&rsquo;ll need a mouse to use it.
I&rsquo;m looking into getting back to using VSCode.</p>
<p>Emacs was nice, it was really customizable but it was just clunky. I&rsquo;ll oftentimes get random slowdowns even on
an unconfigured Emacs.</p>
<h2 id="tech">
  Tech
  <a href="#tech" class="article-heading-anchor">#</a>
</h2>
<p>I like Python, it&rsquo;s the first programming language I learned. I build all prototype stuff in Python.
I also like CSS. I&rsquo;m not good at it but I appreciate good CSS.</p>
<p>Apart from Python, I&rsquo;ve tried to study C, and Go. Though, no big projects.</p>
<h2 id="reaching-me">
  Reaching me
  <a href="#reaching-me" class="article-heading-anchor">#</a>
</h2>
<p>For inquiries, collaboration, contact me on my email: earlsiachongco@&lt;email.com&gt;
replace <code>&lt;email.com&gt;</code> with <code>gmail.com</code>.</p>
]]></content:encoded></item><item><title>About this site</title><link>https://earlps.net/about/about-this-site/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://earlps.net/about/about-this-site/</guid><description>About this site # This site contains notes, thoughts, images and code by me (unless specified otherwise. Also, memes are excempted to this rule). The articles I write are mainly for my own reference. From time to time, I aim to reach an audience. It&amp;rsquo;s also an excuse for me to call myself a writer.
Design # I wanted this website to capture what it feels like to walk in the park.</description><content:encoded><![CDATA[<h2 id="about-this-site">
  About this site
  <a href="#about-this-site" class="article-heading-anchor">#</a>
</h2>
<p>This site contains notes, thoughts, images and code by me (unless specified otherwise. Also, memes are excempted to this rule). The articles I write are mainly for my own reference. From time to time, I aim to reach an audience. It&rsquo;s also an excuse for me to call myself a writer.</p>
<h2 id="design">
  Design
  <a href="#design" class="article-heading-anchor">#</a>
</h2>
<p>I wanted this website to capture what it feels like to walk in the park.</p>
<p>To me, a park is an ideal environment to socialize, discover new things or just look around. I want the
visitors of this site to feel that way. I want to show interesting stuff to make it fun to look around.</p>
<h2 id="why-run-a-personal-website">
  Why run a personal website
  <a href="#why-run-a-personal-website" class="article-heading-anchor">#</a>
</h2>
<p>Running a website feels the same as owning a house. Probably.</p>
<p>A house has to be maintained, but since you own the house, you can do whatever you want with it. This
site is my own place in the internet. It&rsquo;s my own land in the pangea that is the internet.</p>
<p>I don&rsquo;t think there&rsquo;s an alternative to having your own website. I still use Facebook to connect with friends but
my thoughts mainly go here. I think it&rsquo;s safer to host content this way and my content is not limited to one
platform. I also like that I am not limited to what customizations I can do.</p>
<p>It&rsquo;s also just so good to tell people you have your own webiste, I feel like Tony Stark when I tell someone, &lsquo;oh I&rsquo;m not really active on Facebook, but I&rsquo;m active on my website&rsquo;. In reality, the receiving end probably thinks I&rsquo;m the kind of person who writes my own Wikipedia page, this feeling is probably heightened by the fact that they didn&rsquo;t ask.</p>
<h2 id="the-technology-of-this-blog">
  The technology of this blog
  <a href="#the-technology-of-this-blog" class="article-heading-anchor">#</a>
</h2>
<p>This is a static site is rendered by Hugo, hosted on Github Pages. It&rsquo;s written in plain CSS, and HTML. I have also installed <code>staticCMS</code> in my local copy of this website.</p>
<p>Previously, this site used the <code>Jekyll</code> theme <code>Ananke</code>. I customized it to fit a <code>shorts</code> section to the site. Today, it&rsquo;s using <code>letter</code>, a theme made by me for this site. By having my own theme, I am able to design and customize every part of this website.</p>
<h3 id="cms">
  CMS
  <a href="#cms" class="article-heading-anchor">#</a>
</h3>
<p>When I first started this blog, if I wanted to get my thoughts into the blog, there were bottlenecks, one is that there&rsquo;s no fast way to just type and publish a post. In Facebook, and Twitter, you&rsquo;re just one URL/bookmark away, and a button press to publish a new post. I found that I can run <code>StaticCMS</code> on my copy of this website to get the same, fast, user experience.</p>
<p>I&rsquo;ve setup <code>hugo serve</code> with a cron job to run on startup so that everytime I have a thought I
want to publish, I can just open <code>localhost:1313/admin</code> to open <code>StaticCMS</code>. I think it&rsquo;s awesome.</p>
]]></content:encoded></item><item><title>search</title><link>https://earlps.net/search/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://earlps.net/search/</guid><description/><content:encoded></content:encoded></item></channel></rss>