<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>@faizmokh - Posts</title>
    <subtitle>Technical notes &amp; whatnots</subtitle>
    <link rel="self" type="application/atom+xml" href="https://faizmokh.com/posts/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2025-02-24T13:52:10.377+00:00</updated>
    <id>https://faizmokh.com/posts/atom.xml</id>
    <entry xml:lang="en">
        <title>Ramadan Menubar: A Simple Ramadan Countdown App</title>
        <published>2025-02-24T13:52:10.377+00:00</published>
        <updated>2025-02-24T13:52:10.377+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/ramadan-menubar-a-simple-ramadan-countdown-app/"/>
        <id>https://faizmokh.com/posts/ramadan-menubar-a-simple-ramadan-countdown-app/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/ramadan-menubar-a-simple-ramadan-countdown-app/">&lt;p&gt;With Ramadan approaching, I built a simple macOS menubar app for counting down to Ramadan.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;uploads&#x2F;ramadan.png&quot; alt=&quot;Ramadan menubar&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;It shows how many days remain until Ramadan begins. Once Ramadan starts, it displays the current Hijri month and after Ramadan ends, it begins counting down to next year&#x27;s Ramadan. That&#x27;s it.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;uploads&#x2F;ramadan-meme.jpg&quot; alt=&quot;Ramadan meme butter&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;You can get it from &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;faizmokh&#x2F;ramadan-menubar&#x2F;issues&quot;&gt;Github Releases page&lt;&#x2F;a&gt;. If you experience any issues, please create an issue on GitHub.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Migrating My Obsidian Vault From iCloud to Git</title>
        <published>2024-06-22T09:07:44.980+00:00</published>
        <updated>2024-06-22T09:07:44.980+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/migrating-obsidian-vault-git/"/>
        <id>https://faizmokh.com/posts/migrating-obsidian-vault-git/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/migrating-obsidian-vault-git/">&lt;p&gt;I have been using Obsidian for note-taking for quite some time now, having switched from Logseq. Both are quite similar in functionality to me, but I much prefer Obsidian’s “&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;stephango.com&#x2F;file-over-app&quot;&gt;File over app&lt;&#x2F;a&gt;” approach. In case the product get discontinued, I still get to keep my notes because, in the end, they are &lt;code&gt;.md&lt;&#x2F;code&gt; files.&lt;&#x2F;p&gt;
&lt;p&gt;I use iCloud to back up my Obsidian notes and i has worked very well so far.  Never encounter any out-of-sync issue but now since I can’t use iCloud on my work machine, I need a new alternative. I considered paying for Obsidian Sync, but I already have too many subscriptions. So, a Git-based setup it is.&lt;&#x2F;p&gt;
&lt;p&gt;The migrations process are seamless. Here are the steps I took to migrate my Obsidian Vault to Git:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Copy Obsidian folder&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
Copy my Obsidian folder to &lt;code&gt;~&#x2F;Developer&#x2F;obsidian&lt;&#x2F;code&gt; , out of iCloud folder.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Initialize local &amp;amp; remote git repository&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
Initialized git repository in my local vault. Then, I created a remote repository on Github and added it as origin.&lt;br &#x2F;&gt;
{{&amp;lt; highlight bash &amp;gt;}}
&lt;blockquote&gt;
&lt;p&gt;cd &lt;del&gt;&#x2F;Developer&#x2F;obsidian&lt;br &#x2F;&gt;
git init&lt;&#x2F;del&gt;&lt;br &#x2F;&gt;
git remote add origin git@github.com:username&#x2F;repo.git`
{{&lt;&#x2F;highlight&gt;}}&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Configure &lt;code&gt;.gitignore&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
Added &lt;code&gt;.gitignore&lt;&#x2F;code&gt; to exclude unnecessary files. While some suggest to ignore the &lt;code&gt;.obsidian&lt;&#x2F;code&gt; folder, I included it so that my configurations and plugins are synchronized across devices. I also ignore &lt;code&gt;work&#x2F;&lt;&#x2F;code&gt; folder to exclude any sensitive info.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Commit and push&lt;&#x2F;strong&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; git commit -am &lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt;Initial commit&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;  &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; git push -u origin main&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt;`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Install git plugin in Obsidian&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
&lt;img src=&quot;&#x2F;images&#x2F;obsidian-git.jpg&quot; alt=&quot;Obsidian git plugin&quot; &#x2F;&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Configure the plugin&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
I  set the Vault Backup interval to 60 minutes (might change in the future), set the sync method as Merge and to automatically pull updates on startup.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Clone the repo on work machine&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
Once done, I cloned the repo on my work machine, copied over any existing notes I had on my work machine and deleted the old vault.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;This setup has been working well for me for a few weeks. Hopefully, I will never encounter any issues.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Some Notes While Setting Up My New MacBook</title>
        <published>2024-06-10T12:30:03.606+00:00</published>
        <updated>2024-06-10T12:30:03.606+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/notes-while-setting-up-my-new-macbook/"/>
        <id>https://faizmokh.com/posts/notes-while-setting-up-my-new-macbook/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/notes-while-setting-up-my-new-macbook/">&lt;p&gt;I finally did it—I bought a MacBook! I&#x27;ve worked as a software engineer for almost nine years but never had my own personal machine. I have a very old MacBook Air, but that was different. It was kind of a gift. Still have it stored somewhere, but it&#x27;s pretty much useless. I can&#x27;t upgrade the macOS anymore and the battery requires servicing.&lt;&#x2F;p&gt;
&lt;p&gt;I always wanted to buy one, but I kept putting the idea aside because every company I worked for always provided one and based on my observations, most of my friends or colleagues who have both a personal and a company-provided MacBook rarely use theirs. I figured the same thing would happen if I bought one.&lt;&#x2F;p&gt;
&lt;p&gt;Anyway, my current company’s device policy is very strict (banking industry), which makes me feel anxious about using it for personal stuff, so I figured it’s probably a good time for me to get one. So here I am.&lt;&#x2F;p&gt;
&lt;p&gt;I jot down some of my thoughts while setting up my MacBook:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;I find it crazy how &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;faizmokh&#x2F;dotfiles&quot;&gt;my dotfiles configuration&lt;&#x2F;a&gt; still works fine after all these years, but some installation steps are out of order. For example, to install SwiftLint, I need to have Xcode installed. I probably should fix this and turn it into a single bash script. Someday soon.&lt;&#x2F;li&gt;
&lt;li&gt;I can’t praise &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;asdf-vm&#x2F;asdf&quot;&gt;asdf&lt;&#x2F;a&gt; enough. I installed Python, Ruby, and Node with it. Convenient.&lt;&#x2F;li&gt;
&lt;li&gt;14-inch MacBook Pro is nice to hold and carry. I always got issued a 16-inch MacBook Pro at work, so while the large screen density is impressive, I really don’t like how heavy it is.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.apple.com&#x2F;my&#x2F;shop&#x2F;buy-mac&#x2F;macbook-pro&#x2F;14-inch-space-black-apple-m3-pro-with-12-core-cpu-and-18-core-gpu-18gb-memory-1tb&quot;&gt;Space Black&lt;&#x2F;a&gt; is beautiful. However, I don’t really like! how the power adapter is white while everything else is mostly black. I&#x27;m not the only one who &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;mac&#x2F;comments&#x2F;1ayrtu4&#x2F;macbook_pro_space_black_white_charger&#x2F;&quot;&gt;complained about it, by the way&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;I still can’t decide which code editor theme to use. I’ve been using &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;draculatheme.com&#x2F;&quot;&gt;Dracula theme&lt;&#x2F;a&gt; for years, but I feel like trying out other themes, especially high-contrast themes. Currently, I’m trying out the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;catppuccin&#x2F;catppuccin?tab=readme-ov-file&quot;&gt;Catpuccin Mocha theme&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;There are applications specified in my Brewfile &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;faizmokh&#x2F;dotfiles&#x2F;blob&#x2F;ad653acf40fe78f2c20ed2d76f8bbfe028a8caf5&#x2F;.Brewfile&quot;&gt;that I’m not using anymore&lt;&#x2F;a&gt;. I took the liberty to &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;faizmokh&#x2F;dotfiles&#x2F;commit&#x2F;4f5fba4ab0ec3223e68612bee7e4e293a9022077&quot;&gt;clean it up&lt;&#x2F;a&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;I am planning to buy a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;proxyman.io&#x2F;&quot;&gt;Proxyman&lt;&#x2F;a&gt; license next. I use it at work and really like how convenient it is. It definitely helps boost my development speed.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;So far, it’s been a pleasant experience. I guess I still got the hedonistic pleasure from buying expensive things. I just hope that Apple won’t release the MacBook M4 Pro tonight.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Installing Python 3.12.0 with asdf</title>
        <published>2024-05-27T04:04:32.676+00:00</published>
        <updated>2024-05-27T04:04:32.676+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/installing-python-asdf/"/>
        <id>https://faizmokh.com/posts/installing-python-asdf/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/installing-python-asdf/">&lt;p&gt;I tried installing Python on my work machine last week using &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;asdf-vm.com&#x2F;&quot;&gt;asdf&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;The steps to install it are easy. All I had to do was add the Python plugin and run &lt;code&gt;asdf install&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; asdf plugin-add python&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6272A4;&quot;&gt; # add python plugin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; asdf install python 3.12.0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;It was not exactly a smooth process. I got the following error:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;python-build&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; 3.12.0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; &#x2F;Users&#x2F;xxx&#x2F;.asdf&#x2F;installs&#x2F;python&#x2F;3.12.0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;python-build:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; use openssl@3 from homebrew&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;python-build:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; use readline from homebrew&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;Downloading&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; Python-3.12.0.tar.xz...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;-&lt;&#x2F;span&gt;&lt;span&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; https:&#x2F;&#x2F;www.python.org&#x2F;ftp&#x2F;python&#x2F;3.12.0&#x2F;Python-3.12.0.tar.xz&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;Installing&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; Python-3.12.0...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;python-build:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; use readline from homebrew&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;python-build:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; use zlib from xcode sdk&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;Traceback&lt;&#x2F;span&gt;&lt;span&gt; (most&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; recent call last&lt;&#x2F;span&gt;&lt;span&gt;):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;  File&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt;&amp;lt;string&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt;, line 1, in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt;modul&lt;&#x2F;span&gt;&lt;span&gt;e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;  File&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt;&#x2F;Users&#x2F;xxx&#x2F;.asdf&#x2F;installs&#x2F;python&#x2F;3.12.0&#x2F;lib&#x2F;python3.12&#x2F;lzma.py&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt;, line 27, in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt;modul&lt;&#x2F;span&gt;&lt;span&gt;e&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;    from&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; _lzma import&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;font-style: italic;&quot;&gt; *&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;ModuleNotFoundError:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; No module named&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt; &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt;_lzma&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;WARNING:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; The Python lzma extension was not compiled. Missing the lzma lib?&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;Installed&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; Python-3.12.0 to &#x2F;Users&#x2F;xxx&#x2F;.asdf&#x2F;installs&#x2F;python&#x2F;3.12.0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;asdf:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; Warn: You have configured asdf to preserve downloaded files&lt;&#x2F;span&gt;&lt;span&gt; (with&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; always_keep_download=yes or&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; --keep-download&lt;&#x2F;span&gt;&lt;span&gt;). But&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;asdf:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; Warn: the current plugin&lt;&#x2F;span&gt;&lt;span&gt; (python) does not support that. Downloaded files will not be preserved.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After some googling, I found out that I needed to have &lt;code&gt;xz&lt;&#x2F;code&gt; installed. Yes, that &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.akamai.com&#x2F;blog&#x2F;security-research&#x2F;critical-linux-backdoor-xz-utils-discovered-what-to-know&quot;&gt;&lt;code&gt;xz&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;. I was a bit worried but it seems like running &lt;code&gt;brew install xz&lt;&#x2F;code&gt; &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;orgs&#x2F;Homebrew&#x2F;discussions&#x2F;5243&quot;&gt;will install the older version&lt;&#x2F;a&gt;, &lt;code&gt;5.4.6&lt;&#x2F;code&gt; which is free from the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.akamai.com&#x2F;blog&#x2F;security-research&#x2F;critical-linux-backdoor-xz-utils-discovered-what-to-know&quot;&gt;backdoor&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Once I had &lt;code&gt;xz&lt;&#x2F;code&gt; installed I just had to run the following commands to install Python on my work machine:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; asdf install python 3.12.0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; asdf global python 3.12.0&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6272A4;&quot;&gt; # will set 3.12.0 as the global default&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to Stash Only Staged Changes in Git</title>
        <published>2024-05-21T07:28:55.179+00:00</published>
        <updated>2024-05-21T07:28:55.179+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/git-stash-only-staged-changes/"/>
        <id>https://faizmokh.com/posts/git-stash-only-staged-changes/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/git-stash-only-staged-changes/">&lt;p&gt;Normally, when I need to stash my code changes, I run &lt;code&gt;git stash&lt;&#x2F;code&gt;. This command stashes all my changes in the Git staging area. Then, I manage my stashes (pop, apply, drop) using Sublime Merge. I am pretty comfortable with this workflow.&lt;&#x2F;p&gt;
&lt;p&gt;However, while working on a task recently, I needed to quickly switch branches to check an issue for a colleague. Normally, I would run &lt;code&gt;git stash&lt;&#x2F;code&gt; before changing branches, but this time I didn&#x27;t want to stash all the changes in the staging area. Instead, I wanted to stash only the staged files and leave the unstaged files as they were.&lt;&#x2F;p&gt;
&lt;p&gt;Luckily, there&#x27;s a command for this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; stash&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; --&lt;&#x2F;span&gt;&lt;span&gt; $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; diff&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; --staged --name-only&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Let&#x27;s break it down:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;git diff --staged --name-only&lt;&#x2F;code&gt; outputs a list of files with changes in the staging area&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;git stash -- $()&lt;&#x2F;code&gt; stashes only the files listed by the previous command.&lt;&#x2F;li&gt;
&lt;li&gt;This ensures that only the staged changes are stashed, while any unstaged changes remain in the staging area.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Pretty neat, right? I hope this tip helps!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>My Essentials Tools</title>
        <published>2024-03-26T02:23:32.303+00:00</published>
        <updated>2024-03-26T02:23:32.303+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/tools-i-use-as-a-dev/"/>
        <id>https://faizmokh.com/posts/tools-i-use-as-a-dev/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/tools-i-use-as-a-dev/">&lt;p&gt;I am going to hand over my work device this Friday since it will be my last day here in Boost. I thought it would be interesting to document the collection of tools I have used over the years. Many of these have been already documented in my &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;faizmokh&#x2F;dotfiles&quot;&gt;dotfiles repo&lt;&#x2F;a&gt; but still, I just want to share it here for fun.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;selected-cli-tools&quot;&gt;Selected CLI tools&lt;&#x2F;h2&gt;
&lt;p&gt;I think I have countless CLI apps installed for development and most of it are pretty common to have, like &lt;code&gt;git&lt;&#x2F;code&gt;, &lt;code&gt;mysql&lt;&#x2F;code&gt; or too low-level (&lt;code&gt;coreutils&lt;&#x2F;code&gt;, &lt;code&gt;cmake&lt;&#x2F;code&gt;) so I will exclude those. Here is the list of tools that I like and somewhat uncommon, most of which are installed using &lt;code&gt;brew&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;samaaron&#x2F;ack&quot;&gt;&lt;strong&gt;ack&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: the better &lt;code&gt;grep&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;zsh-users&#x2F;antigen&quot;&gt;&lt;strong&gt;antigen&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: plugin manager for &lt;code&gt;zsh&lt;&#x2F;code&gt;. It’s similar to &lt;code&gt;oh-my-zsh&lt;&#x2F;code&gt;, but it has faster startup times.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;asdf-vm&#x2F;asdf&quot;&gt;&lt;strong&gt;asdf&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;:  to manage multiple versions of &lt;code&gt;ruby&lt;&#x2F;code&gt;, &lt;code&gt;node&lt;&#x2F;code&gt;, &lt;code&gt;python&lt;&#x2F;code&gt;, etc. I don’t have to install and remember how to use &lt;code&gt;nvm&lt;&#x2F;code&gt; or &lt;code&gt;rbenv&lt;&#x2F;code&gt; anymore.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Carthage&#x2F;Carthage&quot;&gt;&lt;strong&gt;carthage&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: dependency manager for iOS, similar to Cocoapods. Installed it since my current company uses it, but I don’t really prefer it.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;so-fancy&#x2F;diff-so-fancy&quot;&gt;&lt;strong&gt;diff-so-fancy&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: to prettify &lt;code&gt;git diff&lt;&#x2F;code&gt; output in terminal.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;chisel&quot;&gt;&lt;strong&gt;chisel&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Collection of LLDB commands to help debug iOS apps. Created by the Facebook team.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;cli.github.com&#x2F;&quot;&gt;&lt;strong&gt;gh&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: CLI to interact with GitHub API. I use it to quickly create or delete remote repo from terminal.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;goreleaser&#x2F;goreleaser&quot;&gt;&lt;strong&gt;goreleaser&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: to package go app as binaries.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;FiloSottile&#x2F;mkcert&quot;&gt;&lt;strong&gt;mkcert&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: to create local self-signed certificates. I usually use it when I need to create certs during app development.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;glideapps&#x2F;quicktype&quot;&gt;&lt;strong&gt;quicktype&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: to convert JSON to model quickly. Rarely used it since I mostly use their &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;app.quicktype.io&#x2F;&quot;&gt;app&lt;&#x2F;a&gt; instead.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;oldmanprogrammer.net&#x2F;source.php?dir=projects&#x2F;tree&quot;&gt;&lt;strong&gt;tree&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: to quickly inspect the directory structure from CLI&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;realm&#x2F;SwiftLint&quot;&gt;&lt;strong&gt;swiftlint&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: linter for Swift to enforce coding style guidelines.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;vim&#x2F;vim&quot;&gt;&lt;strong&gt;vim&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: &lt;code&gt;:q!&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;cpisciotta&#x2F;xcbeautify&quot;&gt;&lt;strong&gt;xcbeautify&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt; to prettify the &lt;code&gt;xcodebuild&lt;&#x2F;code&gt; logs. Installed when I was working on setting up iOS CI&#x2F;CD pipelines.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;XcodesOrg&#x2F;xcodes&quot;&gt;&lt;strong&gt;xcodes&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: to install Xcode from CLI. Friends don’t let friends installed Xcode through AppStore. It helps me too easily switch between multiple Xcodes versions too.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ytdl-org&#x2F;youtube-dl&quot;&gt;&lt;strong&gt;youtube-dl&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: to download videos&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rupa&#x2F;z&quot;&gt;&lt;strong&gt;z&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: to easily jump around between directories.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;noteworthy-apps&quot;&gt;Noteworthy Apps&lt;&#x2F;h2&gt;
&lt;p&gt;Beyond CLI tools, here are some applications that have been integral to my development workflow:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;developer.apple.com&#x2F;xcode&#x2F;&quot;&gt;&lt;strong&gt;Xcode&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt; : the main tool I use for my day-to-day development. I have multiple Xcode installed in fact. Xcode-15.0.0, Xcode-14.3.1 and Xcode-14.1.0. All installed using &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;XcodesOrg&#x2F;xcodes&quot;&gt;&lt;code&gt;xcodes&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; .&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;intitni&#x2F;CopilotForXcode&quot;&gt;&lt;strong&gt;Copilot for Xcode&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;:  3rd-party app that I use to have GitHub Copilot on Xcode. It’s not as good as Copilot on VSCode, but it works.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;developer.android.com&#x2F;studio&quot;&gt;&lt;strong&gt;Android Studio&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: official IDE for Android. I use it sometimes when I feel like learning Android or Flutter development.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;code.visualstudio.com&#x2F;&quot;&gt;&lt;strong&gt;VSCode&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: code editor I use for anything besides Swift.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;&lt;strong&gt;Ulysses&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: app focus on writing. Bought a 1-year subscription when I first published a post on my SubStack account, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;swiftbyte.substack.com&#x2F;&quot;&gt;SwiftByte&lt;&#x2F;a&gt;. 🙈&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.raycast.com&#x2F;&quot;&gt;&lt;strong&gt;Raycast&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Spotlight on steroids. I used to use &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.alfredapp.com&#x2F;&quot;&gt;Alfred 3&lt;&#x2F;a&gt;, but I don’t really feel like paying for the upgrades, so I tried RayCast. Fell in love with it right away.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.figma.com&#x2F;&quot;&gt;&lt;strong&gt;Figma&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: the native app for Figma. I used it whenever I want to hyper-focus on building UIs.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;dbeaver.io&#x2F;&quot;&gt;&lt;strong&gt;DBeaver&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: database browser. Can support multiple types of DB like mysql, postgresql, sqlite etc through plugins. Installed using Cask&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;sqlitebrowser.org&#x2F;&quot;&gt;&lt;strong&gt;DB Browser for sqlite&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: similar to DBeaver. I use it whenever I need to inspect local database in mobile apps since it has a much simpler interface. Installed using Cask.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;logseq.com&#x2F;&quot;&gt;&lt;strong&gt;Logseq&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: a note-taking app or personal knowledge base? I don’t know, but I used it for quick note-taking and also document my learnings. Though I have since migrated to Obsidian. Installed using Cask.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;obsidian.md&#x2F;&quot;&gt;&lt;strong&gt;Obsidian&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: somewhat similar to Logseq.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;netnewswire.com&#x2F;&quot;&gt;&lt;strong&gt;NetNewsWire&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: RSS reader.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arc.net&#x2F;&quot;&gt;&lt;strong&gt;Arc&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: the better Chrome browser. Although I feel like migrating to Safari soon since it already supports multiple profiles.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.deckset.com&#x2F;&quot;&gt;&lt;strong&gt;Deckset&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: to make pretty presentations using Markdown. Usually, I use this whenever I have a knowledge sharing session.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.hammerspoon.org&#x2F;&quot;&gt;&lt;strong&gt;Hammerspoon&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: macOS automation tools through Lua scripting. I use it to script tiling-window manager and some other stuffs. Installed using Cask.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;theunarchiver.com&#x2F;&quot;&gt;&lt;strong&gt;The Unarchiver&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: for unarchiving any non &lt;code&gt;.zip&lt;&#x2F;code&gt; files. Installed using Cask.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;imageoptim.com&#x2F;mac&quot;&gt;&lt;strong&gt;ImageOptim&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: to compress images before uploading it to web. Installed using Cask.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.postman.com&#x2F;&quot;&gt;&lt;strong&gt;Postman&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: for debugging and testing HTTP requests&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.postman.com&#x2F;&quot;&gt;&lt;strong&gt;Apple Developer&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: honestly, I hate the fact that most of Apple docs are hidden behind WWDC videos.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;developer.apple.com&#x2F;sf-symbols&#x2F;&quot;&gt;&lt;strong&gt;SF Symbols&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: for inspecting Apple SF Symbols icons.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;discord.com&#x2F;&quot;&gt;&lt;strong&gt;Discord&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: for chats. I joined programming related groups here.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;iterm2.com&#x2F;&quot;&gt;&lt;strong&gt;iTerm2&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: terminal emulator. Just better features compared to stock terminal. Installed using Cask&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.docker.com&#x2F;&quot;&gt;&lt;strong&gt;Docker&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: Don’t really use it that much, but it’s nice to have whenever I want to fire up an instance since most OSS these days provide docker images. Installed using Cask.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;kapeli.com&#x2F;dash&quot;&gt;&lt;strong&gt;Dash&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: API documentation browser. I still have the old version. Planning to upgrade soon.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.sublimemerge.com&#x2F;&quot;&gt;&lt;strong&gt;Sublime Merge&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: git client. I use it together with &lt;code&gt;git&lt;&#x2F;code&gt; CLI. Mostly for resolving conflicts and visualising git tree.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;telegram.org&#x2F;&quot;&gt;&lt;strong&gt;Telegram&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: for chats. Joined a couple of programming related groups here as well. Installed using Cask&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;faizmokh&#x2F;tomato&quot;&gt;&lt;strong&gt;tomato&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: my own app. A simple pomodoro app that lives in my menu bar. Installed using Cask.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;others&quot;&gt;Others&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;be5invis&#x2F;Iosevka&quot;&gt;&lt;strong&gt;font-iosevka&lt;&#x2F;strong&gt;&lt;&#x2F;a&gt;: my favourite monospace fonts. Installed using &lt;code&gt;brew&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;These tools have speed up my workflow over the years and made my life easier. I hope you find some of these useful.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to Delete Github Repository Quickly</title>
        <published>2023-10-31T08:51:54.646+00:00</published>
        <updated>2023-10-31T08:51:54.646+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/delete-github-repository-quickly/"/>
        <id>https://faizmokh.com/posts/delete-github-repository-quickly/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/delete-github-repository-quickly/">&lt;p&gt;I did some spring-cleaning on my Github repositories a few days ago.&lt;&#x2F;p&gt;
&lt;p&gt;I was doing it manually at first, by going through the repository settings page, clicked on the delete button in the Danger Zone section, went through several popups and finally entered the repository name to confirm the deletion. Yeah… it’s such a boring chore.&lt;&#x2F;p&gt;
&lt;p&gt;Then, I remembered that Github has a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;cli.github.com&#x2F;&quot;&gt;cli client&lt;&#x2F;a&gt; that I have been using for creating repo and pull requests. Figured I might take a look again at their docs to see if there’s a command for deleting a repository or setting a repository to private, and there is one! The usage is simple too. Here’s how.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;install-gh&quot;&gt;Install &lt;code&gt;gh&lt;&#x2F;code&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;If you don’t have it install yet, simply run the following command:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;brew&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; install gh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Once that’s done, run the following command to authenticate with Github:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;gh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; auth login&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;to-delete-a-repository&quot;&gt;To delete a repository&lt;&#x2F;h2&gt;
&lt;p&gt;To delete a repository, run the following command&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6272A4;&quot;&gt;# add --yes to confirm deletion without prompting&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;gh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; repo delete&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; $REPO --yes&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;to-change-from-public-to-private-repository&quot;&gt;To change from public to private repository&lt;&#x2F;h2&gt;
&lt;p&gt;To modify repository access, run the following command:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;gh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; repo edit&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; $REPO --visibility=private&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Replace &lt;code&gt;$REPO&lt;&#x2F;code&gt; with the repo name. You can use either the full URL or the repo name. For example.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6272A4;&quot;&gt;# to delete using url&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;gh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; repo delete https:&#x2F;&#x2F;github.com&#x2F;faizmokh&#x2F;dummyrepo&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6272A4;&quot;&gt;# to modify access using repo name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;gh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; repo edit faizmokh&#x2F;dummyrepo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; --visibility=private&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That&#x27;s all. Go through the docs, if you want to know what else you can do with &lt;code&gt;gh&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;references&quot;&gt;References:&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;cli.github.com&#x2F;manual&#x2F;gh_repo_delete&quot;&gt;gh cli documentation&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>A Cheaper Way to Renew Apple Developer Account</title>
        <published>2023-10-26T04:27:27.051+00:00</published>
        <updated>2023-10-26T04:27:27.051+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/cheaper-renew-apple-developer-account/"/>
        <id>https://faizmokh.com/posts/cheaper-renew-apple-developer-account/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/cheaper-renew-apple-developer-account/">&lt;p&gt;My Apple Developer account renewal lapsed early last year because my bank flagged it as foreign transaction. They did call me to verify it but the transaction had been declined by Apple by the time my bank approved it. Long story short, I did not renew my membership.&lt;&#x2F;p&gt;
&lt;p&gt;But now I felt like renewing it again to release all my “almost finished” side projects. I headed to the Apple Developer website, but to my surprised, the price is &lt;strong&gt;RM399&#x2F;year&lt;&#x2F;strong&gt; now. I’m pretty sure it was cheaper last year.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;uploads&#x2F;app-store-pricing.png&quot; alt=&quot;Pricing on the Apple Developer website&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;So I checked the Developer app to see if the price is different, and it is! It is still RM369&#x2F;year on the app. Somewhat weird, but my guess is this has something to do with the App Store having less “dynamic” pricing as compared to the website. From what I noticed over the years, there will be a lot of news whenever they upgrade their &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;developer.apple.com&#x2F;support&#x2F;downloads&#x2F;price-tier-updates&#x2F;App-Store-Price-Tier-Updates-October-2022.pdf&quot;&gt;App Store Tier pricing&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;uploads&#x2F;devapp-pricing.jpg&quot; alt=&quot;Pricing on the Developer app&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;So if you’re looking to subscribe or renew your Apple Developer account, maybe you can try subscribing it through the app.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to Convert SSL Certificate From CER to DER Format</title>
        <published>2023-08-17T07:28:00.790+00:00</published>
        <updated>2023-08-17T07:28:00.790+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/convert-ssl-certificates-der-format/"/>
        <id>https://faizmokh.com/posts/convert-ssl-certificates-der-format/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/convert-ssl-certificates-der-format/">&lt;p&gt;Today I learned how to convert SSL certificate that is using &lt;code&gt;crt&lt;&#x2F;code&gt; format to &lt;code&gt;der&lt;&#x2F;code&gt; format while working on
updating the certificate that was pinned in our iOS app. Here&#x27;s a quick guide on the how-to.&lt;&#x2F;p&gt;
&lt;p&gt;First of all make sure you have &lt;code&gt;openssl&lt;&#x2F;code&gt; installed in your machine. Then run the following command in your terminal:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;openssl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; x509&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; -in&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; input_cert.crt&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; -out&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; output_cert.der&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; -outform&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; der&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Make sure to replace &lt;code&gt;input_cert.crt&lt;&#x2F;code&gt; and &lt;code&gt;output_cert.der&lt;&#x2F;code&gt; with the actual filenames of your certificates.&lt;&#x2F;p&gt;
&lt;p&gt;That&#x27;s it. Easy right?&lt;&#x2F;p&gt;
&lt;h3 id=&quot;additional-info&quot;&gt;Additional info&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;Make sure you pass in the &lt;code&gt;-outform der&lt;&#x2F;code&gt; flag. Otherwise &lt;code&gt;openssl&lt;&#x2F;code&gt; will default to &lt;code&gt;pem&lt;&#x2F;code&gt; format&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;x509&lt;&#x2F;code&gt; subcommand stands for &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.ssl.com&#x2F;faqs&#x2F;what-is-an-x-509-certificate&#x2F;&quot;&gt;X.509 certificate&lt;&#x2F;a&gt;, which is a standard format for public key certificates.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to Install Specific Version of Brew Cask</title>
        <published>2023-07-28T02:57:10.350+00:00</published>
        <updated>2023-07-28T02:57:10.350+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/install-specific-version-brew-cask/"/>
        <id>https://faizmokh.com/posts/install-specific-version-brew-cask/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/install-specific-version-brew-cask/">&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Homebrew&#x2F;homebrew-cask&quot;&gt;Brew Cask&lt;&#x2F;a&gt; is an extension of &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;brew.sh&#x2F;&quot;&gt;Homebrew&lt;&#x2F;a&gt; that allows us to install GUI tools or 3rd party binaries easily just by using command line.&lt;&#x2F;p&gt;
&lt;p&gt;It is so convenient and I have been using it to install most of my app like Chrome, Android Studio or VSCode for years. One of the app I used regularly is &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;peripheryapp&#x2F;periphery&quot;&gt;Periphery&lt;&#x2F;a&gt;, which is a tool for identifying unused codes in iOS projects.&lt;&#x2F;p&gt;
&lt;p&gt;Recently, I ran &lt;code&gt;brew upgrade&lt;&#x2F;code&gt; and unfortunately the update caused &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;peripheryapp&#x2F;periphery&quot;&gt;Periphery&lt;&#x2F;a&gt; app to stop working. The latest version(&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;peripheryapp&#x2F;periphery&#x2F;releases&#x2F;tag&#x2F;2.15.0&quot;&gt;2.15.0&lt;&#x2F;a&gt;) requires Swift 5.7 but I&#x27;m still using Xcode 14.1. I thought I could just run &lt;code&gt;brew install periphery@2.14.0&lt;&#x2F;code&gt; to downgrade the version but it did not work.&lt;&#x2F;p&gt;
&lt;p&gt;Did some googling but the steps aren&#x27;t straightforward so I will document it down here for my future self.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;p&gt;So here&#x27;s the steps:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Google the casks that you want to install the specific version of &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Homebrew&#x2F;homebrew-cask&#x2F;tree&#x2F;master&#x2F;Casks&quot;&gt;here&lt;&#x2F;a&gt;. If it&#x27;s not part of &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;brew.sh&#x2F;&quot;&gt;brew&lt;&#x2F;a&gt;, search it on Github. For example here&#x27;s the page for &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;peripheryapp&#x2F;homebrew-periphery&quot;&gt;periphery&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Go through the commits history. Find the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;peripheryapp&#x2F;homebrew-periphery&#x2F;blob&#x2F;6f8d7a080fc41e336ec6f1dca9039117a7886875&#x2F;Casks&#x2F;periphery.rb&quot;&gt;version that you want and the cask file&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Copy the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;peripheryapp&#x2F;homebrew-periphery&#x2F;6f8d7a080fc41e336ec6f1dca9039117a7886875&#x2F;Casks&#x2F;periphery.rb&quot;&gt;URL of the raw file&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Run &lt;code&gt;brew install --cask [RAW_FILE_URL]&lt;&#x2F;code&gt;. For example if I want to install &lt;code&gt;periphery@2.14.0&lt;&#x2F;code&gt; I need to run the following command:&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;brew install --cask https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;peripheryapp&#x2F;homebrew-periphery&#x2F;6f8d7a080fc41e336ec6f1dca9039117a7886875&#x2F;Casks&#x2F;periphery.rb&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h3 id=&quot;other-ways-to-install&quot;&gt;Other Ways to Install&lt;&#x2F;h3&gt;
&lt;p&gt;There&#x27;s another way to install by using &lt;code&gt;brew edit&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Here&#x27;s the steps:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Run &lt;code&gt;brew edit [APP_NAME]&lt;&#x2F;code&gt;. Note that running this for the first time will trigger the following warning message since you will be editing the Cask file directly&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Warning: edit is a developer command, so Homebrew&amp;#39;s&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;developer mode has been automatically turned on.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;To turn developer mode off, run:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;brew developer off&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Update the version and &lt;code&gt;sha256&lt;&#x2F;code&gt; value based on the version that you want to install. You can find the info on Github. Using the same example:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;diff&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; cask &amp;#39;periphery&amp;#39; do&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF5555;&quot;&gt;-    version &amp;#39;2.15.0&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF5555;&quot;&gt;-    sha256 &amp;#39;7f0d05c7e9d04925f8c8ed4365146c23abd3b4ac1a5865f125438ce9851f93f7&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;+    version &amp;#39;2.14.0&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;+    sha256 &amp;#39;f44af8004706416610709ed4f913cedc06e458941a6968c095c475bef54e1920&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     url &amp;quot;https:&#x2F;&#x2F;github.com&#x2F;peripheryapp&#x2F;periphery&#x2F;releases&#x2F;download&#x2F;#{version}&#x2F;periphery-#{version}.zip&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     name &amp;#39;Periphery&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     homepage &amp;#39;https:&#x2F;&#x2F;github.com&#x2F;peripheryapp&#x2F;periphery&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     binary &amp;#39;periphery&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     depends_on macos: &amp;#39;&amp;gt;= :catalina&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     ```&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     zap delete: [&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     &amp;#39;~&#x2F;Library&#x2F;Caches&#x2F;com.github.peripheryapp&amp;#39;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     &amp;#39;~&#x2F;Library&#x2F;Caches&#x2F;com.peripheryapp.periphery&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     ]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; end&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Save it and simply run &lt;code&gt;brew reinstall [APP_NAME]&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;That&#x27;s all. Hope this helps.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to Fix Xcode 14.3 libarclite_iphonesimulator.a Error</title>
        <published>2023-07-27T03:30:39.626+00:00</published>
        <updated>2023-07-27T03:30:39.626+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/how-to-fix-xcode-14-3-libarclite-error/"/>
        <id>https://faizmokh.com/posts/how-to-fix-xcode-14-3-libarclite-error/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/how-to-fix-xcode-14-3-libarclite-error/">&lt;p&gt;While upgrading Carthage libraries for &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;developer.apple.com&#x2F;documentation&#x2F;xcode-release-notes&#x2F;xcode-14_3_1-release-notes&quot;&gt;Xcode 14.3.1&lt;&#x2F;a&gt;, one of the libraries that my team depends on is throwing errors.
I checked the repo and found out that the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;dzenbot&#x2F;DZNEmptyDataSet&quot;&gt;library have been archived&lt;&#x2F;a&gt;. I forked the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;faizmokh&#x2F;DZNEmptyDataSet&quot;&gt;repo&lt;&#x2F;a&gt; and tried to run it locally.&lt;&#x2F;p&gt;
&lt;p&gt;It threw the following error when I ran it:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ld: file not found: &#x2F;Applications&#x2F;Xcode-14.3.1.app&#x2F;Contents&#x2F;Developer&#x2F;Toolchains&#x2F;XcodeDefault.xctoolchain&#x2F;usr&#x2F;lib&#x2F;arc&#x2F;libarclite_iphonesimulator.a&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;clang: error: linker command failed with exit code 1 (use -v to see invocation)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Apparently, this is because with &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;developer.apple.com&#x2F;documentation&#x2F;xcode-release-notes&#x2F;xcode-14_3_1-release-notes&quot;&gt;Xcode 14.3.1&lt;&#x2F;a&gt; the minimum deployment target have been set to iOS 11. &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;dzenbot&#x2F;DZNEmptyDataSet&quot;&gt;DZNEmptyDataSet&lt;&#x2F;a&gt; is still using iOS 8 as its minimum deployment target. Upgrading it to iOS 11 fixed the error.&lt;&#x2F;p&gt;
&lt;p&gt;p&#x2F;s: Yeah I know the usage of this library is somewhat unecessary but it&#x27;s already being used everywhere and replacing it with our implementation will require huge effort. Maybe some day. Not today.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How To Use Git Worktree To Checkout Multiple Branches At Once</title>
        <published>2023-05-09T03:33:21.014+00:00</published>
        <updated>2023-05-09T03:33:21.014+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/using-git-worktree-to-checkout-multiple-branches/"/>
        <id>https://faizmokh.com/posts/using-git-worktree-to-checkout-multiple-branches/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/using-git-worktree-to-checkout-multiple-branches/">&lt;p&gt;&lt;code&gt;git worktree&lt;&#x2F;code&gt; allows you to checkout multiple branches at the same time. It&#x27;s somewhat similar to &lt;code&gt;git checkout -b&lt;&#x2F;code&gt; except that it will create the branch at a new path.&lt;&#x2F;p&gt;
&lt;p&gt;For example, running this command in your repository will create a new &lt;code&gt;example-worktree&lt;&#x2F;code&gt; folder outside of your repository and a new &lt;code&gt;git branch&lt;&#x2F;code&gt; named &lt;code&gt;example-worktree&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ git worktree add ..&#x2F;example-worktree&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you have an existing branch that you want to use &lt;code&gt;worktree&lt;&#x2F;code&gt; with, you need to run the following command instead&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ git worktree add ..&#x2F;example-worktree $REPLACE_WITH_EXISTING_BRANCH_NAME&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;to-get-a-list-of-worktree&quot;&gt;To get a list of worktree&lt;&#x2F;h2&gt;
&lt;p&gt;To see all available working trees that you have created, you can run&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ git worktree list&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This will print out the following outputs&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;ROOT&#x2F;go-projects&#x2F;main-project-folder   14e218b [main]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&#x2F;ROOT&#x2F;go-projects&#x2F;example-worktree      14e218b [example-branch]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The first prefix is the worktree&#x27;s folder path and the suffix is the name of the branch it&#x27;s on&lt;&#x2F;p&gt;
&lt;h2 id=&quot;to-remove-a-worktree&quot;&gt;To remove a worktree&lt;&#x2F;h2&gt;
&lt;p&gt;I would recommend you to delete a worktree once you&#x27;ve done using it. To delete it use the following command:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ git worktree remove $WORKTREE_PATH_NAME&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;caveats&quot;&gt;Caveats&lt;&#x2F;h2&gt;
&lt;p&gt;One thing that I noticed when using worktree is that you can&#x27;t checkout to the same branch that&#x27;s already in worktree. For example, I can&#x27;t checkout to &lt;code&gt;example-branch&lt;&#x2F;code&gt; from &lt;code&gt;main&lt;&#x2F;code&gt; branch.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;code&gt;git worktree&lt;&#x2F;code&gt; is a pretty useful feature but I would recommend you use it sparingly. It can get confusing if you have too many worktree available. I would recommend you to remove it once you&#x27;re done with it.&lt;&#x2F;p&gt;
&lt;p&gt;Hopefully you find this helpful as a quick references.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>PHP missing dependencies</title>
        <published>2023-02-14T07:47:50.523+00:00</published>
        <updated>2023-02-14T07:47:50.523+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/php-missing-dependencies/"/>
        <id>https://faizmokh.com/posts/php-missing-dependencies/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/php-missing-dependencies/">&lt;p&gt;I was having some issues with my PHP package installed through &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;asdf-vm.com&#x2F;&quot;&gt;asdf&lt;&#x2F;a&gt; yesterday. Something about missing libiconv and when I ran &lt;code&gt;php -v&lt;&#x2F;code&gt; it returns me this response:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;No php executable found for php 8.2.0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To fix the issue, I followed this &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;asdf-community&#x2F;asdf-php&#x2F;issues&#x2F;145&quot;&gt;tips on Github issues&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Install the optional dependencies:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ brew install gmp libsodium imagemagick&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Reinstall the possible missing dependencies. &lt;code&gt;brew&lt;&#x2F;code&gt; will just skipped any packages that I&#x27;ve already installed.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ brew install autoconf automake bison freetype gd gettext icu4c krb5 libedit libiconv libjpeg libpng libxml2 libzip pkg-config re2c zlib&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Reinstall latest php with &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;asdf-vm.com&#x2F;&quot;&gt;asdf&lt;&#x2F;a&gt; and set it as the default&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ asdf install php latest&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ asdf global php latest&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I reshimed it just to make sure&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ asdf reshim php&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That&#x27;s all&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Replacing nvm with asdf to manage NodeJS versions</title>
        <published>2021-02-17T04:58:16.292+00:00</published>
        <updated>2021-02-17T04:58:16.292+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/replace-nvm-with-asdf-to-manage-nodejs-versions/"/>
        <id>https://faizmokh.com/posts/replace-nvm-with-asdf-to-manage-nodejs-versions/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/replace-nvm-with-asdf-to-manage-nodejs-versions/">&lt;p&gt;I&#x27;ve been using &lt;code&gt;zsh&lt;&#x2F;code&gt; with &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;zsh-users&#x2F;antigen&quot;&gt;antigen&lt;&#x2F;a&gt; as the package manager for years. Over time as I add more customizations, I noticed that my shell startup time has become slow. Sometimes, it would take more than 3 seconds to start up.&lt;&#x2F;p&gt;
&lt;p&gt;I read few months (or a year) ago that nvm, a version manager for &lt;code&gt;nodejs&lt;&#x2F;code&gt; can cause &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;nvm-sh&#x2F;nvm&#x2F;issues&#x2F;1277&quot;&gt;this issue&lt;&#x2F;a&gt; so I thought maybe it&#x27;s the right time I should try &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;asdf-vm.com&#x2F;#&#x2F;&quot;&gt;asdf&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;asdf-vm.com&#x2F;#&#x2F;&quot;&gt;asdf&lt;&#x2F;a&gt; is basically just another tool to manage versions but instead of having to install multiple tools like &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rbenv&#x2F;rbenv&quot;&gt;rbenv&lt;&#x2F;a&gt; for ruby or &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;nvm-sh&#x2F;nvm&quot;&gt;nvm&lt;&#x2F;a&gt; for &lt;code&gt;nodejs&lt;&#x2F;code&gt;, you can just use &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;asdf-vm.com&#x2F;#&#x2F;&quot;&gt;asdf&lt;&#x2F;a&gt; and use its plugins to manage all the language versions that you&#x27;re using.&lt;&#x2F;p&gt;
&lt;p&gt;Anyway, I&#x27;m not going to talk about what&#x27;s so good about it. For that, you can read the docs yourself. I&#x27;m just going to document the steps I did here.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;removing-nvm-completely&quot;&gt;Removing nvm completely&lt;&#x2F;h2&gt;
&lt;p&gt;First of all, I have to completely remove &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;nvm-sh&#x2F;nvm&quot;&gt;nvm&lt;&#x2F;a&gt;. Here are the steps:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6272A4;&quot;&gt;# list out all the nodes version I&amp;#39;m using&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; nvm ls&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6272A4;&quot;&gt;# uninstall nodejs&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; nvm uninstall&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt; &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt;NODEJS_VERSIO&lt;&#x2F;span&gt;&lt;span&gt;N&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6272A4;&quot;&gt;# uninstall nvm with brew (since I install it using Brew)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; brew uninstall nvm&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6272A4;&quot;&gt;# delete related dotfiles and directory&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; rm&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; -rf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; ~&#x2F;.nvm&#x2F; ~&#x2F;.nvmrc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;installing-asdf&quot;&gt;Installing asdf&lt;&#x2F;h2&gt;
&lt;p&gt;Then, I installed &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;asdf-vm.com&#x2F;#&#x2F;&quot;&gt;asdf&lt;&#x2F;a&gt; using Brew&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #6272A4;&quot;&gt;# install asdf using Brew&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; brew install asdf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then, I have to add the following in my &lt;code&gt;~&#x2F;.zshrc&lt;&#x2F;code&gt; file to load &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;asdf-vm.com&#x2F;#&#x2F;&quot;&gt;asdf&lt;&#x2F;a&gt; properly.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# setup asdf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;. &#x2F;usr&#x2F;local&#x2F;opt&#x2F;asdf&#x2F;asdf.sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That basically completes the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;asdf-vm.com&#x2F;#&#x2F;&quot;&gt;asdf&lt;&#x2F;a&gt; setup. Next I have to install the &lt;code&gt;nodejs&lt;&#x2F;code&gt; plugin. To install the &lt;code&gt;nodejs&lt;&#x2F;code&gt; plugin, I run the following command:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; asdf plugin-add nodejs&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6272A4;&quot;&gt; # install nodejs plugin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; bash&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; -c&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt; &amp;#39;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt;${ASDF_DATA_DIR:=$HOME&#x2F;.asdf}&#x2F;plugins&#x2F;nodejs&#x2F;bin&#x2F;import-release-team-keyring # import nodejs release team OpenPGP keys&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;I got an error when trying to import the keys. Apparently, I don&#x27;t have &lt;code&gt;gpg2&lt;&#x2F;code&gt; installed yet so I have to install it first.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ brew install gpg2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;After installing &lt;code&gt;gpg2&lt;&#x2F;code&gt;, I can finally run the &lt;code&gt;nodejs&lt;&#x2F;code&gt; installation without any error.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ asdf install nodejs 15.8.0 # install nodejs version 15.8.0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ asdf global nodejs 15.8.0 # set it as the global version&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That&#x27;s pretty much it. I finally have a working &lt;code&gt;nodejs&lt;&#x2F;code&gt; environment and I notice that my terminal startup time is a little bit faster now. Nice.&lt;&#x2F;p&gt;
&lt;p&gt;I just need to replace &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;rbenv&#x2F;rbenv&quot;&gt;rbenv&lt;&#x2F;a&gt; and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;pyenv&#x2F;pyenv&quot;&gt;pyenv&lt;&#x2F;a&gt; next.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Runners - iOS app to manage Gitlab Runners</title>
        <published>2021-01-06T05:41:21.605+00:00</published>
        <updated>2021-01-06T05:41:21.605+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/runners-manage-gitlab-runners/"/>
        <id>https://faizmokh.com/posts/runners-manage-gitlab-runners/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/runners-manage-gitlab-runners/">&lt;p&gt;I made a thing! It&#x27;s an iOS app to remotely manage Gitlab runners. I wrote this app to solve one of the pain points that I frequently face back when I managed the CI&#x2F;CD machine that hosted the Gitlab runners for my teams.&lt;&#x2F;p&gt;
&lt;p&gt;My coworkers would frequently ask me to check why their pipelines or runners were failing and so in a begrudging manner, I would &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Virtual_Network_Computing&quot;&gt;VNC&#x27;d&lt;&#x2F;a&gt; into the machine and checked them.&lt;&#x2F;p&gt;
&lt;p&gt;so...&lt;&#x2F;p&gt;
&lt;p&gt;🥁🥁🥁&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;uploads&#x2F;runners-appstore.jpeg&quot; alt=&quot;A screenshot of Runners app on the App Store&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;TADAA!&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This app solved these problems by providing an easy access for me to:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Quickly check the runners status&lt;&#x2F;li&gt;
&lt;li&gt;Pause, resume, or delete a runner remotely&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Oh! Did I mentioned that this is my first SwiftUI and paid app? SwiftUI is really fun to write but there are some weird bugs that Apple needs to fix still.&lt;&#x2F;p&gt;
&lt;p&gt;Anyway, it&#x27;s available now on the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;apps.apple.com&#x2F;my&#x2F;app&#x2F;runners-manage-gitlab-runner&#x2F;id1547639220&quot;&gt;App Store&lt;&#x2F;a&gt; for the price of &lt;strong&gt;US$1.99&lt;&#x2F;strong&gt; or &lt;strong&gt;MYR 7.90&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Do check it out from the links below!&lt;&#x2F;p&gt;
&lt;p&gt;👉 &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;apps.apple.com&#x2F;my&#x2F;app&#x2F;runners-manage-gitlab-runner&#x2F;id1547639220&quot;&gt;Download it from the AppStore&lt;&#x2F;a&gt; 👈&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to list all the git commits history for a specific file</title>
        <published>2020-12-16T02:24:09.782+00:00</published>
        <updated>2020-12-16T02:24:09.782+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/how-to-list-git-commits-history-for-specific-file/"/>
        <id>https://faizmokh.com/posts/how-to-list-git-commits-history-for-specific-file/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/how-to-list-git-commits-history-for-specific-file/">&lt;p&gt;Assuming the following situation:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;You work on a large project that has an extensive git commits history and a lot of files&lt;&#x2F;li&gt;
&lt;li&gt;You need to debug a certain issue that was caused by a certain file&lt;&#x2F;li&gt;
&lt;li&gt;You look at the commits history to see which commit is causing the issue but going through it one by one is like finding a needle in a haystack&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Well, worry not because you can use the following &lt;code&gt;git log&lt;&#x2F;code&gt; command to solve your issue:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; git log&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; --follow --&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; path&#x2F;to&#x2F;file.txt&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This will list down all the commits history for that specific file. It will work even if the file was deleted or renamed. However please be aware that it will only work for a single file at a time.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to undo a git rebase</title>
        <published>2020-11-05T03:15:13.196+00:00</published>
        <updated>2020-11-05T03:15:13.196+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/how-to-undo-git-rebase/"/>
        <id>https://faizmokh.com/posts/how-to-undo-git-rebase/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/how-to-undo-git-rebase/">&lt;p&gt;Given the following situation:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;You&#x27;re on &lt;code&gt;feature&#x2F;*&lt;&#x2F;code&gt; branch and you have your latest changes already pushed to &lt;code&gt;origin&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Now, you want to rebase your &lt;code&gt;feature&#x2F;*&lt;&#x2F;code&gt; branch with the latest &lt;code&gt;master&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;You type in &lt;code&gt;git rebase master&lt;&#x2F;code&gt; from your &lt;code&gt;feature&#x2F;*&lt;&#x2F;code&gt; branch&lt;&#x2F;li&gt;
&lt;li&gt;You fix all conflicts and finish the rebase&lt;&#x2F;li&gt;
&lt;li&gt;OH SHIT SOMETHING&#x27;S WRONG I NEED TO UNDO IT BUT HOW?&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Okay, take a deep breath and just calm down. Use the following to reset it to your latest origin.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; git reset&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; --hard&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; ORIG_HEAD&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That&#x27;s it. This will only work if you haven&#x27;t push your changes to &lt;code&gt;origin&lt;&#x2F;code&gt; yet. If you have, then you need to use &lt;code&gt;git reflog&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to setup Jenkins with Docker</title>
        <published>2020-09-26T08:57:56.525+00:00</published>
        <updated>2020-09-26T08:57:56.525+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/how-to-setup-jenkins-with-docker/"/>
        <id>https://faizmokh.com/posts/how-to-setup-jenkins-with-docker/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/how-to-setup-jenkins-with-docker/">&lt;p&gt;Here is an easy way to setup &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.jenkins.io&#x2F;&quot;&gt;Jenkins&lt;&#x2F;a&gt; with &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.docker.com&#x2F;&quot;&gt;Docker&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Run the following commands in your terminal&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; pull jenkins&#x2F;jenkins:lts&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; run&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; --detach --publish&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; 8080:8080&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; --volume&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;jenkins_home:&#x2F;var&#x2F;jenkins_home&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; --name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; jenkins jenkins&#x2F;jenkins:lts&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;docker&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; exec jenkins cat &#x2F;var&#x2F;jenkins_home&#x2F;secrets&#x2F;initialAdminPassword&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;
&lt;p&gt;The above command will generate a password. Copy said password&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Open &lt;code&gt;localhost:8080&lt;&#x2F;code&gt; and paste in the password&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Setup your user account and install suggested plugins.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;That&#x27;s it!&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>What is the difference between Docker container and Docker image?</title>
        <published>2020-08-25T07:54:01.914+00:00</published>
        <updated>2020-08-25T07:54:01.914+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/what-is-difference-between-docker-container-and-docker-image/"/>
        <id>https://faizmokh.com/posts/what-is-difference-between-docker-container-and-docker-image/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/what-is-difference-between-docker-container-and-docker-image/">&lt;p&gt;Today I learned the difference between &lt;strong&gt;image&lt;&#x2F;strong&gt; and &lt;strong&gt;container&lt;&#x2F;strong&gt; in &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.docker.com&#x2F;resources&#x2F;what-container&quot;&gt;Docker&lt;&#x2F;a&gt;. An &lt;strong&gt;image&lt;&#x2F;strong&gt; is a template that can be used to create a container while &lt;strong&gt;container&lt;&#x2F;strong&gt; is the instances of said Docker images. The container is the one that runs your application.&lt;&#x2F;p&gt;
&lt;p&gt;To explain it in &lt;em&gt;cake&lt;&#x2F;em&gt; term, &lt;strong&gt;image&lt;&#x2F;strong&gt; is the recipe of the cake and &lt;strong&gt;container&lt;&#x2F;strong&gt; is the cake itself. You can create multiple cakes based on the same recipe.&lt;&#x2F;p&gt;
&lt;p&gt;To see all the images available, you can run the following:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; docker images&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;and to see the container that&#x27;s currently running, you can run:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; docker ps&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;or if you want to see the list of available containers, run:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; docker ps&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; -a&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That&#x27;s it. 🎂&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;References:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;23735149&#x2F;what-is-the-difference-between-a-docker-image-and-a-container&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to Clone a Git Repository With Submodules</title>
        <published>2020-08-16T16:13:21.548+00:00</published>
        <updated>2020-08-16T16:13:21.548+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/how-to-clone-git-repo-with-submodules/"/>
        <id>https://faizmokh.com/posts/how-to-clone-git-repo-with-submodules/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/how-to-clone-git-repo-with-submodules/">&lt;p&gt;Today I learned how to git clone a repository that has &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;book&#x2F;en&#x2F;v2&#x2F;Git-Tools-Submodules&quot;&gt;git submodules&lt;&#x2F;a&gt; inside of it. I realized that when I cloned a project it will clone the parent repo but the submodules will be empty. Here are the steps on how to clone it properly.&lt;&#x2F;p&gt;
&lt;p&gt;If you haven&#x27;t cloned the repository yet, you can use &lt;code&gt;--recurse-submodules&lt;&#x2F;code&gt; option:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; git clone&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; --recurse-submodules&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; https:&#x2F;&#x2F;github.com&#x2F;sample&#x2F;sample-repo.git&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Otherwise, If you already cloned the project then you can use the following command. Run the command inside your git repository.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; git submodule update&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; --init --recursive&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This will initialize, fetch and checkout any nested submodules for the repository. That&#x27;s it.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to fix Xcode: &quot;Could Not Locate Device Support Files&quot; error</title>
        <published>2020-05-27T04:43:29.783+00:00</published>
        <updated>2020-05-27T04:43:29.783+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/how-to-fix-xcode-could-not-locate-device-support/"/>
        <id>https://faizmokh.com/posts/how-to-fix-xcode-could-not-locate-device-support/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/how-to-fix-xcode-could-not-locate-device-support/">&lt;p&gt;There may be a time when you try to run your app in your device and you get the following error:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Could not locate device support files.&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This iPhone (Model ...) is running iOS 13.4 (11E608c), which may not be supported by this version of Xcode.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;This issue usually happened when you are still developing your app using old version of Xcode but your device have already been upgraded to latest iOS version that is not supported by Xcode.&lt;&#x2F;p&gt;
&lt;p&gt;There are multiple ways to solve this issue:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Upgrade your Xcode to the latest version&lt;&#x2F;strong&gt; - While this is the most obvious way to fix the issue, it could be your most hardest too. Depending on the situation, you might have to update all your projects issues before upgrading (Unsupported swift version, Unsupported SDK version, etc). That&#x27;s a lot of work&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Keep two versions of Xcode installed&lt;&#x2F;strong&gt; - This have been my preferred option whenever there&#x27;s a new iOS beta version dropped and I couldn&#x27;t wait to upgrade my device (living on the edge baby!). You have to symlink the &lt;code&gt;DeviceSupport&#x2F;&lt;&#x2F;code&gt; folder from the beta or latest version to the stable version that you&#x27;ve been using.&lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; However this option might not be feasible if you have a limited disk space on your machine.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Copying the latest device support files to &lt;code&gt;DeviceSupport&lt;&#x2F;code&gt; folder&lt;&#x2F;strong&gt; - I just discovered this today and still in awe on how simple it is. I will list the steps down below.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;to-fix-could-not-locate-device-support-files-error-issue-with-new-device-support-file&quot;&gt;To fix &quot;Could Not Locate Device Support Files&quot; Error Issue with new device support file&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Go to the following Github repo: &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;iGhibli&#x2F;iOS-DeviceSupport&#x2F;tree&#x2F;master&#x2F;DeviceSupport&quot;&gt;iGhibli&#x2F;iOS-DeviceSupport&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Find the zip files that&#x27;s matching your device&#x27;s iOS version and download it.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Open the following path in Finder:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; open &#x2F;Applications&#x2F;Xcode.app&#x2F;Contents&#x2F;Developer&#x2F;Platforms&#x2F;iPhoneOS.platform&#x2F;DeviceSupport&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Copy and paste the zip files that you have downloaded to &lt;code&gt;DeviceSupport&#x2F;&lt;&#x2F;code&gt; folder&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Close and restart your Xcode.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;That&#x27;s it. You should be able to run your app in your device now. Hope you will find this tips useful.&lt;&#x2F;p&gt;
&lt;p&gt;Until next time. ✌️&lt;&#x2F;p&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;1&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;1&lt;&#x2F;sup&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;twitter.com&#x2F;steipete&quot;&gt;@steipete&lt;&#x2F;a&gt; did an awesome job of maintaining a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;gist.github.com&#x2F;steipete&#x2F;d9b44d8e9f341e81414e86d7ff8fb62d&quot;&gt;gist of the command&lt;&#x2F;a&gt; to refer too.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;h2 id=&quot;references&quot;&gt;References:&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;iGhibli&#x2F;iOS-DeviceSupport&quot;&gt;github.com&#x2F;iGhibli&#x2F;iOS-DeviceSupport&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;54624850&#x2F;could-not-locate-device-support-files-in-xcode&quot;&gt;StackOverflow - Could not locate device support files in Xcode&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to Completely Remove Git Submodules Within a Repository</title>
        <published>2020-05-18T14:13:29.189+00:00</published>
        <updated>2020-05-18T14:13:29.189+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/how-to-completely-remove-git-submodule-within-repo/"/>
        <id>https://faizmokh.com/posts/how-to-completely-remove-git-submodule-within-repo/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/how-to-completely-remove-git-submodule-within-repo/">&lt;p&gt;I found myself having to google this multiple times so I decide to write it here as a quick references for myself.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.blog&#x2F;2016-02-01-working-with-submodules&#x2F;&quot;&gt;Git submodules&lt;&#x2F;a&gt; is a way for you to keep a git repository as a subdirectory of another git repository. It&#x27;s useful when you want to incorporate and keep track of external code or framework that your project depends on. It&#x27;s like a poor man&#x27;s version of &lt;code&gt;npm&lt;&#x2F;code&gt; or &lt;code&gt;cocoapods&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Anyway, to add a git submodules is very easy. It&#x27;s just simple a one liner. Eg:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;git submodule add git@github.com:faizmokhtar&#x2F;example-repo library&#x2F;example-submodule&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That&#x27;s it. But the steps to remove it are very tedious and it&#x27;s something that I always forgot how to. So here are the steps to completely remove it from your repository.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;to-completely-remove-git-submodule&quot;&gt;To Completely Remove Git Submodule&lt;&#x2F;h2&gt;
&lt;ol&gt;
&lt;li&gt;Open and edit the &lt;code&gt;.gitmodules&lt;&#x2F;code&gt; with your text editor.&lt;&#x2F;li&gt;
&lt;li&gt;Find and delete the relevant submodule lines:&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[submodule &amp;quot;library&#x2F;example-submodule&amp;quot;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    path = library&#x2F;example-submodule&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    url = git@github.com:faizmokhtar&#x2F;example-repo.git&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Open and edit &lt;code&gt;.git&#x2F;config&lt;&#x2F;code&gt; file.&lt;&#x2F;li&gt;
&lt;li&gt;Find and delete the relevant submodule lines:&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[submodule &amp;quot;library&#x2F;example-submodule&amp;quot;]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; url = git@github.com:faizmokhtar&#x2F;example-repo.git&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Delete the submodules.&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ rm -rf library&#x2F;example-submodule&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Delete the files in &lt;code&gt;.git&#x2F;modules&lt;&#x2F;code&gt;&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ rm -rf .git&#x2F;modules&#x2F;example-submodule&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Now, there should be some unstaged changes in your git staging area. Stage it and commit all the changes.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;That should be it. Maybe you can turn this into a one liner bash script.&lt;&#x2F;p&gt;
&lt;p&gt;Until next time. ✌️&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to connect to Google Cloud SQL with Cloud SQL Proxy</title>
        <published>2020-05-10T14:26:04.287+00:00</published>
        <updated>2020-05-10T14:26:04.287+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/how-to-connect-to-google-cloud-sql-cloud-sql-proxy/"/>
        <id>https://faizmokh.com/posts/how-to-connect-to-google-cloud-sql-cloud-sql-proxy/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/how-to-connect-to-google-cloud-sql-cloud-sql-proxy/">&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;cloud.google.com&#x2F;sql&#x2F;docs&#x2F;mysql&#x2F;sql-proxy#macos-64-bit&quot;&gt;Cloud SQL Proxy&lt;&#x2F;a&gt; is one of the ways to connect to your &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;cloud.google.com&#x2F;sql&#x2F;docs&quot;&gt;Cloud SQL&lt;&#x2F;a&gt; instance. It&#x27;s useful if you want to securely connect to &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;cloud.google.com&#x2F;sql&#x2F;docs&quot;&gt;Cloud SQL&lt;&#x2F;a&gt; from your local applications.&lt;&#x2F;p&gt;
&lt;p&gt;Here are the steps to setup &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;cloud.google.com&#x2F;sql&#x2F;docs&#x2F;mysql&#x2F;sql-proxy#macos-64-bit&quot;&gt;Cloud SQL Proxy&lt;&#x2F;a&gt; on your local machines:&lt;&#x2F;p&gt;
&lt;h2 id=&quot;1-download-and-setup-cloud-sql-proxy-macos&quot;&gt;1. Download and Setup Cloud SQL Proxy (macOS)&lt;&#x2F;h2&gt;
&lt;p&gt;First of all you have to download it. I would recommend putting it at root (&lt;code&gt;~&#x2F;&lt;&#x2F;code&gt;) folder.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; cd ~&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; curl&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; -o&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; cloud_sql_proxy https:&#x2F;&#x2F;dl.google.com&#x2F;cloudsql&#x2F;cloud_sql_proxy.darwin.amd64&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; chmod +x cloud_sql_proxy&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;2-create-a-google-service-account-for-the-proxy&quot;&gt;2. Create a Google Service Account for the Proxy&lt;&#x2F;h2&gt;
&lt;p&gt;A &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;cloud.google.com&#x2F;iam&#x2F;docs&#x2F;understanding-service-accounts&quot;&gt;service account&lt;&#x2F;a&gt; is a special type of Google account that belongs to your project. Instead of using your individual user&#x27;s credential, you can use service account to authenticate your application.&lt;&#x2F;p&gt;
&lt;p&gt;To set it up, follow these commands. You can replace &lt;code&gt;&quot;my-proxy-user&quot;&lt;&#x2F;code&gt; to your likings&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; gcloud iam service-accounts create proxy-user&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; --display-name&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt;my-proxy-user&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Once you have created it, list it down to get the email of the service account.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; gcloud iam service-accounts list&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next, allow your service account to connect to the Cloud SQL proxy on your behalf. You can do this by giving &lt;code&gt;Cloud SQL Client&lt;&#x2F;code&gt; role to the service account.&lt;&#x2F;p&gt;
&lt;p&gt;Run the following commands. Replace &lt;code&gt;[PROJECT_ID]&lt;&#x2F;code&gt; and &lt;code&gt;[SERVICE_ACCOUNT_EMAIL]&lt;&#x2F;code&gt; with your own Google Project ID and the service account email that you got from the command before.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; gcloud projects add-iam-policy-binding&lt;&#x2F;span&gt;&lt;span&gt; [PROJECT_ID] --member &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt;\&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;serviceAccount:[SERVICE_ACCOUNT_EMAIL]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; --role&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; roles&#x2F;cloudsql.client&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;3-create-key-json&quot;&gt;3. Create &lt;code&gt;key.json&lt;&#x2F;code&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;Next, generate a &lt;code&gt;key.json&lt;&#x2F;code&gt; for authentication to the service account. (I would recommend you to ignore this file in git)&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; gcloud iam service-accounts keys create key.json&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; --iam-account&lt;&#x2F;span&gt;&lt;span&gt; [SERVICE_ACCOUNT_EMAIL]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;4-start-cloud-sql-proxy&quot;&gt;4. Start Cloud SQL Proxy&lt;&#x2F;h2&gt;
&lt;p&gt;Finally to start the Cloud SQL Proxy, run the following commands. Replace the &lt;code&gt;[INSTANCE_CONNECTION_NAME]&lt;&#x2F;code&gt; with your own and the &lt;code&gt;[PORT]&lt;&#x2F;code&gt; based on the database you want to connect to.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; .&#x2F;cloud_sql_proxy&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; -instances=[INSTANCE_CONNECTION_NAME]=tcp:[PORT] -credential_file=key.json&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If everything is working fine, you will get an output similar like this&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;2020&#x2F;05&#x2F;10&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; 22:23:07 Listening on 127.0.0.1:5432 for&lt;&#x2F;span&gt;&lt;span&gt; [INSTANCE_CONNECTION_NAME]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;2020&#x2F;05&#x2F;10&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; 22:23:07 Ready for new connections&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That&#x27;s pretty much it. You should be connected to your Cloud SQL from your local machine now.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;error-troubleshooting&quot;&gt;Error Troubleshooting&lt;&#x2F;h2&gt;
&lt;p&gt;If you happened to get following error:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;listen&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; tcp 127.0.0.1:5432: bind: address already in use&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;It&#x27;s likely you already have a local database instance running on your local machine that&#x27;s using the port &lt;code&gt;5432&lt;&#x2F;code&gt; (In this case it&#x27;s Postgresql). If this is the case, stop the running instance first.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to create multiple screen previews in SwiftUI</title>
        <published>2020-04-06T12:39:36.964+00:00</published>
        <updated>2020-04-06T12:39:36.964+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/how-to-create-multiple-screen-previews-in-swiftui/"/>
        <id>https://faizmokh.com/posts/how-to-create-multiple-screen-previews-in-swiftui/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/how-to-create-multiple-screen-previews-in-swiftui/">&lt;p&gt;Today I learned that you can actually create multiple Xcode screen previews in SwiftUI.&lt;&#x2F;p&gt;
&lt;p&gt;Assuming you have a SwiftUI &lt;code&gt;View&lt;&#x2F;code&gt; named &lt;code&gt;ContentView&lt;&#x2F;code&gt;. In the &lt;code&gt;PreviewProvider&lt;&#x2F;code&gt;, create a &lt;code&gt;Group&lt;&#x2F;code&gt; and init multiple &lt;code&gt;ContentView()&lt;&#x2F;code&gt; children inside of it. For example:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;swift&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt;struct&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;font-style: italic;&quot;&gt; ContentView_Previews&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;font-style: italic;&quot;&gt; PreviewProvider&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt;    static var&lt;&#x2F;span&gt;&lt;span&gt; previews:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt; some&lt;&#x2F;span&gt;&lt;span&gt; View {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;        Group&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;            ContentView&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;previewDevice&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;PreviewDevice&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;rawValue&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt;iPhone 11&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;previewDisplayName&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt;iPhone 11&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6272A4;&quot;&gt; &#x2F;&#x2F; Optional&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;            ContentView&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;previewDevice&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;PreviewDevice&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;rawValue&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt;iPhone 8&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;previewDisplayName&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt;iPhone 8 Dark&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;environment&lt;&#x2F;span&gt;&lt;span&gt;(\.colorScheme, .dark)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;environment&lt;&#x2F;span&gt;&lt;span&gt;(\.sizeCategory, .accessibilityLarge)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;            ContentView&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;previewDevice&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;PreviewDevice&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;rawValue&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt;iPhone SE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;previewDisplayName&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt;iPhone SE&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This will display the &lt;code&gt;View&lt;&#x2F;code&gt; that you have created in 3 previews with the following order:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Display it in iPhone 11&lt;&#x2F;li&gt;
&lt;li&gt;Display it in iPhone 8 with dark mode enabled and large accessibility size font set&lt;&#x2F;li&gt;
&lt;li&gt;Display it in iPhone SE&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Here&#x27;s how the above code will look like in action&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;uploads&#x2F;preview.gif&quot; alt=&quot;Xcode 11 Multiple Previews&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This is going to be super useful when you want to quickly preview your &lt;code&gt;View&lt;&#x2F;code&gt; in different screen sizes, accessibility mode or color schemes. Neat huh?&lt;&#x2F;p&gt;
&lt;p&gt;References:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.hackingwithswift.com&#x2F;quick-start&#x2F;swiftui&#x2F;swiftui-tips-and-tricks&quot;&gt;Hacking With Swift - SwiftUI tips and tricks&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to use SwiftUI in a UIKit project</title>
        <published>2020-04-04T10:09:30.345+00:00</published>
        <updated>2020-04-04T10:09:30.345+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/how-to-use-swiftui-in-uikit-project/"/>
        <id>https://faizmokh.com/posts/how-to-use-swiftui-in-uikit-project/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/how-to-use-swiftui-in-uikit-project/">&lt;p&gt;Did you know that SwiftUI can be use in UIKit project? To use SwiftUI in UIKit project, you have to make use of &lt;code&gt;UIHostingViewController&lt;&#x2F;code&gt;. It is a &lt;code&gt;UIViewController&lt;&#x2F;code&gt; that basically &quot;host&quot; a SwiftUI view.&lt;&#x2F;p&gt;
&lt;p&gt;Assuming you have a SwiftUI &lt;code&gt;View&lt;&#x2F;code&gt; named &lt;code&gt;SwiftUIView&lt;&#x2F;code&gt; like so:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;swift&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; swiftUIView &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt; SwiftUIView&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;initializing-it-programmatically&quot;&gt;Initializing it programmatically&lt;&#x2F;h2&gt;
&lt;p&gt;To initialize it programmatically, set the SwiftUI &lt;code&gt;View&lt;&#x2F;code&gt; as the &lt;code&gt;rootView&lt;&#x2F;code&gt; of the &lt;code&gt;UIHostingController&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;swift&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt;let&lt;&#x2F;span&gt;&lt;span&gt; vc &lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt; UIHostingController&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;rootView&lt;&#x2F;span&gt;&lt;span&gt;: swiftUIView)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #BD93F9;font-style: italic;&quot;&gt;self&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;present&lt;&#x2F;span&gt;&lt;span&gt;(vc, &lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;animated&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt;, &lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;completion&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; nil&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;initializing-it-in-storyboard&quot;&gt;Initializing it in Storyboard&lt;&#x2F;h2&gt;
&lt;p&gt;Using it in Storyboard requires a little bit more work.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;First, add a &lt;strong&gt;Hosting View Controller&lt;&#x2F;strong&gt; and create a segue to it&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;uploads&#x2F;uihosting-storyboard.png&quot; alt=&quot;Search for UIHostingController&quot; title=&quot;Search for UIHostingController in Storyboard&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Then, create an &lt;code&gt;IBSegueAction&lt;&#x2F;code&gt; where you can init the &lt;code&gt;UIHostingController&lt;&#x2F;code&gt; like so&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;swift&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt; @IBSegueAction func&lt;&#x2F;span&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt; openSwiftUIView&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;_&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB86C;font-style: italic;&quot;&gt; coder&lt;&#x2F;span&gt;&lt;span&gt;: NSCoder)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt; -&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; UIViewController&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt;?&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FF79C6;&quot;&gt;     return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt; UIHostingController&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;coder&lt;&#x2F;span&gt;&lt;span&gt;: coder, &lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;rootView&lt;&#x2F;span&gt;&lt;span&gt;: swiftUIView))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That&#x27;s it.&lt;&#x2F;p&gt;
&lt;h5 id=&quot;references&quot;&gt;References:&lt;&#x2F;h5&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;developer.apple.com&#x2F;documentation&#x2F;swiftui&#x2F;uihostingcontroller&quot;&gt;Apple documentation on UIHostingController&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to use Xcode 11&#x27;s Swift Package Manager in your project</title>
        <published>2019-10-12T13:21:59.275+00:00</published>
        <updated>2019-10-12T13:21:59.275+00:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/how-to-use-xcode-11-spm/"/>
        <id>https://faizmokh.com/posts/how-to-use-xcode-11-spm/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/how-to-use-xcode-11-spm/">&lt;p&gt;Similar like &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;cocoapods.org&#x2F;&quot;&gt;Cocoapods&lt;&#x2F;a&gt; or &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Carthage&#x2F;Carthage&quot;&gt;Carthage&lt;&#x2F;a&gt;, you can use &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;swift.org&#x2F;package-manager&#x2F;&quot;&gt;Swift Package Manager&lt;&#x2F;a&gt; to manage the dependencies in your Cocoa project.&lt;&#x2F;p&gt;
&lt;p&gt;With the latest Xcode 11, there is now a native support for Swift Package Manager for you to use it directly in your project.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;adding-a-new-package&quot;&gt;Adding a new package&lt;&#x2F;h2&gt;
&lt;p&gt;To add a new package with Swift Package Manager is really easy. Go to the following Xcode&#x27;s menu:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;File &amp;gt; Swift Packages &amp;gt; Add Package Dependency...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;and add the package&#x27;s repository URL. That&#x27;s it.&lt;&#x2F;p&gt;
&lt;p&gt;For example, to add &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Alamofire&#x2F;Alamofire&quot;&gt;Alamofire&lt;&#x2F;a&gt; library you just have to add &lt;code&gt;https:&#x2F;&#x2F;github.com&#x2F;Alamofire&#x2F;Alamofire.git&lt;&#x2F;code&gt; in the search field.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;uploads&#x2F;swiftpm-1.png&quot; alt=&quot;Add new Swift package in your project&quot; title=&quot;Add new Swift package&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;You then will have the option to configure the package based on the version, branch or even commit.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;uploads&#x2F;swiftpm-2.png&quot; alt=&quot;Set the Swift package rules&quot; title=&quot;Set the Swift package rules&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Once you have chosen the package target, you will noticed the newly added package at the bottom of Xcode&#x27;s Project Navigator. Now, you can &lt;code&gt;import&lt;&#x2F;code&gt; the package as usual.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;removing-a-package&quot;&gt;Removing a package&lt;&#x2F;h2&gt;
&lt;p&gt;To remove a package is easy too. Navigate to your project settings and you will noticed that there is a new section called Swift Packages. Navigate to it, click on your library and click on the minus button below to remove it.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;uploads&#x2F;swiftpm-4.png&quot; alt=&quot;Deleting Swift package from your project&quot; title=&quot;Deleting Swift package from your project&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;caveats&quot;&gt;Caveats&lt;&#x2F;h2&gt;
&lt;p&gt;From my limited understanding of how it works, I was expecting Swift Package Manager to create a &lt;code&gt;Package.swift&lt;&#x2F;code&gt; file but instead it creates a references of the package in &lt;code&gt;.xcodeproj&lt;&#x2F;code&gt; file.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;&#x2F;images&#x2F;uploads&#x2F;swiftpm-5.png&quot; alt=&quot;git diff for the xcodeproj&quot; title=&quot;`git diff` for the xcodeproj&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Based on my experience of how painful it is to solve a merge conflict in &lt;code&gt;.xcodeproj&lt;&#x2F;code&gt; file, this is definitely something that I probably would think twice before using it in a team project. Otherwise, using Swift Package Manager is really easy.&lt;&#x2F;p&gt;
&lt;p&gt;Hey, no &lt;code&gt;rubygems&lt;&#x2F;code&gt; dependencies is already a plus! 😉&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Understanding LLDB contexts in Xcode</title>
        <published>2019-03-26T16:35:41+08:00</published>
        <updated>2019-03-26T16:35:41+08:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/understanding-lldb-contexts-in-xcode/"/>
        <id>https://faizmokh.com/posts/understanding-lldb-contexts-in-xcode/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/understanding-lldb-contexts-in-xcode/">&lt;p&gt;Sometimes when debugging on Xcode with LLDB&#x27;s &lt;code&gt;p&lt;&#x2F;code&gt; or &lt;code&gt;po&lt;&#x2F;code&gt; on a a codebase that have both Objective-C and Swift, Xcode will throw a syntax error at you and you might be wondering out why? You checked for any typos but everything seems to be correct. So what gives?&lt;&#x2F;p&gt;
&lt;p&gt;Well, that&#x27;s because you might be using it in the wrong context.&lt;&#x2F;p&gt;
&lt;p&gt;Here&#x27;s a quick rundown:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;When you stop in Objective-C code using breakpoint, LLDB will use Objective-C debugging context.&lt;&#x2F;p&gt;
&lt;p&gt;So you have to use Objective-C syntax to debug:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;lldb&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt; po&lt;&#x2F;span&gt;&lt;span&gt; [ViewController&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; description]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;Similarly when you add a breakpoint in Swift code, LLDB will use Swift debugging context instead.&lt;&#x2F;p&gt;
&lt;p&gt;So you have to use Swift syntax to debug:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;lldb&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt; po&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; ViewController.description&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;And finally, Xcode will always use Objective-C as the default context. Meaning if you pause the program execution without using breakpoint, you&#x27;ll have to use Objective-C syntax.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;That&#x27;s it. Hopefully this tips will helps you a little bit when debugging a project that have a mixture of both Swift and Objective-C codes. ✌️&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to use Go Dep to Manage Dependencies</title>
        <published>2019-02-11T22:09:13+08:00</published>
        <updated>2019-02-11T22:09:13+08:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/how-to-use-go-dep-to-manage-dependencies/"/>
        <id>https://faizmokh.com/posts/how-to-use-go-dep-to-manage-dependencies/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/how-to-use-go-dep-to-manage-dependencies/">&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;golang.github.io&#x2F;dep&#x2F;&quot;&gt;&lt;code&gt;dep&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;  is a dependency management tool for golang. If you have work on other programming languages,
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;golang.github.io&#x2F;dep&#x2F;&quot;&gt;&lt;code&gt;dep&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; is similar to &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.npmjs.com&#x2F;&quot;&gt;&lt;code&gt;npm&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;cocoapods.org&#x2F;&quot;&gt;&lt;code&gt;pod&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; or &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;packaging.python.org&#x2F;tutorials&#x2F;installing-packages&#x2F;&quot;&gt;&lt;code&gt;pip&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;. In simple words, it is a package manager to manage
your project&#x27;s third party libraries.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;how-to-install-it&quot;&gt;How to install it&lt;&#x2F;h1&gt;
&lt;p&gt;There&#x27;s a few ways to install &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;golang.github.io&#x2F;dep&#x2F;&quot;&gt;&lt;code&gt;dep&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;. Personally, I prefer to install it with &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;brew.sh&#x2F;&quot;&gt;&lt;code&gt;Homebrew&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;
To install it run:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ brew install dep&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h1 id=&quot;initializing-a-project-with-dep&quot;&gt;Initializing a project with &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;golang.github.io&#x2F;dep&#x2F;&quot;&gt;&lt;code&gt;dep&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;&lt;&#x2F;h1&gt;
&lt;p&gt;To initialize it in your &lt;code&gt;go&lt;&#x2F;code&gt; project, go to your project directory and run the following&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ dep init&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;This will create three things in your directory&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;Gopkg.toml&lt;&#x2F;code&gt;: This where you specifies the project dependencies&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;Gopkg.lock&lt;&#x2F;code&gt;: File generated as a result from running &lt;code&gt;dep&lt;&#x2F;code&gt;. It&#x27;s a complete dependency graph for your project.
You shouldn&#x27;t edit this manually.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;vendor&#x2F;&lt;&#x2F;code&gt;: This is where the dependencies are stored&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;&lt;code&gt;dep init&lt;&#x2F;code&gt; will behave differently depending on the state of your project.&lt;&#x2F;p&gt;
&lt;p&gt;If it is a &lt;strong&gt;new project&lt;&#x2F;strong&gt;, &lt;code&gt;Gopkg.toml&lt;&#x2F;code&gt; and &lt;code&gt;vendor&#x2F;&lt;&#x2F;code&gt; will be essentially empty aside
from the usual commented out guides on how to use it.&lt;&#x2F;p&gt;
&lt;p&gt;If it is an &lt;strong&gt;existing project&lt;&#x2F;strong&gt;, &lt;code&gt;Gopkg.toml&lt;&#x2F;code&gt; adn &lt;code&gt;vendor&#x2F;&lt;&#x2F;code&gt; will add all the dependencies
that you have added in your project with &lt;code&gt;go get&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;how-to-use-dep&quot;&gt;How to use &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;golang.github.io&#x2F;dep&#x2F;&quot;&gt;&lt;code&gt;dep&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;?&lt;&#x2F;h1&gt;
&lt;h3 id=&quot;adding-a-new-depencies&quot;&gt;Adding a new depencies&lt;&#x2F;h3&gt;
&lt;p&gt;To add a new depencies in your project, run the following&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ dep ensure -add &amp;lt;DEPENDENCIES&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Replace &lt;code&gt;&amp;lt;DEPENDENCIES&amp;gt;&lt;&#x2F;code&gt; with the path to its project repo. For example&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ dep ensure -add github.com&#x2F;gorilla&#x2F;mux&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;others&quot;&gt;Others&lt;&#x2F;h3&gt;
&lt;p&gt;A few more commands that I find useful:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;dep status&lt;&#x2F;code&gt;: Will report the status of your project dependencies&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;dep prune&lt;&#x2F;code&gt;: Will tell you which libraries that are out of sync&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h1 id=&quot;conclusion&quot;&gt;Conclusion&lt;&#x2F;h1&gt;
&lt;p&gt;I am sure by now you are asking &lt;strong&gt;&quot;why should I use &lt;code&gt;go dep&lt;&#x2F;code&gt; when go already comes with &lt;code&gt;go get&lt;&#x2F;code&gt;?&quot;&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Well, imagine you are working in a team project that uses a lot of dependencies.
Each having their own version of libraries. Pretty soon you will have those
&quot;Works on my machine!&quot; real quick.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;dep&lt;&#x2F;code&gt; solve this by making sure everyone who works on the project is guaranteed to be
using the same version of dependencies.&lt;&#x2F;p&gt;
&lt;p&gt;That&#x27;s it. Hopefully now you have learned the basic usage sof &lt;code&gt;go dep&lt;&#x2F;code&gt; to manage your project dependencies.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to Change Git Branch Name</title>
        <published>2018-09-13T17:26:34+08:00</published>
        <updated>2018-09-13T17:26:34+08:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/how-to-change-git-branch-name/"/>
        <id>https://faizmokh.com/posts/how-to-change-git-branch-name/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/how-to-change-git-branch-name/">&lt;p&gt;Here&#x27;s a quick reference on how you can change your git branch name:&lt;&#x2F;p&gt;
&lt;p&gt;If you want to rename of your current local branch:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; branch&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; -m&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; new-branch-name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you want to change the name of a different local branch&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;git&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; branch&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; -m&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; old-branch new-branch-name&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That&#x27;s it. Bye.&lt;&#x2F;p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to set default git push behaviour</title>
        <published>2018-08-22T18:44:01+08:00</published>
        <updated>2018-08-22T18:44:01+08:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/setting-default-git-push/"/>
        <id>https://faizmokh.com/posts/setting-default-git-push/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/setting-default-git-push/">&lt;p&gt;Oftentimes, I forget that I have to specify the current branch name when pushing it to a remote.&lt;&#x2F;p&gt;
&lt;p&gt;For example:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ git push&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;or like this&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ git push -u origin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Either way, these commands will fail since I didn&#x27;t specify the upstream branch.
&lt;code&gt;git&lt;&#x2F;code&gt; will return an error similar like this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;fatal: The current branch develop has no upstream branch.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;To push the current branch and set the remote as upstream, use&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    git push --set-upstream origin &amp;lt;INSERT BRANCH NAME HERE&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;To avoid this error, I have to set the upstream branch name explicitly first before pushing it
to the remote repository. For example:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ git push -u origin &amp;lt;INSERT BRANCH NAME HERE&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;However, this approach can get pretty tedious since the name of my branches are usually long and usually prefixes with
&lt;code&gt;feature&#x2F;&lt;&#x2F;code&gt;, &lt;code&gt;chore&#x2F;&lt;&#x2F;code&gt; or &lt;code&gt;fix&#x2F;&lt;&#x2F;code&gt;. I can&#x27;t exactly depend on tab-completion either since I have to tab multiple times before pushing in the branch that I wanted to.&lt;&#x2F;p&gt;
&lt;p&gt;Good thing that there is a way for me to implicitly push the current branch by configuring the default git behaviour.
Regardless if the branch already exists in upstream or not. Neat right? To do this simply run the following in your terminal:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ git config --global push.default current&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;code&gt;git&lt;&#x2F;code&gt; will then implicitly assume that I want to push my current branch to upstream. With the configuration set up, I can now simply push my current branch to upstream with the simple command of:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ git push&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That&#x27;s really short and simple. Pretty neat right?&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;small&gt;
Disclaimer: It&#x27;s probably not a good practice but I like it since it fits my current git workflow. If I want to avoid using Git GUI tools, I definitely need to reduce the learning curve by making it simpler and easier than the tools that I&#x27;m used too.
&lt;&#x2F;small&gt;</content>
        
    </entry>
    <entry xml:lang="en">
        <title>How to set zsh as the default terminal shell</title>
        <published>2018-08-20T22:41:07+08:00</published>
        <updated>2018-08-20T22:41:07+08:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/using-zsh-as-default/"/>
        <id>https://faizmokh.com/posts/using-zsh-as-default/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/using-zsh-as-default/">&lt;p&gt;I prefer &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.zsh.org&#x2F;&quot;&gt;&lt;code&gt;zsh&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; over &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;bash&#x2F;&quot;&gt;&lt;code&gt;bash&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; as my everyday shell. Unfortunately, &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.zsh.org&#x2F;&quot;&gt;&lt;code&gt;zsh&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; is not the default shell on macOS.&lt;&#x2F;p&gt;
&lt;p&gt;Here&#x27;s a quick guide on how to make it as a default shell for your machine:&lt;&#x2F;p&gt;
&lt;h2 id=&quot;1-install-zsh&quot;&gt;1. Install &lt;code&gt;zsh&lt;&#x2F;code&gt;&lt;&#x2F;h2&gt;
&lt;p&gt;Make sure zsh is available on your system. If not, install it with &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;brew.sh&#x2F;&quot;&gt;&lt;code&gt;brew&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; brew install zsh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; which zsh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;&#x2F;usr&#x2F;local&#x2F;bin&#x2F;zsh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6272A4;&quot;&gt; #output&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;2-set-zsh-as-default-shell&quot;&gt;2. Set &lt;code&gt;zsh&lt;&#x2F;code&gt; as default shell&lt;&#x2F;h2&gt;
&lt;p&gt;To set is as default shell, run the following in your terminal:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; sudo sh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; -c&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt; &amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt;echo $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;which&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; zsh) &amp;gt;&amp;gt; &#x2F;etc&#x2F;shells&lt;&#x2F;span&gt;&lt;span style=&quot;color: #E9F284;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; chsh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #BD93F9;&quot;&gt; -s&lt;&#x2F;span&gt;&lt;span&gt; $(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #8BE9FD;&quot;&gt;which&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; zsh&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then, simply reopen your shell again and it should used &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.zsh.org&#x2F;&quot;&gt;&lt;code&gt;zsh&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; as the default shell. That&#x27;s it.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;to-check-which-shell-you-re-using&quot;&gt;To check which shell you&#x27;re using&lt;&#x2F;h3&gt;
&lt;p&gt;If you are still unsure whether your shell is running &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.zsh.org&#x2F;&quot;&gt;&lt;code&gt;zsh&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; or &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;bash&#x2F;&quot;&gt;&lt;code&gt;bash&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;, run the following in your terminal:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;$~&lt;&#x2F;span&gt;&lt;span style=&quot;color: #F1FA8C;&quot;&gt; echo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #FFB86C;font-style: italic;&quot;&gt; $0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #50FA7B;&quot;&gt;-zsh&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6272A4;&quot;&gt;  #output&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;center&gt;✌️&lt;&#x2F;center&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Viewing the git diff since the last git pull</title>
        <published>2018-08-07T17:32:55+08:00</published>
        <updated>2018-08-07T17:32:55+08:00</updated>
        
        <author>
          <name>
            
              Unknown
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://faizmokh.com/posts/viewing-git-diff-last-pull/"/>
        <id>https://faizmokh.com/posts/viewing-git-diff-last-pull/</id>
        
        <content type="html" xml:base="https://faizmokh.com/posts/viewing-git-diff-last-pull/">&lt;p&gt;To view the changes between your latest &lt;code&gt;git pull&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #F8F8F2; background-color: #282A36;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ git pull origin&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$~ git diff @{1}..&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;&lt;code&gt;@{n}&lt;&#x2F;code&gt; means the n-th previous value of &lt;code&gt;HEAD&lt;&#x2F;code&gt;. You can refer the official docs on &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;book&#x2F;en&#x2F;v2&#x2F;Git-Tools-Revision-Selection&quot;&gt;reflog Shortnames&lt;&#x2F;a&gt; for more.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;p&#x2F;s&lt;&#x2F;strong&gt;: I am currently trying to dissociate myself from becoming too dependent on &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.sourcetreeapp.com&quot;&gt;SourceTree&lt;&#x2F;a&gt; for daily git operations.&lt;&#x2F;p&gt;
</content>
        
    </entry>
</feed>
