<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Arshan Khanifar on Medium]]></title>
        <description><![CDATA[Stories by Arshan Khanifar on Medium]]></description>
        <link>https://medium.com/@arshankhanifar?source=rss-3d098425d7a4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_mznrmFX3K6bmQWDa1OKDA.png</url>
            <title>Stories by Arshan Khanifar on Medium</title>
            <link>https://medium.com/@arshankhanifar?source=rss-3d098425d7a4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 02:07:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arshankhanifar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Code Monke #2: Getting to know the Command Line]]></title>
            <link>https://arshankhanifar.medium.com/code-monke-2-getting-to-know-the-command-line-4efcafb4c0d3?source=rss-3d098425d7a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/4efcafb4c0d3</guid>
            <category><![CDATA[vim]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[shell]]></category>
            <category><![CDATA[command-line]]></category>
            <dc:creator><![CDATA[Arshan Khanifar]]></dc:creator>
            <pubDate>Sun, 11 Apr 2021 23:22:49 GMT</pubDate>
            <atom:updated>2021-04-11T23:22:49.128Z</atom:updated>
            <content:encoded><![CDATA[<p>When I got my first internship as a Front-End Web Developer, I barely knew anything about the command line. I had just finished the JS and HTML courses on <a href="https://www.codecademy.com/">Codecademy</a> and the only place that I would edit my code other than the online editor they had on their website, was <a href="https://www.sublimetext.com/3">Sublime Text</a>. I was <strong>really scared</strong> of the command line. Every time a tutorial would say “now open up the terminal and …” I’d go “Oh $h!t here we go again, black magic starts right HERE…” The command line is that black screen that looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*iVG5fstQaBr_laHdW4jEYw.png" /><figcaption>My current terminal, very spooky 👻</figcaption></figure><p>It is where <a href="https://www.youtube.com/watch?v=UkoqIlppfhc">all hackers with hoodies</a> do all of their “hacking” in movies. There’s moving numbers, they’re typing on the keyboard fast, then BOOM the numbers lock onto some random string and they go “I’m IN!”.</p><p>Then the tutorial would continue, “Something something Dolla $ign PATH something something comma /usr/local/bin now restart your terminal” … it was a scary world.</p><p>Fast forward to about two years later, I got another internship at <a href="https://freebsdfoundation.org/">The FreeBSD Foundation</a>. I had kinda finessed my way into that job, and sold myself VERY WELL at the interview (beyond my capabilities). Little did I know that most of the computers that I was working with at the office didn’t have a window server 😅.</p><h3>What is a Window Server?</h3><p>Back in the old days, the only way to interact with a computer <em>was </em>through the command line! There was no mouse, no desktop with cute puppy background pictures, nothing! Just a blank screen that you could type commands into, and receive results back.</p><p>As computers became more mainstream, efforts were put into making them more usable! Manufacturers added things like the mouse, windows, clickable icons, etc. to it to make it more “intuitive” to use. They called it the <a href="https://en.wikipedia.org/wiki/WIMP_(computing)">WIMP (Window, Icon, Menu, Pointing Device)</a> paradigm. This is actually where the name “Windows” in Microsoft Windows comes from! It’s this Graphical User Interface (GUI) that allows you to work with a computer.</p><p>So for a computer to have a graphical user interface, it should have a <strong>Window Server</strong> installed. In Mac computers, you can actually see that it’s running in the background! Open up Activity Monitor and you’ll see it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*2-AqZUogKpjdMxl3Q71dEQ.png" /><figcaption>My Activity Monitor at the time of this writing</figcaption></figure><p>Here you can see the <strong>WindowServer </strong>on the first line at the very top, eating 36.7% of my CPU (that looks high? 🤔). It is <em>the thing</em> that allows my apps to appear as windows that I can move around, resize, open and close, etc.</p><h3>Back to My Internship at FreeBSD</h3><p>Most of the computers in the office did not have a Windows or a MacOS. They had an operating system that did not come by default with a Window Server. I had the option of installing a Window Server on them, but I didn’t, and here’s why: Over the past couple of internships, I’d seen some of my more experienced colleagues actually spend most of their time in the command line! They’d write code, run their code, move files around, open applications, do literally EVERYTHING in there!</p><p>As scared as I was from the command line, I really admired when I saw someone interact with it so effortlessly. I’d always wanted to try and get more comfortable in the command line, but I never put aside the time necessary to actually do it. This was an opportunity to learn about it and I thought to myself, what better way to do this other than forcing myself to interact with a computer only through its terminal 🤡?</p><h3>Getting Accustomed</h3><p>In the first week, it was like hell. I was SUPER slow in doing literally ANYTHING. Navigating through my filesystem, making files, deleting files, writing code, EVERYTHING was painful. I had to do a quick google search on my own personal laptop to perform any task that I wanted to do. The results, however, were glorious :’).</p><h3>I got DUMMY QUICC 💯💻💨💨</h3><p>By keeping my both hands on the keyboard, and never actually having to reach for the mouse I was getting much quicker at doing things. I’d found really cool auto-complete tools like <a href="https://github.com/junegunn/fzf">fzf</a> and <a href="https://github.com/ggreer/the_silver_searcher">the silver searcher</a> to quickly search through my files. I chose <a href="https://www.vim.org/">vim</a> as my text editor, and learned to navigate through my code files and edit them. I used <a href="https://github.com/tmux/tmux/wiki">tmux</a> to have multiple panes in my terminal (kinda like having multiple tabs on Chrome) so that I could edit my code in one pane, and quickly switch to the other pane and run it.</p><p>Doing everything was blazing fast! Opening any application was extremely quick and lightweight because there was no GUI to be opened with it. I was able to do everything much more quickly, plus I was looking cool while doing it! A true hacker 😎.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*wFPfasR5yjnbQFbJfscTQQ.png" /><figcaption>Me now!</figcaption></figure><p>This definitely was a turning point in my career as a software developer. I was no longer shying away from seemingly-technical tutorials, instead I’d embrace them. It truly felt like now I actually <em>understand</em> computers. It also started reflecting in both my academic and professional life. Co-workers were impressed by how easily I could do stuff so quickly, and make modifications and tweaks to my code as I was demoing it to them. Friends also would make comments about how fast I could try things when we were working on an algorithms or a distributed systems assignment together, and it motivated them to learn more about the command line and spend more time in it themselves.</p><h3>What I use now</h3><p>Nowadays, even on my own MacBook I spend a considerable amount of time in the command line. I no longer just use vim for all of my editing… I mean there are so many useful features IDE’s provide such as code refactoring, static analysis, debugging, etc. that it would be almost impractical to set up your command line tools and plugins to completely replace them. But I still make heavy use of the command line. I’m still using the same vim shortcuts for my code-editing, and my development experience is basically a <strong>hybrid of the two. </strong>Here is a non-exhaustive list of the things I use. Each of them deserves a blog post of its own:</p><ol><li><a href="https://www.vim.org/">vim</a>: it’s a command-line-based file editor</li><li><a href="https://github.com/tmux/tmux/wiki">tmux</a>: is a terminal multiplexer</li><li><a href="https://github.com/ggreer/the_silver_searcher">The Silver Searcher</a>: a really fast search tool for your files and folders</li><li><a href="https://iterm2.com/">iterm 2</a>: a better terminal for MacOS</li><li><a href="https://github.com/JetBrains/ideavim">ideaVim</a>: an amazing <strong>vim plugin </strong>that works amazingly on all JetBrains IDE’s</li><li><a href="https://en.wikipedia.org/wiki/Z_shell">zsh</a> and <a href="https://ohmyz.sh/">oh-my-zsh</a>: <strong>zsh</strong> is a unix shell like <strong>bash</strong>, but together with <strong>oh-my-zsh</strong> it offers amazing command-completion both in your desktop and in your git projects.</li></ol><h3>Last But Not Least</h3><p>Here’s a video of <a href="https://globalnews.ca/news/7748447/elon-musk-neuralink-monkey-pong-video-game/">a very smart Monke</a> that is playing pong with his brain and nothing else. My goal as a developer is to use as least physical actions as possible when I’m coding. I got rid of the mouse, the keyboard’s next 💯😤.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4efcafb4c0d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Code Monke #1: Measuring Latency in the Browser]]></title>
            <link>https://arshankhanifar.medium.com/code-monke-1-measuring-latency-in-the-browser-4658a1ac94de?source=rss-3d098425d7a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/4658a1ac94de</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[latency]]></category>
            <category><![CDATA[resource-timing]]></category>
            <category><![CDATA[chrome]]></category>
            <category><![CDATA[latency-time]]></category>
            <dc:creator><![CDATA[Arshan Khanifar]]></dc:creator>
            <pubDate>Sun, 14 Mar 2021 19:33:45 GMT</pubDate>
            <atom:updated>2021-03-14T19:35:05.042Z</atom:updated>
            <content:encoded><![CDATA[<p>DISCLAIMER: Please skip to <a href="#58c2">this part</a> for the actual technical stuff and not the memes.</p><p>Gooooooooood morning to all of you beautiful Code Monkes! 🥰🙈 I am hella caffeinated and randomly decided that I’m gonna start writing blog posts now! I’d like to call these series: Code Monke.</p><h3>Intro</h3><p>Code Monkey: Is an offensive term to describe someone who just knows how to code and doesn’t do anything else in life.</p><p>Code Monke: Is what every Software Engineer, and I daresay a<em>ny Engineer, Inventor, Philantropist, CEO, even Elon Musk, </em>wants to become in life. It’s the ultimate destination, the pinnacle of SE clout, internships in Menlo Park, knowledge, actual love, and respect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*Q2KBEaVSpyV54lKmEuzAOA.png" /><figcaption>We’re all in this beautiful journey to becoming monke</figcaption></figure><p>This series will serve as a documentation of MY journey to becoming a <strong>Code Monke</strong>. It is the perfection I know I’ll never reach, but will try my best nevertheless. So every week I’ll put all the interesting things I found at work, projects, etc. etc. here. I welcome you to join me in this beautiful journey. Apes together strong 🦍💯💦</p><h3>Background</h3><p>I’m currently working on developing <a href="https://www.waveform.com/tools/bufferbloat">an online tool that measures Bufferbloat</a> in your home router. Gamer boys/girls/persons PAY ATTENTION: Bufferbloat is a phenomenon that happens in your home router that can lead to unnecessarily high latencies for your realtime applications: Zoom Calls, Online Gaming, etc. You 👏 don’t 🙅 want 👏 a 👏 laggy ⏰ internet 🌐 when 👏 you’re 👏 CLAPPIN 👏👏👏 others 👏 in 🎮 COD 🔫 😤. So go ahead and try our tool! It’ll test your router for you and tell you if it has any problems.</p><p>…anyways, to make this tool I had to accurately be able to measure the latency to some location.</p><h3>Measuring latency in the browser</h3><p>Usually when you wanna check the latency in your network you’d fire up your terminal and do a ping:</p><pre>ping google.com<br>PING google.com (172.217.1.174): 56 data bytes<br>64 bytes from 172.217.1.174: icmp_seq=0 ttl=114 time=2.993 ms<br>64 bytes from 172.217.1.174: icmp_seq=1 ttl=114 time=3.289 ms<br>64 bytes from 172.217.1.174: icmp_seq=2 ttl=114 time=4.067 ms</pre><p>But browsers don’t really have support for <a href="https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol">ICMP</a> requests (it’s what ping uses). So what’s the next best thing that we can do?</p><h3>The Naive Way: Taking the time difference</h3><p>You could always make a request to a really small file somewhere, and measure the time difference before making the request and after getting the response. Something like this:</p><pre>const url = &quot;https://api.github.com/users/ArshanKhanifar&quot;;<br>const before = Date.now();<br>const r = await fetch(url);<br>await r.text();<br>const after = Date.now();<br>console.log(&quot;Time took:&quot;, after - before);</pre><p>This works, but it’s not very accurate, because it includes:</p><ol><li>The time taken for all the TCP handshakes and DNS lookups.</li><li>Processing time at the server (it’s not zero).</li><li>Download time.</li></ol><p>…and many other random error sources. What we’re interested in is the RTT (round-trip-time).</p><h3>The Better Way: Using the ResourceTiming API</h3><p>Open the inspector for some webpage and take a look at the network tab, and click on one of the earlier requests. Now select the <strong>Timing</strong> tab. You’ll see something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*16X526bvUh-wQk5RP7r0Hw.png" /><figcaption>Timing example for a request.</figcaption></figure><p>This is pretty cool! We can exactly see what the timing info for that specific request is! What we’re interested here is the green section: TTFB (Time to first Byte)</p><p>TTFB measures the amount of time your browser waits for until the first byte of your response is received from the server. It’s a much better representation of the RTT we’re trying to measure. Now how can we measure this our request? The <a href="https://developer.mozilla.org/en-US/docs/Web/API/Resource_Timing_API/Using_the_Resource_Timing_API">ResourceTimingAPI</a> is made just for that.</p><p>The <a href="https://developer.mozilla.org/en-US/docs/Web/API/Resource_Timing_API/Using_the_Resource_Timing_API">ResourceTimingAPI</a> gives you a much more granular control over the timing of your requests. It actually includes markers for measuring how long each stage of your request takes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*6Dml8IHjNJydkXFQ4F4U9A.png" /><figcaption>Timings for each stage of a request.</figcaption></figure><p>Now TTFB here is basically the difference between responseStart and requestStart . We can use this API like this:</p><pre>const r = await fetch(url);<br>await r.text();<br>const perf = performance.getEntriesByName(url)[0];<br>const ttfb = perf.responseStart - perf.requestStart;<br>console.log(&quot;TTFB&quot;, ttfb);</pre><p>YAY! Problem SOLVED!</p><p><a href="https://www.youtube.com/watch?v=egYTYpleY0U">https://www.youtube.com/watch?v=egYTYpleY0U</a></p><p>But still, we still haven’t gotten rid of one thing: 👏 Server 👏 Processing 👏Time 👏</p><h3>The Best Possible Way: 🦄</h3><p>To get rid of the server processing time, unfortunately unless the server itself decides to let you know how much processing a request took, there isn’t any other way (that I know of). I don’t think a lot of servers do this, because the developers have to care enough to include that information in your response header. Nevertheless, <a href="https://speed.cloudflare.com/">CloudFlare’s Speed Test </a>does include that info.</p><p>Looking at the developer tab of their Speed Test, I can tell that they measure latencies by making a 0KB download request to their backend.</p><pre>https://speed.cloudflare.com/__down?bytes=0</pre><p>Here is what Chrome’s inspector tab shows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*J7f3TZVuvyqzBciG-nLbOA.png" /></figure><p>See that little beige bar at the bottom? That’s their server timing info. They measure ttfb and deduct the cfRequestDuration to get a latency measurement that’s as accurate as possible.</p><p>Although, this information is pretty much never available for <strong>any server </strong>of your choice, and the best you can do is TTFB.</p><p>Thanks for reading this! Feel free to give me a clap 👏 if you enjoyed it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4658a1ac94de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Arshan learns how to use Medium]]></title>
            <link>https://arshankhanifar.medium.com/arshan-learns-how-to-use-medium-d2d72920c303?source=rss-3d098425d7a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2d72920c303</guid>
            <category><![CDATA[design]]></category>
            <dc:creator><![CDATA[Arshan Khanifar]]></dc:creator>
            <pubDate>Fri, 27 Apr 2018 18:51:47 GMT</pubDate>
            <atom:updated>2018-04-27T18:53:09.931Z</atom:updated>
            <content:encoded><![CDATA[<p>There’s not much to tell yet lol. This story is just me playing around with medium’s features to learn how to write here.</p><p>…woo I can put pictures! options are: left aligned, centre, centre (bigger) full page, how cute…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d79NlN7Ef6ny8ZGxFqO0eA.jpeg" /><figcaption>you can put captions too!</figcaption></figure><p>you can write next to the pictures!</p><h3>Game Of Thrones on Twitter</h3><p>Bend the knee to House Targaryen, @ElonMusk. #Dracarys https://t.co/PsFu1NsgBJ</p><p>Wow support to embed tweets!? cool!</p><p>fancy dot dot dot’s!</p><p>put random pictures from unsplash!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SNH7DuRIShfwmICl." /><figcaption>Photo by <a href="https://unsplash.com/@armedshutter?utm_source=medium&amp;utm_medium=referral">Ayo Ogunseinde</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fb-m6LlZW-vs%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Db-m6LlZW-vs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fb-m6LlZW-vs%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/9e78401dad499f9d1e9ba06209ceeb18/href">https://medium.com/media/9e78401dad499f9d1e9ba06209ceeb18/href</a></iframe><p>Embedded videos!?!?! WHAT?</p><p>OMG I thought I learned everything here until I saw some popup that allows me to <em>italicize </em>(also works with cmd+i), <strong>bold </strong>(cmd + b), make a text a</p><h3>Title,</h3><p>make it a smaller</p><h4>title,</h4><p>and</p><blockquote>quote shit!</blockquote><p>…hmm, what else is there? oh! I can write notes for myself (you can’t see them, but they’re here!)</p><p>There’s bare notes up in this b****.</p><p>Alright that’s all folks, I’m a <a href="https://www.medium.com/">medium</a> writer now! hehe.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2d72920c303" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>