<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Blog on Hakeem Almidan</title><link>https://hakeem-almidan.com/</link><description>Recent content in Blog on Hakeem Almidan</description><generator>Hugo -- gohugo.io</generator><language>en-GB</language><atom:link href="https://hakeem-almidan.com/index.xml" rel="self" type="application/rss+xml"/><item><title>lsdir - A Shell Alias for Only Listing Directories</title><link>https://hakeem-almidan.com/posts/lsdir/</link><pubDate>Fri, 13 Sep 2024 01:01:01 -0700</pubDate><guid>https://hakeem-almidan.com/posts/lsdir/</guid><description>&lt;h2 id="the-problem">The Problem&lt;/h2>
&lt;p>When working in the terminal, you sometimes need to list only the directories in the current location. The standard &lt;code>ls&lt;/code> command shows both files and directories, which can be overwhelming in cluttered directories.&lt;/p>
&lt;p>The command for listing only directories in the current location is &lt;code>ls -d */&lt;/code> (&lt;a href="https://stackoverflow.com/a/29264762/7974948">source&lt;/a>) which is not simple to remember, especially if it&amp;rsquo;s not something that you do often.&lt;/p>
&lt;h2 id="the-solution-lsdir">The Solution: lsdir&lt;/h2>
&lt;p>&lt;code>lsdir&lt;/code>, an alias for only listing directories, which hopefully is easier to remember.&lt;/p>
&lt;h3 id="1-open-your-zshrc-or-bashrc-file">1. Open your &lt;code>.zshrc&lt;/code> or &lt;code>.bashrc&lt;/code> file:&lt;/h3>
&lt;p>For Zsh:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-zsh" data-lang="zsh">vim ~/.zshrc
&lt;/code>&lt;/pre>&lt;/div>&lt;p>For Bash:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-zsh" data-lang="zsh">vim ~/.bashrc
&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="2-click-i-on-your-keyboard-to-go-into-editing-mode-in-vim">2. Click &lt;code>i&lt;/code> on your keyboard to go into editing mode in &lt;code>vim&lt;/code>&lt;/h3>
&lt;h3 id="3-add-the-following-line">3. Add the following line:&lt;/h3>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-zsh" data-lang="zsh">alias lsdir&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#39;ls -d */&amp;#39;&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="4-save-the-file-and-reload-your-shell-configuration">4. Save the file and reload your shell configuration:&lt;/h3>
&lt;p>For Zsh:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-zsh" data-lang="zsh">source ~/.zshrc
&lt;/code>&lt;/pre>&lt;/div>&lt;p>For Bash:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-zsh" data-lang="zsh">source ~/.bashrc
&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="5-try-it">5. Try it&lt;/h3>
&lt;figure class="image center">
&lt;a href="lsdir_cmnd.png">&lt;img src="lsdir_cmnd.png" alt="Directories listed using ls and lsdir commands">&lt;/a>
&lt;figcaption>
&lt;p>Directories listed using ls and lsdir commands&lt;/p>
&lt;/figcaption>
&lt;/figure>
&lt;p>You&amp;rsquo;re done; Happy coding! 👾&lt;/p></description></item><item><title>Stop Arrowing Up So Much In Terminal; Search Instead! (Linux/Unix)</title><link>https://hakeem-almidan.com/posts/terminal-search/</link><pubDate>Thu, 31 Dec 2020 19:01:40 +0300</pubDate><guid>https://hakeem-almidan.com/posts/terminal-search/</guid><description>&lt;h2 id="problem">Problem&lt;/h2>
&lt;p>Do you ever &lt;em>NOT&lt;/em> feel like re-writing a command that you wrote some N commands ago?
I do!&lt;/p>
&lt;p>Arrowing up and focusing until you reach what you want can be annoying for an efficient
programmer. Although it usually only takes a couple of seconds, it still adds up. Plus,
you don&amp;rsquo;t want to waste your brainpower on such a task (unless you like doing it).&lt;/p>
&lt;p>One of the best pieces of advice I heard when I first started programming is:&lt;/p>
&lt;blockquote>
&lt;p>&amp;ldquo;Always improve/automate tasks that you know you&amp;rsquo;re going to continuously repeat in the future&amp;rdquo;&lt;/p>
&lt;/blockquote>
&lt;p>So let&amp;rsquo;s do that. Let&amp;rsquo;s improve this situation.&lt;/p>
&lt;h2 id="solution">Solution&lt;/h2>
&lt;h4 id="ctrlr">Ctrl+r&lt;/h4>
&lt;p>This does a &amp;lsquo;reverse-i-search&amp;rsquo; or &amp;lsquo;bck-i-search&amp;rsquo;, which finds the most recent closest match.&lt;/p>
&lt;p>&lt;code>Ctrl+r&lt;/code> again to go to next match (further back in history).&lt;/p>
&lt;figure class="image center">
&lt;a href="ctrl-r.png">&lt;img src="ctrl-r.png" alt="Ctrl&amp;#43;r keyboard shortcut example use" width="400">&lt;/a>
&lt;figcaption>
&lt;p>Ctrl+r keyboard shortcut example use&lt;/p>
&lt;/figcaption>
&lt;/figure>
&lt;p>It searches through an environment variable called &lt;code>$HISTFILE&lt;/code>. The number of commands that
this file remembers depends on your &lt;code>$HISTSIZE&lt;/code>.&lt;/p>
&lt;p>I believe the default &lt;code>$HISTSIZE&lt;/code> in Unix/Linux is around 500. You can check yours by running:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-Bash" data-lang="Bash">$ echo $HISTSIZE
&lt;/code>&lt;/pre>&lt;/div>&lt;hr>
&lt;h4 id="alternative-approach">Alternative approach&lt;/h4>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-Bash" data-lang="Bash">$ history &lt;span style="color:#ae81ff">0&lt;/span>
&lt;span style="color:#ae81ff">0&lt;/span> echo &lt;span style="color:#e6db74">&amp;#39;example command 0&amp;#39;&lt;/span>
&lt;span style="color:#ae81ff">1&lt;/span> echo &lt;span style="color:#e6db74">&amp;#39;example command 1&amp;#39;&lt;/span>
&lt;span style="color:#ae81ff">2&lt;/span> echo &lt;span style="color:#e6db74">&amp;#39;example command 2&amp;#39;&lt;/span>
&lt;span style="color:#ae81ff">3&lt;/span> echo &lt;span style="color:#e6db74">&amp;#39;example command 3&amp;#39;&lt;/span>
...
&lt;/code>&lt;/pre>&lt;/div>&lt;p>This displays your history from 0 to &lt;code>$HISTSIZE&lt;/code>.&lt;/p>
&lt;p>You can either scroll or &lt;code>Cmd+f&lt;/code> to find your command.
To execute the command, run:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-Bash" data-lang="Bash">$ !&amp;lt;command-number&amp;gt;
&lt;/code>&lt;/pre>&lt;/div>&lt;p>&amp;hellip; where &lt;code>command-number&lt;/code> is the number displayed leftmost to your selected command.&lt;/p>
&lt;figure class="image center">
&lt;a href="history.png">&lt;img src="history.png" alt="&amp;#39;history 0&amp;#39; command example use" width="500">&lt;/a>
&lt;figcaption>
&lt;p>&amp;lsquo;history 0&amp;rsquo; command example use&lt;/p>
&lt;/figcaption>
&lt;/figure>
&lt;p>Happy coding!&lt;/p></description></item><item><title>Useful Tools that Helped in Building a Custom Promotion-Code CLI (built in Ruby)</title><link>https://hakeem-almidan.com/posts/custom-promotion-code-cli/</link><pubDate>Tue, 24 Nov 2020 21:13:02 +0300</pubDate><guid>https://hakeem-almidan.com/posts/custom-promotion-code-cli/</guid><description>&lt;h2 id="table-of-contents">Table of contents&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="#what">What&lt;/a>&lt;/li>
&lt;li>&lt;a href="#why">Why&lt;/a>&lt;/li>
&lt;li>&lt;a href="#the-tools">The Tools&lt;/a>&lt;/li>
&lt;li>&lt;a href="#show-me-the-code">Show me the code&lt;/a>&lt;/li>
&lt;/ul>
&lt;h2 id="what">What&lt;/h2>
&lt;p>This is post is going to be referring to &lt;a href="https://github.com/Hakeemmidan/custom-promotion-code-cli">this custom promotion-code generating CLI&lt;/a>&amp;rsquo;s code, and about useful tools that helped in building it. All the tools mentioned are native to Ruby (no external gems were used)&lt;/p>
&lt;p>The data generated is going to be stored in a JSON object, and has the following format:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-JSON" data-lang="JSON">&lt;span style="color:#e6db74">&amp;#34;&amp;lt;FirstName LastName&amp;gt;&amp;#34;&lt;/span>&lt;span style="color:#960050;background-color:#1e0010">:&lt;/span> {
&lt;span style="color:#f92672">&amp;#34;code&amp;#34;&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;String: Generated code&amp;#34;&lt;/span>,
&lt;span style="color:#f92672">&amp;#34;activated&amp;#34;&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;Boolean&amp;#34;&lt;/span>
}
&lt;/code>&lt;/pre>&lt;/div>&lt;p>You may think &amp;ldquo;Wait a minute there, that&amp;rsquo;s not a scalable solution, isn&amp;rsquo;t it?&amp;rdquo;&lt;/p>
&lt;p>Well, yes, ideally, the promotion codes should be directly connected to your database. But if you want a quick solution, this should be fine&lt;/p>
&lt;p>Also, keep in mind that this is not storing your main data. It&amp;rsquo;s just storing the promotion codes and checking
whether they&amp;rsquo;re activated or not. It has a constant (O(1)) lookup and write time-complexity, and can hold an awful lot of data. Approximately, a JSON file can hold about &lt;a href="https://stackoverflow.com/a/60300454/7974948">18 quintillion characters&lt;/a>. For context: &amp;ldquo;Harry Potter and the Deathly Hallows&amp;rdquo; has &lt;a href="https://docs.google.com/document/d/1gIMVTGfHAODR_1CUjLpM_4Uzrrs3BLzt9IRq2rLK8-0/edit?usp=sharing">about 1 million characters&lt;/a>. So, in total, a JSON file would hold about &lt;em>13 trillion&lt;/em> copies of that book. That&amp;rsquo;s a lot!&lt;/p>
&lt;figure class="image center">
&lt;a href="prm-cli-screenshot.png">&lt;img src="prm-cli-screenshot.png" alt="Screenshot of promotional code generator CLI">&lt;/a>
&lt;figcaption>
&lt;p>Screenshot of promotional code generator CLI&lt;/p>
&lt;/figcaption>
&lt;/figure>
&lt;h2 id="why">Why&lt;/h2>
&lt;p>&amp;ldquo;Why should I bother with creating a &lt;em>custom&lt;/em> promotion-code generator?&amp;rdquo;&lt;/p>
&lt;p>As you may know, promotional codes are typically used in stores, offline and online, to drive traffic.
Generally speaking, general promotion codes (ones not mapped to a specific person), don&amp;rsquo;t need to be unique.
In fact, you want them to be generic to drive as much traffic to your store as possible. They should be easy to guess and could be safely made up by humans&lt;/p>
&lt;p>Customized promotion codes, on the other hand, though intended to also drive traffic, have another sole purpose. The main purpose of them should be to get specific people onto your platform&lt;/p>
&lt;p>Understanding that these codes are made for specific people, you want them to be harder to guess. That is because we don&amp;rsquo;t want some imposter claiming our invitees' rewards&lt;/p>
&lt;p>Hope that makes sense. If not, feel free to drop a comment&lt;/p>
&lt;h2 id="the-tools">The Tools&lt;/h2>
&lt;h3 id="1-kernelputshttpsruby-docorgcore-270kernelhtmlmethod-i-puts">1. &lt;a href="https://ruby-doc.org/core-2.7.0/Kernel.html#method-i-puts">Kernel#puts&lt;/a>&lt;/h3>
&lt;p>Prints string on single line (doesn&amp;rsquo;t allow other stuff to get printed on same line)&lt;/p>
&lt;p>Example:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-Ruby" data-lang="Ruby">puts &lt;span style="color:#e6db74">&amp;#39;Hello&amp;#39;&lt;/span>
puts &lt;span style="color:#e6db74">&amp;#39;world&amp;#39;&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Output:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-shell" data-lang="shell">Hello
World
&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="2-kernelgetshttpsapidockcomrubykernelgets-and-stringchomphttpsruby-docorgcore-250stringhtmlmethod-i-chomp">2. &lt;a href="https://apidock.com/ruby/Kernel/gets">Kernel#gets&lt;/a> and &lt;a href="https://ruby-doc.org/core-2.5.0/String.html#method-i-chomp">String#chomp&lt;/a>&lt;/h3>
&lt;p>&lt;code>gets&lt;/code>: Takes input from shell&lt;/p>
&lt;p>&lt;code>chomp&lt;/code>: Takes off newline character (&lt;code>&amp;quot;\n&amp;quot;&lt;/code>) off from end of string. This character gets generated when user hits the &lt;code>enter&lt;/code> key&lt;/p>
&lt;p>Put together because they are often used together. Just having &lt;code>Kernel#gets&lt;/code> will leave you with a string with &lt;code>&amp;quot;\n&amp;quot;&lt;/code> at the end of it&lt;/p>
&lt;p>The following example uses both to avoid that&lt;/p>
&lt;p>Example:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-Ruby" data-lang="Ruby">puts &lt;span style="color:#e6db74">&amp;#39;Please say something: &amp;#39;&lt;/span>
answer &lt;span style="color:#f92672">=&lt;/span> gets&lt;span style="color:#f92672">.&lt;/span>chomp
puts answer
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Output:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-shell" data-lang="shell">$ Please say something: Hello
Hello
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Note: The project referred to in this post doesn&amp;rsquo;t use &lt;code>gets.chomp&lt;/code> and uses
&lt;code>Readline&lt;/code> (&lt;a href="#3-readlinereadlinefile-name-refer-to-history-boolhttpsruby-docorgstdlib-251libdocreadlinerdocreadlinehtmlmethod-c-readline">#3&lt;/a>) instead. That is since &lt;code>Readline&lt;/code> provides autocompletion, history reference, and other useful functionalities. But &lt;code>gets.chomp&lt;/code> could be useful for getting simple input in some
instances. So it&amp;rsquo;s worth the mention&lt;/p>
&lt;h3 id="3-readlinereadlinefile-name-refer-to-history-boolhttpsruby-docorgstdlib-251libdocreadlinerdocreadlinehtmlmethod-c-readline">3. &lt;a href="https://ruby-doc.org/stdlib-2.5.1/libdoc/readline/rdoc/Readline.html#method-c-readline">Readline::readline(&amp;lt;file name&amp;gt;, &amp;lt;refer to history bool&amp;gt;)&lt;/a>&lt;/h3>
&lt;p>Takes input from shell. Takes off newline character (&lt;code>&amp;quot;\n&amp;quot;&lt;/code>) automatically&lt;/p>
&lt;p>Second argument takes boolean to flag whether to remember history or not.
If you set to &lt;code>true&lt;/code>, it will remember previous answers from same file-run session&lt;/p>
&lt;p>Example:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-Ruby" data-lang="Ruby">require &lt;span style="color:#e6db74">&amp;#39;readline&amp;#39;&lt;/span>
answer &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#66d9ef">Readline&lt;/span>&lt;span style="color:#f92672">.&lt;/span>readline(&lt;span style="color:#e6db74">&amp;#39;Please say something: &amp;#39;&lt;/span>, &lt;span style="color:#66d9ef">true&lt;/span>)
puts answer
answer &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#66d9ef">Readline&lt;/span>&lt;span style="color:#f92672">.&lt;/span>readline(&lt;span style="color:#e6db74">&amp;#39;Please say something: &amp;#39;&lt;/span>, &lt;span style="color:#66d9ef">true&lt;/span>)
puts answer
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Output:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-shell" data-lang="shell">$ Please say something: Hello
Hello
$ Please say something: &lt;span style="color:#f92672">[&lt;/span>*click up-arrow*&lt;span style="color:#f92672">]&lt;/span>
$ Please say something: Hello
Hello
&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="4-readlinecompletion_proc--prochttpsruby-docorgstdlib-251libdocreadlinerdocreadlinehtmlmethod-c-completion_proc">4. &lt;a href="https://ruby-doc.org/stdlib-2.5.1/libdoc/readline/rdoc/Readline.html#method-c-completion_proc">Readline::completion_proc = &amp;lt;proc&amp;gt;&lt;/a>&lt;/h3>
&lt;p>Adds autocompletion functionality based on given proc&lt;/p>
&lt;p>Example:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-Ruby" data-lang="Ruby">require &lt;span style="color:#e6db74">&amp;#39;readline&amp;#39;&lt;/span>
&lt;span style="color:#66d9ef">LIST&lt;/span> &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#f92672">[&lt;/span>&lt;span style="color:#e6db74">&amp;#39;action&amp;#39;&lt;/span>, &lt;span style="color:#e6db74">&amp;#39;bear&amp;#39;&lt;/span>, &lt;span style="color:#e6db74">&amp;#39;computer&amp;#39;&lt;/span>&lt;span style="color:#f92672">]&lt;/span>
comp &lt;span style="color:#f92672">=&lt;/span> proc { &lt;span style="color:#f92672">|&lt;/span>s&lt;span style="color:#f92672">|&lt;/span> &lt;span style="color:#66d9ef">LIST&lt;/span>&lt;span style="color:#f92672">.&lt;/span>grep(&lt;span style="color:#e6db74">/^&lt;/span>&lt;span style="color:#e6db74">#{&lt;/span>&lt;span style="color:#66d9ef">Regexp&lt;/span>&lt;span style="color:#f92672">.&lt;/span>escape(s)&lt;span style="color:#e6db74">}&lt;/span>&lt;span style="color:#e6db74">/&lt;/span>) }
&lt;span style="color:#66d9ef">Readline&lt;/span>&lt;span style="color:#f92672">.&lt;/span>completion_proc &lt;span style="color:#f92672">=&lt;/span> comp
&lt;span style="color:#66d9ef">Readline&lt;/span>&lt;span style="color:#f92672">.&lt;/span>readline(&lt;span style="color:#e6db74">&amp;#39;&amp;#39;&lt;/span>, &lt;span style="color:#66d9ef">true&lt;/span>)
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Output:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-shell" data-lang="shell">$ co&lt;span style="color:#f92672">[&lt;/span>*click on tab*&lt;span style="color:#f92672">]&lt;/span>
$ computer
&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="5-stringdowncasehttpsruby-docorgcore-250stringhtmlmethod-i-downcase">5. &lt;a href="https://ruby-doc.org/core-2.5.0/String.html#method-i-downcase">String#downcase&lt;/a>&lt;/h3>
&lt;p>Lower-cases a string&lt;/p>
&lt;p>Useful for keeping data format consistent&lt;/p>
&lt;p>Example:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-Ruby" data-lang="Ruby">puts &lt;span style="color:#e6db74">&amp;#39;HELLO WORLD&amp;#39;&lt;/span>&lt;span style="color:#f92672">.&lt;/span>downcase
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Output:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-shell" data-lang="shell">hello world
&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="6stringstriphttpsruby-docorgcore-250stringhtmlmethod-i-strip">6.&lt;a href="https://ruby-doc.org/core-2.5.0/String.html#method-i-strip">String#strip&lt;/a>&lt;/h3>
&lt;p>Takes off whitespace from beginning and end of string&lt;/p>
&lt;p>Useful for keeping data format consistent&lt;/p>
&lt;p>Example:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-Ruby" data-lang="Ruby">puts &lt;span style="color:#e6db74">&amp;#39; hi there &amp;#39;&lt;/span>&lt;span style="color:#f92672">.&lt;/span>strip
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Output:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-shell" data-lang="shell">hi there
&lt;/code>&lt;/pre>&lt;/div>&lt;p>(I know it doesn&amp;rsquo;t show up there, but there should be no white spaces at the ends of the string)&lt;/p>
&lt;h3 id="7-ioreadfile-namehttpsruby-docorgcore-251iohtmlmethod-c-read">7. &lt;a href="https://ruby-doc.org/core-2.5.1/IO.html#method-c-read">IO.read(&amp;lt;file name&amp;gt;)&lt;/a>&lt;/h3>
&lt;p>Reads file content and returns it as string&lt;/p>
&lt;p>Example:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-Ruby" data-lang="Ruby">file_content &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#66d9ef">IO&lt;/span>&lt;span style="color:#f92672">.&lt;/span>read(&lt;span style="color:#e6db74">&amp;#39;data.json&amp;#39;&lt;/span>)
puts file_content
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Output:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-shell" data-lang="shell">&lt;span style="color:#e6db74">&amp;#34;{\&amp;#34;some key\&amp;#34;: \&amp;#34;some value\&amp;#34;}&amp;#34;&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="8-jsonparsejson-stringhttpsruby-docorgstdlib-272libdocjsonrdocjsonhtmlmethod-i-parse">8. &lt;a href="https://ruby-doc.org/stdlib-2.7.2/libdoc/json/rdoc/JSON.html#method-i-parse">JSON#parse(&amp;lt;json string&amp;gt;)&lt;/a>&lt;/h3>
&lt;p>Converts JSON string to JSON object&lt;/p>
&lt;p>Example:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-Ruby" data-lang="Ruby">require &lt;span style="color:#e6db74">&amp;#39;json&amp;#39;&lt;/span>
puts &lt;span style="color:#66d9ef">JSON&lt;/span>&lt;span style="color:#f92672">.&lt;/span>parse(&lt;span style="color:#e6db74">&amp;#34;{&lt;/span>&lt;span style="color:#ae81ff">\&amp;#34;&lt;/span>&lt;span style="color:#e6db74">some key&lt;/span>&lt;span style="color:#ae81ff">\&amp;#34;&lt;/span>&lt;span style="color:#e6db74">: &lt;/span>&lt;span style="color:#ae81ff">\&amp;#34;&lt;/span>&lt;span style="color:#e6db74">some value&lt;/span>&lt;span style="color:#ae81ff">\&amp;#34;&lt;/span>&lt;span style="color:#e6db74">}&amp;#34;&lt;/span>)
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Output:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-shell" data-lang="shell">&lt;span style="color:#f92672">{&lt;/span>&lt;span style="color:#e6db74">&amp;#34;some key&amp;#34;&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;some value&amp;#34;&lt;/span>&lt;span style="color:#f92672">}&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="9-jsondumpjson-stringhttpsruby-docorgstdlib-272libdocjsonrdocjsonhtmlmethod-i-dump">9. &lt;a href="https://ruby-doc.org/stdlib-2.7.2/libdoc/json/rdoc/JSON.html#method-i-dump">JSON#dump(&amp;lt;json string&amp;gt;)&lt;/a>&lt;/h3>
&lt;p>Converts JSON object to JSON string&lt;/p>
&lt;p>Example:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-Ruby" data-lang="Ruby">require &lt;span style="color:#e6db74">&amp;#39;json&amp;#39;&lt;/span>
puts &lt;span style="color:#66d9ef">JSON&lt;/span>&lt;span style="color:#f92672">.&lt;/span>dump({&lt;span style="color:#e6db74">&amp;#34;some key&amp;#34;&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;some value&amp;#34;&lt;/span>})
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Output:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-shell" data-lang="shell">&lt;span style="color:#e6db74">&amp;#34;{\&amp;#34;some key\&amp;#34;: \&amp;#34;some value\&amp;#34;}&amp;#34;&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="10-fileopenfile-name-w-file-changes-to-file-httpsruby-docorgstdlib-272libdocjsonrdocjsonhtmlmethod-i-dump">10. &lt;a href="https://ruby-doc.org/stdlib-2.7.2/libdoc/json/rdoc/JSON.html#method-i-dump">File::Open(&amp;lt;file name&amp;gt;, &amp;lsquo;w&amp;rsquo;) {|file| &amp;lt;changes to file&amp;gt;} &lt;/a>&lt;/h3>
&lt;p>Opens and writes data to file (writing automatically gets it saved)&lt;/p>
&lt;p>Example:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-Ruby" data-lang="Ruby">require &lt;span style="color:#e6db74">&amp;#39;json&amp;#39;&lt;/span>
file_name &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#39;data.json&amp;#39;&lt;/span>
new_data &lt;span style="color:#f92672">=&lt;/span> {&lt;span style="color:#e6db74">&amp;#34;some new key&amp;#34;&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;some new value&amp;#34;&lt;/span>}
&lt;span style="color:#66d9ef">File&lt;/span>&lt;span style="color:#f92672">.&lt;/span>open(file_name,&lt;span style="color:#e6db74">&amp;#39;w&amp;#39;&lt;/span>){ &lt;span style="color:#f92672">|&lt;/span>file&lt;span style="color:#f92672">|&lt;/span> &lt;span style="color:#66d9ef">JSON&lt;/span>&lt;span style="color:#f92672">.&lt;/span>dump(new_data, file) }
json &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#66d9ef">JSON&lt;/span>&lt;span style="color:#f92672">.&lt;/span>parse(&lt;span style="color:#66d9ef">IO&lt;/span>&lt;span style="color:#f92672">.&lt;/span>read(file_name))
puts json
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Output:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-shell" data-lang="shell">&lt;span style="color:#f92672">{&lt;/span>&lt;span style="color:#e6db74">&amp;#34;some key&amp;#34;&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;some value&amp;#34;&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;some new key&amp;#34;&lt;/span>: &lt;span style="color:#e6db74">&amp;#34;some new value&amp;#34;&lt;/span>&lt;span style="color:#f92672">}&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="bonus">Bonus:&lt;/h3>
&lt;h3 id="11-ecolor-numbermsome-stringe0mhttpsenwikipediaorgwikiansi_escape_codecolors">11. &lt;a href="https://en.wikipedia.org/wiki/ANSI_escape_code#Colors">&amp;quot;\e[#{&amp;lt;color number&amp;gt;}m#{&amp;lt;some string&amp;gt;}\e[0m&amp;quot;&lt;/a>&lt;/h3>
&lt;p>Changes color of string in shell based on &lt;a href="https://en.wikipedia.org/wiki/ANSI_escape_code#Colors">ANSI escape code&lt;/a> FG Code number&lt;/p>
&lt;p>Example:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-Ruby" data-lang="Ruby">str &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#39;Hello world&amp;#39;&lt;/span>
color_num &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#ae81ff">36&lt;/span> &lt;span style="color:#75715e"># cyan&lt;/span>
puts &lt;span style="color:#e6db74">&amp;#34;&lt;/span>&lt;span style="color:#ae81ff">\e&lt;/span>&lt;span style="color:#e6db74">[&lt;/span>&lt;span style="color:#e6db74">#{&lt;/span>color_num&lt;span style="color:#e6db74">}&lt;/span>&lt;span style="color:#e6db74">m&lt;/span>&lt;span style="color:#e6db74">#{&lt;/span>str&lt;span style="color:#e6db74">}&lt;/span>&lt;span style="color:#ae81ff">\e&lt;/span>&lt;span style="color:#e6db74">[0m&amp;#34;&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Output:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-Shell" data-lang="Shell">
&lt;span style="color:#00aaaa">Hello world&lt;/span>
&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="show-me-the-code">Show me the code&lt;/h2>
&lt;p>Here&amp;rsquo;s &lt;a href="https://github.com/Hakeemmidan/custom-promotion-code-cli">the link&lt;/a> to the repo&lt;/p>
&lt;p>If you plan to create a similar tool, I suggest scanning around the &lt;a href="https://github.com/Hakeemmidan/custom-promotion-code-cli">repo&lt;/a> (same link). It&amp;rsquo;s basically 4 files of Ruby code, and none of them exceed 100 lines. Hope that helps&lt;/p>
&lt;p>Happy coding!&lt;/p></description></item><item><title>Why do puffins often have mutliple fish in their beaks at once?</title><link>https://hakeem-almidan.com/posts/puffin-multiple-fish-in-beak-wonder/</link><pubDate>Fri, 24 Jul 2020 21:07:40 +0300</pubDate><guid>https://hakeem-almidan.com/posts/puffin-multiple-fish-in-beak-wonder/</guid><description>&lt;p>Have you ever noticed that puffins often simultaneously carry multiple fish in their beaks at once?&lt;/p>
&lt;p>It&amp;rsquo;d be something like this:
&lt;figure class="image center u-filter-almost-black-and-white">
&lt;a href="puffin-w-fish-in-mouth.jpg">&lt;img src="puffin-w-fish-in-mouth.jpg" alt="Puffin with multiple fish in beak">&lt;/a>
&lt;figcaption>
&lt;p>Puffin with multiple fish in beak (&lt;a href="https://ocean.si.edu/ocean-life/seabirds/watching-fish-puffins-beak">Source&lt;/a>)&lt;/p>
&lt;/figcaption>
&lt;/figure>
&lt;/p>
&lt;p>I thought this was interesting, and I had so many questions, including:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="#do-they-catch-them-all-in-one-scoop">Do they catch them all in one scoop?&lt;/a>&lt;/li>
&lt;li>&lt;a href="#how-come-the-fish-are-so-organized">How come the fish are so organized?&lt;/a>&lt;/li>
&lt;li>&lt;a href="#do-they-hide-their-food-while-catching-other-fish-why-do-other-birds-not-steal-them">Do they hide their food while catching other fish?&lt;/a>&lt;/li>
&lt;li>&lt;a href="#is-this-a-flex">Is this a &amp;lsquo;flex&amp;rsquo;?&lt;/a>&lt;/li>
&lt;li>&lt;a href="#what-type-of-fish-do-they-mostly-catch">What type of fish do they mostly catch?&lt;/a>&lt;/li>
&lt;li>&lt;a href="#the-why">The why&lt;/a>&lt;/li>
&lt;li>&lt;a href="#conclusion">Conclusion&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>Below, I attempt to answer each question (for Atlantic Puffins specifically).&lt;/p>
&lt;hr>
&lt;h3 id="do-they-catch-them-all-in-one-scoop">Do they catch them all in one scoop?&lt;/h3>
&lt;p>According to this &lt;a href="https://www.int-res.com/abstracts/meps/v520/p257-267/">Oxford University study&lt;/a>, the answer is no. Puffins make multiple dives per hunt (a.k.a. bout), catching about 1 fish in each dive. They average about 25 dives per hunt.&lt;/p>
&lt;hr>
&lt;h3 id="how-come-the-fish-are-so-organized">How come the fish are so organized?&lt;/h3>
&lt;p>According to BBC, in &lt;a href="https://www.bbc.co.uk/programmes/articles/3DlgWjmWQg2qBYLY1J0vFgN/thirteen-proper-puffin-facts">this article&lt;/a>, puffins stack fish in their beaks using a combination of their tongue and beaks.&lt;/p>
&lt;p>Their beaks contain &amp;lsquo;tentacles&amp;rsquo;, which are like small teeth that keep the fish in place. And they use their tongues to push up existing fish while opening their mouths to catch new ones.&lt;/p>
&lt;hr>
&lt;h3 id="do-they-hide-their-food-while-catching-other-fish">Do they hide their food while catching other fish?&lt;/h3>
&lt;p>No, they mostly just keep it in their beaks.&lt;/p>
&lt;hr>
&lt;h3 id="is-this-a-flex">Is this a &amp;lsquo;flex&amp;rsquo;?&lt;/h3>
&lt;p>It doesn&amp;rsquo;t seem like it. Their &lt;a href="https://en.wikipedia.org/wiki/Atlantic_puffin#Reproduction">mating/courtship protocol&lt;/a> doesn&amp;rsquo;t usually involve fish. But since I haven&amp;rsquo;t found too much evidence of that, I&amp;rsquo;d say that&amp;rsquo;s up for investigation!&lt;/p>
&lt;hr>
&lt;h3 id="what-type-of-fish-do-they-mostly-catch">What type of fish do they mostly catch?&lt;/h3>
&lt;p>According to this &lt;a href="https://www.int-res.com/abstracts/meps/v520/p257-267/">Oxford University study&lt;/a>, they mostly feed on &lt;a href="https://en.wikipedia.org/wiki/Sand_eel">sand eel&lt;/a>.&lt;/p>
&lt;hr>
&lt;h3 id="the-why">The why&lt;/h3>
&lt;p>According to &lt;a href="https://brill.com/view/journals/beh/40/3-4/article-p263_4.xml">this study in Iceland&lt;/a> and &lt;a href="https://www.bbc.co.uk/programmes/articles/3DlgWjmWQg2qBYLY1J0vFgN/thirteen-proper-puffin-facts">this BBC article&lt;/a>, other birds, such as &lt;a href="https://en.wikipedia.org/wiki/Skua">Skuas&lt;/a> and &lt;a href="https://en.wikipedia.org/wiki/Gull">Gulls (aka Seagulls)&lt;/a> would literally try to steal the fish off of the Puffins' mouths. And if some fish fall, these two birds, or other birds, would get it.&lt;/p>
&lt;p>So the short answer is: &lt;strong>They keep it in their mouths to keep it safe for their children.&lt;/strong>&lt;/p>
&lt;p>Interestingly, Puffins &lt;a href="https://www.worldwildlife.org/blogs/good-nature-travel/posts/ten-high-flying-facts-about-puffins#:~:text=Puffins%20lay%20just%20one%20egg,and%20caring%20for%20the%20chick.">only lay one egg a year&lt;/a>. So they have to be extra careful with that food.&lt;/p>
&lt;p>It&amp;rsquo;s kind of heroic; they&amp;rsquo;re fighting for their baby&amp;rsquo;s (singular) life. They could just eat the fish and abandon their baby/chick, but they choose not to. It&amp;rsquo;s also worth mentioning that puffins are tiny, they&amp;rsquo;re smaller than a Subway sandwich (&lt;a href="https://www.birders-store.co.uk/the-north-american-bird-guide-2nd-edition.html">11 inches tall&lt;/a>), and weigh less than a soda can (&lt;a href="https://www.birders-store.co.uk/the-north-american-bird-guide-2nd-edition.html">380 g&lt;/a>). So &lt;a href="https://www.youtube.com/watch?v=r777dlf7wRM">other birds can really mess them up&lt;/a>. Which makes this whole thing even more heroic.&lt;/p>
&lt;p>I understand that this is a childlike view, if you look at it from a scientific view, they&amp;rsquo;re just keeping their species from going extinct. But I guess we could still learn a thing or two from them.&lt;/p>
&lt;hr>
&lt;h3 id="conclusion">Conclusion&lt;/h3>
&lt;p>Puffins feed on Sea Eels (fish) and carry a bunch of them around either for themselves or for their chick (they lay one egg a year). Because it would be too dangerous to leave it on the ground otherwise.&lt;/p>
&lt;p>They sound like great parents and deserve a round of &lt;a href="https://en.wikipedia.org/wiki/Ululation">Ululation&lt;/a>. Kolololoooosh&lt;/p>
&lt;hr>
&lt;h3 id="side-note">Side note:&lt;/h3>
&lt;p>While looking into this, I found out that there&amp;rsquo;s another type of bird that stacks fish in their beak! The bird&amp;rsquo;s name is the Razorbill (a.k.a. Alca torda). Here is a picture of it carrying fish like a puffin:&lt;/p>
&lt;figure class="image center u-filter-almost-black-and-white">
&lt;a href="razorbill-w-fish-in-mouth.jpg">&lt;img src="razorbill-w-fish-in-mouth.jpg" alt="Razorbill with multiple fish in beak">&lt;/a>
&lt;figcaption>
&lt;p>Razorbill with multiple fish in beak (&lt;a href="http://www.oiseaux-birds.com/page-family-alcidae.html">Source&lt;/a>)&lt;/p>
&lt;/figcaption>
&lt;/figure>
&lt;p>But according to &lt;a href="https://www.int-res.com/abstracts/meps/v520/p257-267/">this study&lt;/a> (the same Oxford study mentioned above) puffins do tend to carry more fish overall. Razorbills can carry 2 to 10 fish, whereas puffins can carry up to 50!&lt;/p></description></item><item><title>SCSS Animation Mixin</title><link>https://hakeem-almidan.com/posts/scss-animation-mixin/</link><pubDate>Tue, 05 May 2020 17:15:02 -0700</pubDate><guid>https://hakeem-almidan.com/posts/scss-animation-mixin/</guid><description>&lt;h2 id="problem">Problem&lt;/h2>
&lt;p>The slightest change in CSS animations (&lt;code>@keyframes&lt;/code>) requires a creation of a new animation.&lt;/p>
&lt;h4 id="problem-example">Problem Example&lt;/h4>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-SCSS" data-lang="SCSS">&lt;span style="color:#66d9ef">@keyframes&lt;/span> &lt;span style="color:#f92672">to-yellow&lt;/span> {
&lt;span style="color:#f92672">50&lt;/span>&lt;span style="color:#960050;background-color:#1e0010">%&lt;/span> { &lt;span style="color:#f92672">background-color&lt;/span>&lt;span style="color:#a6e22e">:&lt;/span> &lt;span style="color:#f92672">yellow&lt;/span>; }
}
&lt;span style="color:#66d9ef">@keyframes&lt;/span> &lt;span style="color:#f92672">to-skyblue&lt;/span> {
&lt;span style="color:#f92672">50&lt;/span>&lt;span style="color:#960050;background-color:#1e0010">%&lt;/span> { &lt;span style="color:#f92672">background-color&lt;/span>&lt;span style="color:#a6e22e">:&lt;/span> &lt;span style="color:#f92672">skyblue&lt;/span>; }
}
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Both of the animations pretty much do the same thing, but we had to create two of them.
We had to create two of them because their property (&lt;code>background-color&lt;/code>) had different values (i.e. &lt;code>yellow&lt;/code> and &lt;code>skyblue&lt;/code>).&lt;/p>
&lt;p>This doesn&amp;rsquo;t follow the &lt;a href="https://en.wikipedia.org/wiki/Don%27t_repeat_yourself">DRY&lt;/a> software development principle.&lt;/p>
&lt;p>To fix this, we&amp;rsquo;re going to use an SCSS &lt;a href="https://sass-lang.com/documentation/at-rules/mixin">mixin&lt;/a>.&lt;/p>
&lt;h2 id="solution">Solution&lt;/h2>
&lt;p>Looking at the problem example above, we&amp;rsquo;d replace it with something like this:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-SCSS" data-lang="SCSS">&lt;span style="color:#66d9ef">@mixin&lt;/span>&lt;span style="color:#a6e22e"> animation-mixin&lt;/span>($name&lt;span style="color:#f92672">,&lt;/span> $color-var) {
&lt;span style="color:#66d9ef">@keyframes&lt;/span> #{&lt;span style="color:#960050;background-color:#1e0010">$&lt;/span>&lt;span style="color:#f92672">name&lt;/span>} {
&lt;span style="color:#f92672">50&lt;/span>&lt;span style="color:#960050;background-color:#1e0010">%&lt;/span> { &lt;span style="color:#f92672">background-color&lt;/span>&lt;span style="color:#a6e22e">:&lt;/span> &lt;span style="color:#960050;background-color:#1e0010">$&lt;/span>&lt;span style="color:#f92672">color-var&lt;/span>; }
}
}
&lt;span style="color:#66d9ef">@include&lt;/span>&lt;span style="color:#a6e22e"> animation-mixin&lt;/span>(to-yellow&lt;span style="color:#f92672">,&lt;/span> yellow);
&lt;span style="color:#66d9ef">@include&lt;/span>&lt;span style="color:#a6e22e"> animation-mixin&lt;/span>(to-skyblue&lt;span style="color:#f92672">,&lt;/span> skyblue);
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Then you could call the &lt;code>to-yellow&lt;/code> and &lt;code>to-skyblue&lt;/code> animations in your selectors as needed:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-SCSS" data-lang="SCSS">&lt;span style="color:#f92672">div&lt;/span> {
&lt;span style="color:#f92672">height&lt;/span>&lt;span style="color:#a6e22e">:&lt;/span> &lt;span style="color:#f92672">100px&lt;/span>;
&lt;span style="color:#f92672">width&lt;/span>&lt;span style="color:#a6e22e">:&lt;/span> &lt;span style="color:#f92672">100px&lt;/span>;
&lt;span style="color:#f92672">background-color&lt;/span>&lt;span style="color:#a6e22e">:&lt;/span> &lt;span style="color:#f92672">whitesmoke&lt;/span>;
&lt;span style="color:#f92672">animation&lt;/span>&lt;span style="color:#a6e22e">:&lt;/span> &lt;span style="color:#f92672">to-yellow&lt;/span> &lt;span style="color:#f92672">4s&lt;/span> &lt;span style="color:#f92672">ease&lt;/span> &lt;span style="color:#f92672">infinite&lt;/span>;
}
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Live example:&lt;/p>
&lt;!-- raw HTML omitted -->
&lt;p class="codepen" data-height="265" data-theme-id="dark" data-default-tab="css,result" data-user="Hakeemmidan" data-slug-hash="OJPaezR" style="height: 265px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;" data-pen-title="SCSS Animation Mixin">
&lt;span>See the Pen &lt;a href="https://codepen.io/Hakeemmidan/pen/OJPaezR">
SCSS Animation Mixin&lt;/a> by Abdulhakeem Almidan (&lt;a href="https://codepen.io/Hakeemmidan">@Hakeemmidan&lt;/a>)
on &lt;a href="https://codepen.io">CodePen&lt;/a>.&lt;/span>
&lt;/p>
&lt;script async src="https://static.codepen.io/assets/embed/ei.js">&lt;/script></description></item><item><title>How to Prevent CSS Hover State From Getting stuck on Mobile Browsers</title><link>https://hakeem-almidan.com/posts/css-hover-on-mobile/</link><pubDate>Thu, 16 Apr 2020 21:58:27 -0700</pubDate><guid>https://hakeem-almidan.com/posts/css-hover-on-mobile/</guid><description>&lt;h2 id="problem">Problem&lt;/h2>
&lt;p>The CSS hover state often gets stuck on mobile (touch screen) browsers. It would be something like this:&lt;/p>
&lt;figure class="image center">
&lt;a href="example-sticky-hover.gif">&lt;img src="example-sticky-hover.gif" alt="GIF of clicking on link and css hover state getting stuck">&lt;/a>
&lt;figcaption>
&lt;p>Hover state getting stuck on-click on mobile&lt;/p>
&lt;/figcaption>
&lt;/figure>
&lt;h2 id="solution">Solution&lt;/h2>
&lt;p>Using the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/hover">&amp;lsquo;hover&amp;rsquo; CSS media query&lt;/a>, which could be applied either through SCSS or CSS. In the case of SCSS, we&amp;rsquo;re going to use a &lt;a href="https://sass-lang.com/documentation/at-rules/mixin">mixin&lt;/a>.&lt;/p>
&lt;p>Here is each solution respectively:&lt;/p>
&lt;h3 id="option-1-scss-mixin">Option 1: SCSS Mixin&lt;/h3>
&lt;p>The mixin:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-SCSS" data-lang="SCSS">&lt;span style="color:#66d9ef">@mixin&lt;/span>&lt;span style="color:#a6e22e"> hover-supported&lt;/span> {
&lt;span style="color:#66d9ef">@media&lt;/span> (hover&lt;span style="color:#f92672">:&lt;/span> hover) {
&lt;span style="color:#66d9ef">@content&lt;/span>;
}
}
&lt;/code>&lt;/pre>&lt;/div>&lt;p>Example use:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-SCSS" data-lang="SCSS"> &lt;span style="color:#a6e22e">.example&lt;/span> {
&lt;span style="color:#66d9ef">@include&lt;/span>&lt;span style="color:#a6e22e"> hover-supported&lt;/span>() {
&lt;span style="color:#66d9ef">&amp;amp;&lt;/span>&lt;span style="color:#a6e22e">:hover&lt;/span> {
&lt;span style="color:#f92672">background-color&lt;/span>&lt;span style="color:#a6e22e">:&lt;/span> &lt;span style="color:#f92672">black&lt;/span>;
}
}
}
&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="option-2-css">Option 2: CSS&lt;/h3>
&lt;p>Example use:&lt;/p>
&lt;div class="highlight">&lt;pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4">&lt;code class="language-CSS" data-lang="CSS"> @&lt;span style="color:#66d9ef">media&lt;/span> &lt;span style="color:#f92672">(&lt;/span>&lt;span style="color:#f92672">hover&lt;/span>&lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#f92672">hover&lt;/span>&lt;span style="color:#f92672">)&lt;/span> {
.&lt;span style="color:#a6e22e">example&lt;/span>:&lt;span style="color:#a6e22e">hover&lt;/span> {
&lt;span style="color:#66d9ef">background-color&lt;/span>: &lt;span style="color:#66d9ef">black&lt;/span>;
}
}
&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="explanation">Explanation&lt;/h3>
&lt;p>Both examples change the &lt;code>background-color&lt;/code> of HTML elements with class &lt;code>example&lt;/code>
only when they&amp;rsquo;re hovered-over on non-touch screen devices (or any &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/hover">hover&lt;/a>
supported device). In short, &lt;em>this applies hover styling on only non-touch screen devices&lt;/em>.&lt;/p>
&lt;p>PS: I&amp;rsquo;m not sure how this would act on touch-screen laptops.&lt;/p></description></item><item><title>Choosing a Static Website Generator: Hugo vs. Jekyll</title><link>https://hakeem-almidan.com/posts/hugo-vs-jekyll/</link><pubDate>Mon, 23 Mar 2020 23:37:28 -0700</pubDate><guid>https://hakeem-almidan.com/posts/hugo-vs-jekyll/</guid><description>&lt;h2 id="what-are-static-websites">What are static websites?&lt;/h2>
&lt;p>In simple terms, static websites are a collection of webpages that have fixed content. They are the most basic type of website and are typically considered the easiest to create.&lt;/p>
&lt;p>These websites are considered the easiest to create because they have a low barrier of entry. They usually are not connected to a &lt;a href="https://en.wikipedia.org/wiki/Data_access_layer">backend&lt;/a> or a &lt;a href="https://en.wikipedia.org/wiki/Database">database&lt;/a>, so the only thing that you need to manage is the &lt;a href="https://en.wikipedia.org/wiki/Presentation_layer">frontend&lt;/a>.&lt;/p>
&lt;p>Given that information, static websites look essentially the same for all users (because you wouldn&amp;rsquo;t have user data to customize their experience). User data, like emails and &lt;a href="https://en.wikipedia.org/wiki/Digest_access_authentication">password digests&lt;/a>, need a database for storage and are considered unsafe to store in the frontend.&lt;/p>
&lt;h2 id="why-pick-a-static-website-over-a-regular-dynamic-website">Why pick a static website over a &amp;lsquo;regular&amp;rsquo;, dynamic website?&lt;/h2>
&lt;p>Although static websites are cool and all, why should one choose them over dynamic (a.k.a. full-stack) websites? Here are the advantages that a static website holds over a dynamic one (generally speaking):&lt;/p>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>Faster:&lt;/strong> Since static websites don&amp;rsquo;t have a backend or a database, all the &lt;a href="https://en.wikipedia.org/wiki/Web_hosting_service">web hosting server&lt;/a> has to do is serve the needed file. There will be no API calls to retrieve data from the database, so you&amp;rsquo;re less likely to see any loading signs.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Cheaper:&lt;/strong> Hosting static websites is mostly free. They can be hosted on free web hosting services such as &lt;a href="https://pages.github.com/">GitHub Pages&lt;/a>, &lt;a href="https://www.netlify.com/">Netlify&lt;/a>, and others. The only cost that you&amp;rsquo;re likely to face is for a custom domain name, and that&amp;rsquo;s optional.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Safer:&lt;/strong> Since there&amp;rsquo;s no backend or database, your site is less likely to be breached for private data. There&amp;rsquo;s no opportunity to perform &lt;a href="https://en.wikipedia.org/wiki/SQL_injection">SQL injection&lt;/a> and similar database attacks. I think it&amp;rsquo;s good practice to assume that anything stored in your static website will be available to the public.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;h2 id="when-should-i-choose-a-static-website-over-a-dynamic-one">When should I choose a static website over a dynamic one?&lt;/h2>
&lt;p>You should pick to choose a static website if your website doesn&amp;rsquo;t allow users to make POST, PUT, PATCH, CONNECT or DELETE &lt;a href="https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol">HTTP&lt;/a> requests. In other words, you should probably choose to use a static website if your users are not going to modify any of your website&amp;rsquo;s data.&lt;/p>
&lt;h2 id="what-are-static-website-generators">What are static website &lt;em>generators&lt;/em>?&lt;/h2>
&lt;p>Static website &lt;em>generators&lt;/em> are exactly what they sound like. They&amp;rsquo;re automated processes that help you produce static websites. These technologies differentiate themselves in different ways. But the main two differentiating themes are typically speed and customization.&lt;/p>
&lt;h2 id="picking-a-static-website-generator">Picking a static website generator&lt;/h2>
&lt;p>Here&amp;rsquo;s a list of &lt;a href="https://www.staticgen.com/">the most popular static site generators&lt;/a>. Currently, the top three are &lt;a href="https://nextjs.org/">Next.js&lt;/a>, &lt;a href="https://gohugo.io/">Hugo&lt;/a>, and &lt;a href="https://nuxtjs.org/">Nuxt.js&lt;/a>. &lt;a href="https://www.gatsbyjs.org/">Gatsby.js&lt;/a> is a pretty popular one too.&lt;/p>
&lt;p>Today, we&amp;rsquo;re going to be talking about &lt;a href="https://jekyllrb.com/">Jekyll&lt;/a> and &lt;a href="https://gohugo.io/">Hugo&lt;/a>, how they differ, and why you may choose one over the other. But before we go on, you may be wondering: why are we not looking at something like Next or Nuxt since they&amp;rsquo;re so popular? Well, although these technologies are great, I&amp;rsquo;ve decided to avoid writing about them due to a few reasons, including the following:&lt;/p>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>They&amp;rsquo;re built on top of frameworks:&lt;/strong> Next is built on &lt;a href="https://reactjs.org/">React.js&lt;/a>, and Nuxt is built on &lt;a href="https://vuejs.org/">Vue.js&lt;/a>. So learning them would also mean that you&amp;rsquo;re going to eventually learn the framework behind them. Hugo and Jekyll, on the other hand, are built on &lt;a href="https://golang.org/">Go&lt;/a> and &lt;a href="https://www.ruby-lang.org/en/">Ruby&lt;/a> (programming languages) respectively. So their barrier to entry is a bit lower.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>They&amp;rsquo;re often used as a part of full-stack applications:&lt;/strong> Next and Nuxt are typically used to optimize the frontend of full-stack applications (and are kind of built for that purpose). So browsing questions about them and reading their documentation may confuse you if you plan to use them to build pure static websites [that aren&amp;rsquo;t connected to a backend or database in any way]. Hugo and Jekyll, in contrast, are mostly designed to create and maintain stand-alone static websites. So getting help for them may be easier.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;h2 id="hugo-vs-jekyll-style-themes">Hugo vs. Jekyll: Style (themes)&lt;/h2>
&lt;p>You can pick a theme to build your website (rather than building it from scratch). Most themes are free and open-sourced. There are plenty of themes to choose from in both technologies.&lt;/p>
&lt;p>Popular themes are sometimes available under both technologies. So if you see a theme that you like with one technology, I would suggest searching for it in the other. Here are links to theme pages for each:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://jekyllrb.com/docs/themes/">Jekyll themes&lt;/a> (under &amp;ldquo;Pick up a theme&amp;rdquo;)&lt;/li>
&lt;li>&lt;a href="https://themes.gohugo.io/">Hugo themes&lt;/a>&lt;/li>
&lt;/ul>
&lt;h2 id="hugo-vs-jekyll-speed">Hugo vs. Jekyll: Speed&lt;/h2>
&lt;p>One of the main differences between Hugo and Jekyll is their speed. Looking at &lt;a href="https://forestry.io/blog/hugo-vs-jekyll-benchmark/">this&lt;/a> benchmarking test, it is said that Hugo is &amp;ldquo;&amp;hellip; between 23 and 63 times faster than Jekyll&amp;rdquo; (Macrae, 2018) in terms of build time. This becomes more apparent as the number of pages grows. Here&amp;rsquo;s a graph demonstrating the difference:&lt;/p>
&lt;figure class="image center">
&lt;a href="hugo-vs-jekyll-speed-graph.png">&lt;img src="hugo-vs-jekyll-speed-graph.png" alt="Column graph of build times by Hugo and Jekyll as page number increases">&lt;/a>
&lt;figcaption>
&lt;p>Build time difference on page number increase (&lt;a href="https://forestry.io/blog/hugo-vs-jekyll-benchmark/">Source&lt;/a>)&lt;/p>
&lt;/figcaption>
&lt;/figure>
&lt;h2 id="hugo-vs-jekyll-the-learning-curve">Hugo vs. Jekyll: The learning curve&lt;/h2>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>Hugo&amp;rsquo;s docs are harder to follow:&lt;/strong> As pointed out by Ben Congdon in &lt;a href="https://benjamincongdon.me/blog/2018/06/06/Switching-from-Jekyll-to-Hugo/">his blog&lt;/a>, Hugo follows a &lt;a href="https://en.wikipedia.org/wiki/Top-down_and_bottom-up_design">top-down engineering&lt;/a> approach, where it tries to provide everything a user may need. While Jekyll, on the other hand, follows a &lt;a href="https://en.wikipedia.org/wiki/Top-down_and_bottom-up_design">bottom-up&lt;/a> approach where it provides minimal tools and lets you build the rest. This makes Hugo a little harder to learn. I personally found its documentation to be a little overwhelming. Jekyll&amp;rsquo;s documentation was much easier to read, navigate, and follow.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Great communities with both:&lt;/strong> Although Jekyll (&lt;a href="https://en.wikipedia.org/wiki/Jekyll_(software)">est. 2008&lt;/a>) has been around longer than Hugo (&lt;a href="https://en.wikipedia.org/wiki/Hugo_(software)">est. 2013&lt;/a>), I found both to have great communities. I didn&amp;rsquo;t have trouble finding answers for either of them.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Programming language familiarity:&lt;/strong> Depending on the programming languages you currently know, you may choose one technology over the other. As discussed, Jekyll is built on Ruby and Hugo is built on Go. If you&amp;rsquo;re a beginner programmer, choosing Jekyll may be the easier route since Ruby is considered easier to learn than Go. If you&amp;rsquo;re familiar with &lt;a href="https://stackoverflow.com/a/1517670/7974948">statically typed programming&lt;/a> languages, then Hugo may be the better option for you, as Go is statically typed.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;p>It may be important to note that according to &lt;a href="https://hired.com/state-of-software-engineers">this&lt;/a> report by &lt;a href="https://hired.com/home">Hired.com&lt;/a>, programmers experienced with Go had the most interview requests on their platform (in 2019). Here&amp;rsquo;s a graph demonstrating this further:&lt;/p>
&lt;figure class="image center">
&lt;a href="hired-most-demand-langs.png">&lt;img src="hired-most-demand-langs.png" alt="Graph of most in demand programming languages provided by Hired">&lt;/a>
&lt;figcaption>
&lt;p>Most in demand programming languages of 2019 (&lt;a href="https://hired.com/state-of-software-engineers">Source&lt;/a>)&lt;/p>
&lt;/figcaption>
&lt;/figure>
&lt;p>So if you are currently looking for a job (like I am), it may be worth it to look into Go, and how it may help you grow as a programmer. In case you do want to check it out, I think going through &lt;a href="https://tour.golang.org/welcome/1">this interactive tutorial&lt;/a> provided by the language&amp;rsquo;s official website may be a good way to start.&lt;/p>
&lt;h2 id="hugo-vs-jekyll-when-to-use-what">Hugo vs. Jekyll: When to use what&lt;/h2>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>Jekyll:&lt;/strong> I would recommend using Jekyll for building websites that don&amp;rsquo;t exceed 500 pages in size (to avoid long build time). Look at &lt;a href="https://developer.spotify.com/">Spotify for Developers&lt;/a>, &lt;a href="https://www.twitchcon.com/">TwitchCon&amp;rsquo;s website&lt;/a>, and &lt;a href="https://www.sketch.com/">Sketch App&amp;rsquo;s website&lt;/a> for Jekyll generated examples. More can be found on &lt;a href="https://jekyllrb.com/showcase/">Jekyll&amp;rsquo;s showcase page&lt;/a>.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Hugo:&lt;/strong> I would recommend Hugo for blogs, and for websites that you know are going to continue to grow in page count over time. Look at &lt;a href="https://benjamincongdon.me/">Ben Congdon&amp;rsquo;s website&lt;/a>, &lt;a href="https://annadodson.co.uk/">Anna Dodson&amp;rsquo;s website&lt;/a>, and &lt;a href="https://www.pharmaseal.co/">Pharmaseal&amp;rsquo;s website&lt;/a> for Hugo generated examples. More can be found on &lt;a href="https://gohugo.io/showcase/">Hugo&amp;rsquo;s showcase page&lt;/a>.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;p>If you want to look at an even deeper comparison of the two technologies, I recommend &lt;a href="https://forestry.io/blog/hugo-and-jekyll-compared/">this article&lt;/a> by &lt;a href="https://forestry.io/">Forestry.io&lt;/a>.&lt;/p></description></item><item><title>About</title><link>https://hakeem-almidan.com/about/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hakeem-almidan.com/about/</guid><description>&lt;p>Hi,
I’m Abdulhakeem. You can call me Hakeem. I have experience building full-stack applications in many languages and frameworks. What I’ve learned over time is that the main mental challenge often lies in the logic behind what you&amp;rsquo;re building, and not in the language/framework itself.&lt;/p>
&lt;p>Outside of work, I enjoy painting, playing volleyball, soccer, scuba diving, and hanging out with friends. I also enjoy reading about business and finance.&lt;/p>
&lt;h3 id="resume">Resume&lt;/h3>
&lt;p>&lt;a href="https://hakeemmidan.github.io/resume/">link&lt;/a>&lt;/p>
&lt;h3 id="contact">Contact&lt;/h3>
&lt;p>&lt;a href="mailto:Hakeemmidan@gmail.com">Hakeemmidan@gmail.com&lt;/a>&lt;/p>
&lt;span>
&lt;!-- github -->
&lt;a class="u-link-with-no-underline" href="https://github.com/Hakeemmidan">
&lt;svg class="online-presence-logo" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">&lt;title>GitHub icon&lt;/title>&lt;path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/>&lt;/svg>
&lt;/a>
&lt;!-- linkedin -->
&lt;a class="u-link-with-no-underline" href="https://www.linkedin.com/in/abdulhakeem-almidan/">
&lt;svg class="online-presence-logo" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">&lt;title>LinkedIn icon&lt;/title>&lt;path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/>&lt;/svg>
&lt;/a>
&lt;!-- angelList -->
&lt;a class="u-link-with-no-underline" href="https://angel.co/abdulhakeem-almidan">
&lt;svg class="online-presence-logo" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">&lt;title>AngelList icon&lt;/title>&lt;path d="M16.465 9.954c.735-2 1.31-3.65 1.723-4.954.41-1.3.618-2.1.618-2.4 0-.315-.07-.564-.21-.738-.135-.174-.324-.264-.567-.264-.31 0-.63.255-.94.765-.32.51-.67 1.334-1.06 2.467l-1.65 4.76 2.08.362h-.01v.002zm-2.193 4.435c-.474-.03-.923-.08-1.344-.15-.42-.08-.83-.19-1.216-.33.177.35.335.7.472 1.05.138.35.25.69.34 1.04.26-.33.54-.63.83-.9.292-.27.6-.51.915-.72zm-1.862-5l-1.78-5.14c-.464-1.31-.82-2.16-1.075-2.57-.25-.4-.525-.6-.822-.6-.23 0-.417.08-.56.26-.144.18-.214.41-.214.7 0 .5.19 1.38.57 2.64.38 1.25.96 2.89 1.73 4.93.06-.12.16-.21.28-.26.12-.05.28-.08.49-.08.06 0 .19.01.39.01.19.02.52.04.97.09zm-1.618 7.96c.188 0 .36-.09.51-.26.15-.18.234-.36.234-.55 0-.21-.15-.7-.452-1.46-.3-.76-.68-1.51-1.13-2.25-.33-.55-.655-.97-.97-1.25-.324-.28-.625-.42-.91-.42-.23 0-.484.14-.767.44-.28.29-.42.56-.42.81 0 .26.14.66.413 1.18.275.53.645 1.09 1.104 1.68.485.65.94 1.15 1.37 1.51.428.36.77.54 1.02.54h-.002zm-4.945-.4c.156.19.37.46.646.82.723 1 1.395 1.5 2.01 1.5.21 0 .397-.07.563-.2.164-.14.247-.27.247-.42 0-.17-.11-.44-.33-.83-.222-.39-.524-.82-.907-1.3-.44-.56-.805-.97-1.098-1.23-.288-.26-.525-.39-.697-.39-.38 0-.74.21-1.06.62-.32.4-.48.9-.48 1.46 0 .45.12.95.35 1.51.23.55.55 1.11.98 1.67.65.87 1.46 1.53 2.42 2 .96.46 2.03.69 3.19.69 2.14 0 3.94-.8 5.38-2.4 1.45-1.6 2.17-3.6 2.17-6.01 0-.74-.05-1.33-.16-1.76-.11-.43-.29-.75-.54-.95-.45-.38-1.33-.71-2.63-1.01-1.3-.3-2.66-.45-4.08-.45-.39 0-.68.07-.84.2-.16.13-.24.36-.24.673 0 .75.42 1.29 1.26 1.626.84.34 2.19.51 4.06.51h.676c.15 0 .28.06.37.174.09.11.15.28.18.52-.19.17-.57.37-1.154.6-.59.22-1.03.45-1.34.665-.66.484-1.19 1.06-1.59 1.724-.4.66-.6 1.29-.6 1.883 0 .36.086.8.258 1.31.17.51.26.823.26.95v.11l-.03.15c-.48-.03-.86-.313-1.14-.85-.287-.53-.42-1.24-.42-2.13v-.15c-.09.075-.176.135-.26.165-.086.034-.178.05-.27.05-.1 0-.198-.006-.29-.02-.09-.016-.18-.04-.29-.075.03.12.057.24.076.353.01.12.02.21.02.27 0 .406-.16.76-.48 1.05-.32.287-.7.43-1.14.43-.69 0-1.397-.34-2.11-1.01-.715-.674-1.07-1.34-1.07-1.985 0-.12.015-.23.04-.323s.075-.17.14-.24zm11.807-6.73c.985.18 1.685.6 2.09 1.25.41.64.61 1.66.61 3.06 0 2.77-.828 5.03-2.492 6.79-1.667 1.76-3.797 2.65-6.387 2.65-1.023 0-2.016-.19-2.976-.56-.97-.37-1.79-.89-2.49-1.54-.79-.73-1.39-1.49-1.78-2.3-.4-.81-.6-1.64-.6-2.48 0-.95.2-1.68.6-2.19.4-.52 1.05-.87 1.93-1.06-.17-.39-.29-.71-.36-.98-.08-.27-.12-.47-.12-.61 0-.5.26-1.01.78-1.52.52-.52 1.01-.78 1.47-.78.19 0 .4.03.62.11.22.07.47.19.75.35-.81-2.35-1.43-4.2-1.81-5.5-.39-1.31-.58-2.2-.58-2.7 0-.68.17-1.23.52-1.63.36-.4.84-.6 1.44-.6 1.03 0 2.34 2.31 3.93 6.923.28.79.48 1.4.63 1.83l.51-1.453c1.59-4.55 2.95-6.83 4.1-6.83.56 0 1.01.19 1.34.57.33.383.5.887.5 1.523 0 .48-.19 1.36-.56 2.65-.367 1.28-.92 2.96-1.67 5.04"/>&lt;/svg>
&lt;/a>
&lt;!-- codepen -->
&lt;a class="u-link-with-no-underline" href="https://codepen.io/Hakeemmidan/pens/public">
&lt;svg class="online-presence-logo" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">&lt;title>CodePen icon&lt;/title>&lt;path d="M18.144 13.067v-2.134L16.55 12zm1.276 1.194a.628.628 0 01-.006.083l-.005.028-.011.053-.01.031c-.005.016-.01.031-.017.047l-.014.03a.78.78 0 01-.021.043l-.019.03a.57.57 0 01-.08.1l-.026.025a.602.602 0 01-.036.03l-.029.022-.01.008-6.782 4.522a.637.637 0 01-.708 0L4.864 14.79l-.01-.008a.599.599 0 01-.065-.052l-.026-.025-.032-.034-.021-.028a.588.588 0 01-.067-.11l-.014-.031a.644.644 0 01-.017-.047l-.01-.03c-.004-.018-.008-.036-.01-.054l-.006-.028a.628.628 0 01-.006-.083V9.739c0-.028.002-.055.006-.083l.005-.027.011-.054.01-.03a.574.574 0 01.12-.217l.031-.034.026-.025a.62.62 0 01.065-.052l.01-.008 6.782-4.521a.638.638 0 01.708 0l6.782 4.521.01.008.03.022.035.03c.01.008.017.016.026.025a.545.545 0 01.08.1l.019.03a.633.633 0 01.021.043l.014.03c.007.016.012.032.017.047l.01.031c.004.018.008.036.01.054l.006.027a.619.619 0 01.006.083zM12 0C5.373 0 0 5.372 0 12 0 18.627 5.373 24 12 24c6.628 0 12-5.372 12-12 0-6.627-5.372-12-12-12m0 10.492L9.745 12 12 13.51 14.255 12zm.638 4.124v2.975l4.996-3.33-2.232-1.493zm-6.272-.356l4.996 3.33v-2.974l-2.764-1.849zm11.268-4.52l-4.996-3.33v2.974l2.764 1.85zm-6.272-.356V6.41L6.366 9.74l2.232 1.493zm-5.506 1.549v2.134L7.45 12Z"/>&lt;/svg>
&lt;/a>
&lt;/span>
&lt;h3 id="about-website">About website&lt;/h3>
&lt;p>Like what you&amp;rsquo;re seeing? Subscribe below to recieve notifications of new posts ⬇️&lt;/p>
&lt;p>Promise not to send more than 1 email per month (not counting subscription confirmation email) 👨‍💻
&lt;!-- Begin Mailchimp Signup Form -->
&lt;div id="mc_embed_signup">
&lt;form action="https://hakeem-almidan.us2.list-manage.com/subscribe/post?u=2a214450dbf0906444fa3503a&amp;amp;id=637c7a92ad" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" novalidate>
&lt;link href="//cdn-images.mailchimp.com/embedcode/horizontal-slim-10_7.css" rel="stylesheet" type="text/css">
&lt;div id="mc_embed_signup_scroll">
&lt;input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
&lt;!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
&lt;div style="position: absolute; left: -5000px;" aria-hidden="true">&lt;input type="text" name="b_2a214450dbf0906444fa3503a_637c7a92ad" tabindex="-1" value="">&lt;/div>
&lt;div class="clear">&lt;input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">&lt;/div>
&lt;/div>
&lt;/form>
&lt;/div>
&lt;!--End mc_embed_signup-->
&lt;/p>
&lt;p>This website is powered by &lt;a href="https://gohugo.io/">Hugo&lt;/a> using the &lt;a href="https://github.com/frjo/hugo-theme-zen">Zen theme&lt;/a>&lt;/p></description></item></channel></rss>