<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jibran Kalia</title>
    <description>The latest articles on DEV Community by Jibran Kalia (@jibrankalia).</description>
    <link>https://dev.to/jibrankalia</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F84855%2F55c978c5-e203-4f60-82d2-2b3dc6a7754a.jpg</url>
      <title>DEV Community: Jibran Kalia</title>
      <link>https://dev.to/jibrankalia</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jibrankalia"/>
    <language>en</language>
    <item>
      <title>Chrome Omnibox</title>
      <dc:creator>Jibran Kalia</dc:creator>
      <pubDate>Sun, 20 Jun 2021 15:27:14 +0000</pubDate>
      <link>https://dev.to/jibrankalia/chrome-omnibox-o64</link>
      <guid>https://dev.to/jibrankalia/chrome-omnibox-o64</guid>
      <description>&lt;p&gt;I use the browser’s address bar several times a day but I never thought deeply about its design. It is after all a simple text input bar. But is it that simple?&lt;/p&gt;

&lt;p&gt;Google Chrome calls it the &lt;code&gt;omnibox&lt;/code&gt;. And it is designed with a specific UX philosophy: &lt;code&gt;reduce cognitive overhead&lt;/code&gt;. In other words, reduce the number of decisions needed to be made to go to a certain page.&lt;/p&gt;

&lt;p&gt;The primary outcome of this philosophy is combining the search and address bar. In the past, these two boxes were separated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Aa5lvMNl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/44hyx5zyx1sy4yhkztc3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Aa5lvMNl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/44hyx5zyx1sy4yhkztc3.png" alt="Old Browser UI"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, by combining them it's one less decision a user has to make. Omnibox's entire goal is to bounce the user to their destination as soon as possible similar to a Google search page.&lt;/p&gt;

&lt;p&gt;As an aside, reducing decision-making is one-way apps are made more addictive. For example, paginations buttons at the end of a page are changed to infinite scrolling so there is no discreet stopping point and a conscious decision to go to the next page is not necessary.&lt;/p&gt;

&lt;p&gt;Source: &lt;a href="https://www.chromium.org/user-experience/omnibox"&gt;https://www.chromium.org/user-experience/omnibox&lt;/a&gt;&lt;/p&gt;

</description>
      <category>omnibox</category>
      <category>chromium</category>
      <category>ux</category>
      <category>100daysofcs</category>
    </item>
    <item>
      <title>Vim tip for Quiver</title>
      <dc:creator>Jibran Kalia</dc:creator>
      <pubDate>Sun, 05 Apr 2020 16:19:41 +0000</pubDate>
      <link>https://dev.to/jibrankalia/vim-tip-for-quiver-1lgo</link>
      <guid>https://dev.to/jibrankalia/vim-tip-for-quiver-1lgo</guid>
      <description>&lt;h4&gt;
  
  
  Navigating wrapped lines using Vim
&lt;/h4&gt;

&lt;p&gt;I was finding myself struggling to navigate between long wrapped lines in Quiver using Vim’s &lt;code&gt;j&lt;/code&gt; and &lt;code&gt;k&lt;/code&gt; commands. Text, as opposed to code, can have long physical lines. I could break them up by add a line break after every period but that feels strange. While perusing the Quiver wiki I landed on the &lt;a href="https://github.com/HappenApps/Quiver/wiki/Vim"&gt;Vim section&lt;/a&gt;. There was my answer:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Quiver has line wrapping turned on by default (src). To get j and k working normally, either use &lt;code&gt;:set nowrap&lt;/code&gt; or &lt;code&gt;:map j gj&lt;/code&gt; and &lt;code&gt;:map k gk&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I applied the keymap and it worked beautifully. I also learned about Vim’s &lt;code&gt;gj&lt;/code&gt; option for the first time. Here is the &lt;a href="https://vim.fandom.com/wiki/Move_cursor_by_display_lines_when_wrapping"&gt;documenation&lt;/a&gt; if you are interested.&lt;/p&gt;

&lt;h4&gt;
  
  
  AppleScript
&lt;/h4&gt;

&lt;p&gt;The next problem was that the map commands were not being persisted. At every restart, I would have to retype &lt;code&gt;:map j gj&lt;/code&gt; and &lt;code&gt;:map k gk&lt;/code&gt;. The docs came in handy again and pointed me to this &lt;a href="https://github.com/YangVincent/dotfiles/blob/master/quiver/Quiver.scpt"&gt;applescript&lt;/a&gt;. The script would programmatically open Quiver and type in those commands. I modified the script to &lt;a href="https://github.com/JibranKalia/dotfiles/blob/9782384c4166a03e6ec0b44690970b92911b3b31/quiver/Quiver.scpt"&gt;my preferences&lt;/a&gt;. Gave it the correct access permissions for an executable via &lt;code&gt;chmod 755 Quiver.sh&lt;/code&gt; and ran it.&lt;/p&gt;

&lt;h4&gt;
  
  
  Accessability Permissions
&lt;/h4&gt;

&lt;p&gt;I got the following error:&lt;code&gt;execution error: System Events got an error: osascript is not allowed to send keystrokes. (1002)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Turns out my Script Editor didn’t have enough permissions. So I went under System Preferences &amp;gt; Security &amp;amp; Privacy &amp;gt; Privacy &amp;gt; Accessibility and checked the box.&lt;/p&gt;

&lt;p&gt;&lt;a href="///static/bffcc86e3251e26f99e4fa7488ac7058/844cc/BFFCC86E3251E26F99E4FA7488AC7058.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t-wZsop7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://jibrankalia.com/static/bffcc86e3251e26f99e4fa7488ac7058/fcda8/BFFCC86E3251E26F99E4FA7488AC7058.png" alt="Accessibility Screen" title="Accessibility Screen"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, I wasn’t done yet. I ran &lt;code&gt;./Quiver.sh&lt;/code&gt; again and got the same permission error. After some research, I realized I needed to give &lt;a href="https://www.iterm2.com/"&gt;iTerm&lt;/a&gt; those same permissions. This is because I was using iTerm to run the script. I gave it those permissions and it worked without errors. However, Quiver’s vim mode started acting weird. Turns out I needed to (programmatically) press &lt;code&gt;Return&lt;/code&gt; between the two map calls. I modified my &lt;a href="https://github.com/JibranKalia/dotfiles/commit/ee67aa07b912005658cc3ee06a136efe5715dcdb"&gt;script&lt;/a&gt; to add &lt;code&gt;keystroke return&lt;/code&gt; between the two map calls and it worked.&lt;/p&gt;

&lt;p&gt;Here is the full applescript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tell application "Quiver" 
    activate
end tell

tell application "System Events"
    -- jump to the correct location (split mode pane)
    keystroke tab
    keystroke tab

    -- if we were already in the cell, jump back
    key down {shift}
    keystroke tab
    keystroke tab
    key up {shift}
    delay 0.01

    -- remap vim
    keystroke ":map j gj"
    keystroke return
    keystroke ":map k gk"
    keystroke return
end tell
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Handy Alias
&lt;/h4&gt;

&lt;p&gt;The last step was to add an alias so I don’t have to remember the full file path to the script. I added this to my &lt;code&gt;.zshrc&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Quiver
alias quiver='/Users/jibrankalia/dotfiles/quiver/Quiver.sh'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I then ran &lt;code&gt;source ~/.zshrc&lt;/code&gt; so that my current shell picked up the changes. I then typed &lt;code&gt;quiver&lt;/code&gt; to the shell and voila everything worked.&lt;/p&gt;

&lt;p&gt;Thank you for reading.&lt;/p&gt;

&lt;p&gt;Credit to &lt;a href="https://github.com/YangVincent"&gt;Vincent Yang&lt;/a&gt; for the original script.&lt;/p&gt;

</description>
      <category>quiver</category>
    </item>
    <item>
      <title>Note taking in Quiver</title>
      <dc:creator>Jibran Kalia</dc:creator>
      <pubDate>Sat, 04 Apr 2020 15:34:24 +0000</pubDate>
      <link>https://dev.to/jibrankalia/note-taking-in-quiver-50e6</link>
      <guid>https://dev.to/jibrankalia/note-taking-in-quiver-50e6</guid>
      <description>&lt;p&gt;I recently started using &lt;a href="https://happenapps.com"&gt;Quiver&lt;/a&gt; to do my normal note-taking. I had already tried a whole gamut of other apps including Evernote, Notion, and Boostnote. I never really got comfortable using Evernote, to be honest. It never went beyond scribbling a note here, a thought there.&lt;/p&gt;

&lt;h4&gt;
  
  
  Notion
&lt;/h4&gt;

&lt;p&gt;I used Notion for a while and I tried to make it work for me. However, the biggest downside was that the Mac and iPhone app just didn’t feel that snappy. It just felt that it was a few milliseconds too slow. To be fair, I was expecting it to boot at the speed of the native Notes app in Mac or iPhone which is not a reasonable comparision. Notion is amazing and provides a groundbreaking approach to taking notes. Furthermore, with the upcoming API support, it could even act as a Headless CMS for this blog. Alas, I couldn’t wait that long.&lt;/p&gt;

&lt;h4&gt;
  
  
  Boostnote
&lt;/h4&gt;

&lt;p&gt;Boostnote came &lt;em&gt;very&lt;/em&gt; close. I liked Boostnote 1.0 because it had great Vim key binding support. However, with &lt;a href="https://github.com/BoostIO/BoostNote.next"&gt;Boostnote 2.0&lt;/a&gt; they introduced &lt;a href="https://pouchdb.com/"&gt;pouchdb&lt;/a&gt; as the main data store. Previously, the filesystem was being used to store the files. They have good reasons for switching as explained in this &lt;a href="https://github.com/BoostIO/Boostnote.next/issues/67#issue-483763503"&gt;issue&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We’ve learned using the file system is quite dangerous while maintaining the current Boostnote project. Most of the problems are caused by the differences between OSs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;However, I share the sentiment of one &lt;a href="https://github.com/BoostIO/Boostnote.next/issues/67#issuecomment-532678745"&gt;commenter&lt;/a&gt; in that I preferred files being saved transparently to the filesystem where I can sync them to Dropbox/Google Drive. Boostnote 2.0 provides a cloud syncing functionality but I much rather use iCloud.&lt;/p&gt;

&lt;h4&gt;
  
  
  Quiver
&lt;/h4&gt;

&lt;p&gt;In the search to get another editor that would fulfill my requirements, I stumbled across &lt;a href="https://happenapps.com"&gt;Quiver&lt;/a&gt;. It sounded very promising as it markets itself as &lt;code&gt;The Programmer's Notebook&lt;/code&gt;. Turns out it was a perfect fit me. Firstly, it feels very snappy as an app. It has decent Vim key binding support. It saves files directly to the filesystem using its &lt;a href="https://github.com/HappenApps/Quiver/wiki/Quiver-Data-Format"&gt;data format&lt;/a&gt;. This allows me to sync using iCloud / Dropbox. Furthermore, there are tons of &lt;a href="https://github.com/HappenApps/Quiver/wiki/Export-Scripts"&gt;export scripts&lt;/a&gt; available in addition to the great native export options. Plus the format is very reasonable to work with so if necessary I can always wire up a custom export script. And it seems like at least &lt;a href="https://news.ycombinator.com/item?id=11009996"&gt;one other person&lt;/a&gt; agrees with me:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Here’s Quiver’s Data-Format. It’s … really good. Like, &lt;em&gt;really&lt;/em&gt; good.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Finally, because it is a Mac-only app it doesn’t need to worry about the cross-filesystem syncing issues Boostnote had to manage.&lt;/p&gt;

&lt;p&gt;There are some cons with Quiver. It is a little more complex than I need. For example, it has 5 different &lt;a href="https://github.com/HappenApps/Quiver/wiki/Getting-Started#2---cell-types"&gt;cells&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Text Cell with a full WYSIWIG editor
- Markdown Cell normal markdown with Vim binding support
- Code Cell that uses ACME
- Latex Cell
- Diagram Cell
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I only use the markdown block (I tend to put my code samples in the markdown block) so I don’t need all the other blocks. Thankfully, Quiver has the option to set the default cell type which I quickly set as Markdown. Though I do plan to explore the &lt;a href="https://github.com/HappenApps/Quiver/wiki/Getting-Started#diagram-cell"&gt;Diagram cell&lt;/a&gt; further in the future.&lt;/p&gt;

&lt;p&gt;Furthermore, there is some cool &lt;a href="https://github.com/HappenApps/Quiver/wiki/Themes"&gt;theming support&lt;/a&gt;. After trying a few custom ones I settled on the official &lt;code&gt;spacegray&lt;/code&gt; theme. Doesn’t this interface look beautiful:&lt;/p&gt;

&lt;p&gt;&lt;a href="///static/56c13a10149e0b014a5586d91dcfbb62/c2d13/5w6C13A10149E0B014A5586D91DCFBB62.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kq9Bd5Ov--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://jibrankalia.com/static/56c13a10149e0b014a5586d91dcfbb62/fcda8/5w6C13A10149E0B014A5586D91DCFBB62.png" alt="Note Interface" title="Note Interface"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yup. I am a fan. Thank you for reading.&lt;/p&gt;

</description>
      <category>quiver</category>
    </item>
    <item>
      <title>TLA Plus</title>
      <dc:creator>Jibran Kalia</dc:creator>
      <pubDate>Tue, 25 Dec 2018 06:00:00 +0000</pubDate>
      <link>https://dev.to/jibrankalia/tla-plus-1089</link>
      <guid>https://dev.to/jibrankalia/tla-plus-1089</guid>
      <description>&lt;p&gt;I just read an incredible paper written by engineers at AWS: &lt;a href="https://lamport.azurewebsites.net/tla/formal-methods-amazon.pdf"&gt;Use of Formal Methods at Amazon Web Services&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I find complex distributed systems fascinating. Reading about the use of mathematics to verify the correctness of distributed systems was very eye-opening.&lt;/p&gt;

&lt;p&gt;Some highlights from the paper:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;So far we have used TLA+ on 10 large complex real-world systems. In every case, TLA+ has added significant value, either finding subtle bugs that we are sure we would not have found by other means, or giving us enough understanding and confidence to make aggressive performance optimizations without sacrificing correctness.&lt;/p&gt;

&lt;p&gt;This was a very subtle bug; the shortest error trace exhibiting the bug contained 35 high-level steps.&lt;/p&gt;

&lt;p&gt;That spec did not uncover any bugs but did uncover several important ambiguities in the documentation for the algorithm, which the spec helped to resolve&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I would also recommend checking out &lt;a href="http://lamport.azurewebsites.net/tla/tla.html"&gt;The TLA Home Page&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tlaplus</category>
    </item>
    <item>
      <title>SASS Ampersands</title>
      <dc:creator>Jibran Kalia</dc:creator>
      <pubDate>Tue, 18 Dec 2018 06:00:00 +0000</pubDate>
      <link>https://dev.to/jibrankalia/sass-ampersands-27kd</link>
      <guid>https://dev.to/jibrankalia/sass-ampersands-27kd</guid>
      <description>&lt;p&gt;One of the many reasons I love working at Scalefactor is that I get to work extensively both in the front-end and the back-end. That being said at the moment, the back-end is my stronger suit. That is why you might see a lot more front-end related posts here as I try to level up in that area. Going back to SASS. Here is something small I learned today. Borrowing the explanation below from &lt;a href="https://css-tricks.com/the-sass-ampersand/"&gt;CSS-Tricks&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here is a simple nesting example that works in SASS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.parent {
  .child {}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Which is compiled to in css:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.parent .child {}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;What about when we use an &lt;code&gt;&amp;amp;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.first-parent {
  &amp;amp;.second-parent {}
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Which is compiled to in css:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.first-parent.second-parent {}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The difference between the two is that in the second example we are selecting an element that has &lt;strong&gt;both&lt;/strong&gt; classes: &lt;code&gt;first-parent&lt;/code&gt; and &lt;code&gt;second parent&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I like to think of &lt;code&gt;&amp;amp;&lt;/code&gt; as copying the parent selector and pasting it next to the child selector. This gets interesting when used along with &lt;a href="http://getbem.com/introduction/"&gt;BEM CSS Methodology— Block Element Modifier&lt;/a&gt;. More on that later.&lt;/p&gt;

&lt;p&gt;There are a lot more uses of &lt;code&gt;&amp;amp;&lt;/code&gt; in sass. This article in &lt;a href="https://css-tricks.com/the-sass-ampersand/"&gt;CSS-Tricks&lt;/a&gt; does an amazing job explaining everything.&lt;/p&gt;

&lt;p&gt;Thank you for reading!&lt;/p&gt;

</description>
      <category>sassampersands</category>
    </item>
  </channel>
</rss>
