{"componentChunkName":"component---src-templates-blog-list-template-js","path":"/engineering/26","result":{"data":{"allMarkdownRemark":{"edges":[{"node":{"excerpt":"The acronym for Vim is Vi IMproved. Written by Bram Moolenaar, it is a free and open-source text editor. It was first released for UNIX…","fields":{"slug":"/engineering/vim-getting-started/"},"html":"<p>The acronym for Vim is Vi IMproved. Written by <a href=\"https://en.wikipedia.org/wiki/Bram_Moolenaar\">Bram Moolenaar</a>, it is a free and open-source text editor. It was first released for UNIX variants in 1991, and its primary purpose was to develop the Vi editor, which was released back in 1976.</p>\n<p>Vim is Vi's newest and most popular reincarnation that supports both text and graphical interfaces and is supported on any known platform.</p>\n<p>The issue with learning Vim is not that it's challenging to do. It's that you have to continue to do it. This guide aims to break the loop so that for the last time, you can learn it.</p>\n<p>The purpose of this tutorial is to take you through every step of progress from understanding the philosophy of Vim. In short, in a way that sticks with you for a lifetime, we're going to master Vim.</p>\n<p>Let's start off!</p>\n<h2 id=\"what-is-vim\" style=\"position:relative;\"><a href=\"#what-is-vim\" aria-label=\"what is vim permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is Vim?</h2>\n<p>Vim is a text editor for Unix that comes with Linux, BSD, and macOS. It is known to be fast and powerful, partly because it is a small program that can run in a terminal (although it has a graphical interface). It is mainly because it can be managed entirely without menus or a mouse with a keyboard.</p>\n<p>For the following five reasons, I feel people should use Vim:</p>\n<ol>\n<li>It's omnipresent. You don't have to think about learning about several boxes with a new editor.</li>\n<li>It is highly scalable. You can use it only to edit configuration files or become your entire forum for writing.</li>\n<li>It has a shallow memory footprint.</li>\n<li>It's command-centered. With a few commands, you can perform complex text-related tasks.</li>\n<li>It is highly configurable and uses simple text files to store its settings.</li>\n</ol>\n<h2 id=\"why-use-vim\" style=\"position:relative;\"><a href=\"#why-use-vim\" aria-label=\"why use vim permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Why Use Vim?</h2>\n<p>In all POSIX systems, Vim is the default fallback editor. Vim is sure to be open, whether you have just installed the operating system, or you have booted into a minimal system repair environment, or you are unable to access any other editor. While you can switch out other tiny editors on your systems, such as GNU Nano or Jove, it's Vim that's all but guaranteed to be on every other system in the world.</p>\n<p>In short, I think competence with Vim should be considered the way you view competence with your native language, or simple maths, etc. In technology, so much begins with understanding your editor.</p>\n<p>Also, It is <strong>extremely customizable</strong> and you can adapt it to your way of coding and your way of doing things.\nTo give you a taste of vim , below are a few commands frequently used to code at lightning speed:</p>\n<ul>\n<li>hjkl : move the cursor around to left, down, up, and right respectively.</li>\n<li>7j : move 7 lines down.</li>\n<li>w : move a word forward</li>\n<li>ctrl + f : move down a page</li>\n<li>ctrl + b : move up a page</li>\n<li>gg : move to the top of the document</li>\n<li>G : move to the bottomost of the document</li>\n<li>dw : delete a word</li>\n<li>d6w : delete 6 words</li>\n<li>dt> : delete till  <code>></code></li>\n<li>di] : delete everything inside <code>[ ]</code></li>\n<li>dd : delete whole line</li>\n<li>4dd : delete 4 lines</li>\n<li>yy : yank a line ( yank is copy )</li>\n<li>cc : change a line ( change is delete and go in insert mode )</li>\n<li>cap : change a paragraph</li>\n<li><code>.</code> : repeat last command</li>\n<li>f' : find first occurance of <code>'</code></li>\n<li>f'ci'hello : _find the next  <code>'</code> then change everything inside <code>'</code> for <code>hello</code></li>\n</ul>\n<p>The list goes on and on... </p>\n<p>Basically we have standard keybindings like d for delete, c for change, f for find etc. and we can pair them with numbers to repeat that action n number of times. Moreover doubling a command like so <code>yy</code> makes the command operate on the entire line.</p>\n<p>So to sum up,</p>\n<blockquote>\n<p>Vim is for <strong>programmers who want to raise their game</strong>. In the hands of an expert, It shreds text at the speed of thought.</p>\n</blockquote>\n<h4 id=\"how-to-use-vim\" style=\"position:relative;\"><a href=\"#how-to-use-vim\" aria-label=\"how to use vim permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How to use Vim</h4>\n<p> Well, there is a learning curve, but it's worth it. Although this steep curve is exaggerated in the online world and the <strong>quitting vim joke</strong> is getting very old (It's:q btw).</p>\n<p> Install Vim <code>sudo apt-get vim or pacman -S vim</code> for Linux user and type <code>vim &#x3C;filename></code> in your terminal. Press <code>i</code> to go to insert mode. Type some gibberish. Press <code>:wq</code> to save and quit . <code>:q!</code> to quit without saving.</p>\n<p> First of all, don't get disheartened when you see VIM for the first time, it's known to make a <strong>horrible first impression.</strong> We'll learn to customize it later in the blog.</p>\n<p> <span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 585px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 49.05982905982906%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAIAAAA7N+mxAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABYElEQVQoz1VRXW+CQBAEBEStoig1TeOzVflGvDvuABGEWJu+2P//W7qAgiaTzWSZnZ09uLFHuW3A7Q4vgE7T3AQdf4CvIQAXdui520xKNpHtUDCx4jIA8BdBC9HAd2/AZl/XQLTwW5AMvGgcJCpOwetF0AbpGYg30NCPhn4MFfbMSLag51X2s8quq9N1GRVTfBrt44HHmio7tGfibrjvUpichznolnE5p7lOc42cllGpswK8APAVjCBLN9zGhp2CiUZgQVItzGbprxp9Dz3Wd6hWZ5kcEsUDDa5e8X5z47ENdHaG5SotteI2Yhdpf5TcSLCZaIcqSmcEksNpkWzTpwd7DH8eL5MgeWfFR3nTiz+VZGp8HWc32U8WIVwByfM5ySBF92CiSTgDAXiLcGBk4uofmkiwCO8wvtqDqqaJqw4ANLW+gvLlyjWktSu1tSFrByA/OJCpgwdbH7iy9SYW+gfI+Fjjv9gzagAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"BadVim\"\n        title=\"BadVim\"\n        src=\"/static/c404bd0ddd9d5a787c6e368baf271819/78a22/BadVim.png\"\n        srcset=\"/static/c404bd0ddd9d5a787c6e368baf271819/78a22/BadVim.png 585w\"\n        sizes=\"(max-width: 585px) 100vw, 585px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p> To get started, get your hands dirty on <strong>vimtutor</strong> . It's a 20-30 minute vim tutorial which teaches you all the basics. Just type <code>vimtutor</code> in your terminal (in a machine where you have vim installed) to open it.</p>\n<p><strong>Try  <a href=\"https://vim-adventures.com/\">Vim Adventures</a></strong>. An interactive game that teaches you vim skills in a step by step manner and lets you unlock new abilities after you've proved your worth with the previous ones.</p>\n<p> Just get started with it . <strong>Learn as you go</strong> . You can always refer to the <a href=\"https://vim.rtorr.com/\">Vim CheatSheet</a> to get better. Practice makes a man perfect. Watch screencasts if that's helpful (was helpful to me).</p>\n<h2 id=\"how-do-i-configure-my-vim-\" style=\"position:relative;\"><a href=\"#how-do-i-configure-my-vim-\" aria-label=\"how do i configure my vim  permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How do I configure my Vim ?</h2>\n<p>The best way to configure your Vim is through <code>.vimrc</code> file, which is hidden inside your home directory. Open a terminal and type <code>vim ~/.vimrc</code> to open your vimrc file using vim. Cool huh? Using vim to configure vim ..no? Nevermind!\nHere you can define your keybindings, set themes, install plugins etc.</p>\n<p>Here is an example of a custom keybinding\n<code>map &#x3C;C-n> :NERDTreeToggle&#x3C;CR></code>\nYou can check out this <a href=\"https://hea-www.harvard.edu/~fine/Tech/vi.html\">article</a> on keybindings and how to use them.</p>\n<p>The easiest way to download and manage plugins for vim is by using a plugin manager. There are quite a few <a href=\"https://github.com/tpope/vim-pathogen\">vim-pathogen</a> , <a href=\"https://github.com/VundleVim/Vundle.vim\">Vundle.vim</a> , <a href=\"https://github.com/junegunn/vim-plug\">Vim-plug</a> etc.\nVim-plug being my favourite. Installations and usage for each plugin manager can be found in their respective repositories.</p>\n<p>I personally like to call all my plugins in a separate file and link that file to my vimrc. Paste this line in your vimrc at the top if you want to do the same <code>source ~/.vim/plugin/plugins.vim</code>\nIn your plugins.vim file you can install different plugins like this:-</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">call plug#begin(&#39;~/.vim/plugged&#39;)</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">Plug &#39;scrooloose/nerdtree&#39;</span>\n<span class=\"grvsc-line\">Plug &#39;moll/vim-node&#39;</span>\n<span class=\"grvsc-line\">Plug &#39;yegappan/mru&#39;</span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\">call plug#end()</span></code></pre>\n<p>The first and last lines are for vim-plug to know what plugins are to be installed. The lines beginning with <code>Plug</code> is to install that particular plugin.</p>\n<p>Now just reload .vimrc (or quit vim and re-enter) and <code>:PlugInstall</code> to install plugins.</p>\n<h2 id=\"what-are-some-good-plugins-for-vim\" style=\"position:relative;\"><a href=\"#what-are-some-good-plugins-for-vim\" aria-label=\"what are some good plugins for vim permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What are some good plugins for Vim?</h2>\n<p>Glad you asked because Vim is no fun without plugins made by the awesome open source community.\nHere are some good plugins you should definitely install. Just search these on GitHub in case you wanna know more about them or their usage.</p>\n<ul>\n<li>scrooloose/nerdtree</li>\n<li>alvan/vim-closetag</li>\n<li>vim-scripts/vim-auto-save</li>\n<li>airblade/vim-gitgutter</li>\n<li>ervandew/supertab</li>\n<li>vim-airline/vim-airline</li>\n<li>SirVer/ultisnips</li>\n<li>honza/vim-snippets</li>\n<li>dense-analysis/ale</li>\n<li>tpope/vim-repeat</li>\n<li>ap/vim-css-color</li>\n<li>jiangmiao/auto-pairs</li>\n<li>tmhedberg/matchit</li>\n<li>kana/vim-textobj-user</li>\n<li>vim-scripts/tComment</li>\n<li>Valloric/YouCompleteMe', { 'do': './install.py --tern-completer' }</li>\n<li>prettier/vim-prettier', { 'do': 'yarn install' }</li>\n<li>jeffkreeftmeijer/vim-numbertoggle</li>\n<li>elzr/vim-json</li>\n<li>tpope/vim-markdown</li>\n<li>pangloss/vim-javascript</li>\n<li>mxw/vim-jsx</li>\n<li>jparise/vim-graphql</li>\n<li>leafgarland/typescript-vim</li>\n<li>vim-syntastic/syntastic</li>\n<li>ntpeters/vim-better-whitespace</li>\n</ul>\n<p>Pheww!!..\nSo you see there's a plugin for anything and everything. These plugins are more than enough to make vim a full-blown IDE.</p>\n<h3 id=\"summing-up\" style=\"position:relative;\"><a href=\"#summing-up\" aria-label=\"summing up permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Summing up!!</h3>\n<p>VIM makes you write code at the speed of thoughts. Just get started, and the rest will follow. Steal your friend's vimrc or find one on the internet (there are tons of them) if you don't want to make one of your own.</p>\n<p>If you want to slowly blend in into the world of vim then use some vim plugin for your text editor. All popular text editors have a vim plugin ( <a href=\"https://marketplace.visualstudio.com/items?itemName=vscodevim.vim\">Here's one for VsCode </a>)\nHere you go, best of both worlds! When you're comfortable enough, go for that complete switch.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 585px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 50.94017094017094%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAIAAAA7N+mxAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABv0lEQVQoz2WQu47UMBSG8xYzudnxZBInvsVOnHgS5zJCww4LSEgUjESBtA0SL4G0PRU9FdRUSDS8DT0tJXh2KBb4dOTiWP9/zn+8RutxWqZ5sXacl73gvJRt/+I1o0QpxRh1laZpAkG+iTcIIoSSJHEvAMAzxhweXl9dPdn1zuFQYvbuw6evP37xp68qTqXuuJBSKlJkCod4m2RZnm42zg5C6LmB3RnDGCeCoS16fnq5f/M22uSpsmn7ABEJQQwTFEYgjl394Tz5eHw0jlM/WEoYUYxqlm9zBKIC5xhjUpYAQhD4URjC//Capun7YZ5mwSomBeaF67pIl2+nRDDO+wOrOxhH/4o551q3dhybWgstS0XiKAJ3wCRZrVbDvP/2/efN+8/rtX+2u4cTi53ZzdPixLXRRUVcnotxguDa97uuuf34hT67iYK1swP39B4Xwpidi12rRnW1mxz4QXhh5VaAWZJhTGlWogRFURgH/l/itjWDtUrWvJYus5LSdKbr2upxbiY9nCp73dpTsxyHbliQ3oMovOzvCVG5g1lrGeFMiaIqOePyDt4TLGTW0VzgTCJMMlxSWDB3+bIsKaW/AXI5a9Zytj4fAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"vscodevim\"\n        title=\"vscodevim\"\n        src=\"/static/a0451de7e507bc1cc62ee189d3ff81a6/78a22/vscodevim.png\"\n        srcset=\"/static/a0451de7e507bc1cc62ee189d3ff81a6/78a22/vscodevim.png 585w\"\n        sizes=\"(max-width: 585px) 100vw, 585px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Here's how my vim setup looks.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 66.61538461538463%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAIAAAAmMtkJAAAACXBIWXMAAA7EAAAOxAGVKw4bAAACcklEQVQoz03R527qMBgG4Aha0pDJyLITZxOy9yBA2KK0PTq9/6s5of1zpEeWLL2v7M/GHKZTJrE09sBrII7WM8weLF9XyjTVqFwhYvkt4H/hgUCE/KsnTDwB912+xUJ0tPgcUv5/AkCF+rx2+c5ZNCZboEWF5qVKxzqXaVwGyUgmgkQ7YLV/i4xeIkIwjQD5KwZUotKlzjU6WwMqU+hcoQuVKUU8Wo68xcjjX7wQ7oeTT/qsWY5jYZKJeC7ihYSXMln46jWz31PrPbUfProG6ObKJ43bCJN0IE7iEB4wSDWAaiC9QdxeWxwGaN4jvg+0j1S/h+o11u+J9RmbD0+5ONJRZbshD8gmUs/YEFW4ncJtdeFsiFddPKnzPeJ3K/VugZMp9ZZ6cc2Hb/1x0YfGH+Gz3CpMF6PbUN4jpkVUrXEdmm9VtgVkOUxogE5TayRUJtxY6OAYF1M4ILaFZAXJWqHqWL1gw0YjK2P6XBFVaQOyNLlqzffrWecvdxZT6WRh0tWP0mSG998MsQgeMZmo0LQ2qcakW5NprafGYptUvbX2o7EetX1PleN63ppkYRC5TlY61SKicpcdpjONzW5crltxncNuhqZOlhpV+PKxMG8pOufaJYPnHJxCePLB0XxerUFEiaY55s6aFdvYVK1PC4hn8iQRxrGEx4hqlLdSHIdLzBdHgfRDHoXgJQSTRH6JeGyNrZcHe7Y32C2iu+HDAJnL0wSxVaJ9psZHhK6JcYjUXahsI2Ubwn41722mX7EHh9lhufMdaV8B+jT5q7E4abMScanDD7mvNbj78OqB1pVqRyhcsfTBLgDvGfibw+9U+voHI5Bsu60nJMIAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Vim\"\n        title=\"Vim\"\n        src=\"/static/dde8da85e3217326808f870a6728802d/e5715/Vim.png\"\n        srcset=\"/static/dde8da85e3217326808f870a6728802d/a6d36/Vim.png 650w,\n/static/dde8da85e3217326808f870a6728802d/e5715/Vim.png 768w,\n/static/dde8da85e3217326808f870a6728802d/c1b63/Vim.png 1200w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Now go give it a try. I wish you luck!!</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n</style>","frontmatter":{"date":"October 08, 2020","updated_date":null,"description":"Vim is Vi's newest and most common reincarnation that is supported on every known platform, check out the article to learn about what is ViM, and why to use it.","title":"Vim: What is it and Why to use it?","tags":["Vim","Text Editor"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/dde8da85e3217326808f870a6728802d/ee604/Vim.png","srcSet":"/static/dde8da85e3217326808f870a6728802d/69585/Vim.png 200w,\n/static/dde8da85e3217326808f870a6728802d/497c6/Vim.png 400w,\n/static/dde8da85e3217326808f870a6728802d/ee604/Vim.png 800w,\n/static/dde8da85e3217326808f870a6728802d/f3583/Vim.png 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Shubhankar Khare","github":"iamshubhankarkhare","avatar":null}}}},{"node":{"excerpt":"Generally, MIM attacks are breaking to believe the traditional encryption technologies and targeting the intermediate nodes between the…","fields":{"slug":"/engineering/learn-about-vdn-for-cybersecurity/"},"html":"<p>Generally, MIM attacks are breaking to believe the traditional encryption technologies and targeting the intermediate nodes between the sender and receiver.</p>\n<h2 id=\"what-is-a-mim-attack\" style=\"position:relative;\"><a href=\"#what-is-a-mim-attack\" aria-label=\"what is a mim attack permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is a MIM attack?</h2>\n<p>MIM stands for man-in-the-middle. In the World of Cybersecurity, a man-in-the-middle attack (MIM) is an attack where the attacker breaks into the middle of the network pathway silently such that the sender and receiver are not able to intercept and they believe they are directly communicating with each other. One such example of a MIM attack is active eavesdropping. In this example, an attacker can be sitting with a piece of software somewhere in the network path and capturing all the relevant network traffic for later analysis. The attacker can intercept all relevant messages passing between the two victims and by smartly monitor and alter old ones or inject new ones. It can become complicated and arise problems for the organization.</p>\n<h2 id=\"does-the-question-arise-how-about-using-ssl-and-virtual-private-networks\" style=\"position:relative;\"><a href=\"#does-the-question-arise-how-about-using-ssl-and-virtual-private-networks\" aria-label=\"does the question arise how about using ssl and virtual private networks permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Does the question arise how about using SSL and Virtual Private Networks?</h2>\n<p>SSL and Virtual Private Networks do not always protect messages as they travel across intermediary pathways. So, that where virtual dispersive networking comes into the picture.</p>\n<p>VDN follows the approaches or methods of traditional military radio spread spectrum security. Radios rotate through the frequencies randomly, and communications are divided or split into multiple pieces (or streams). So now, only one receiving radios are programmed to reassemble these pieces into their original form.\nVDN divides the original message into some multiple parts, and it will encrypt each component separately and routes them over many servers, computers, and even mobile phones. The data also move out dynamically to optimum paths — both randomizing the paths the messages take while simultaneously taking into the server congestion or other network issues.\nWhen it comes to the role of Hackers, they are left scrambling to find out data parts as they go through like data centers, Cloud, Internet, and so on. </p>\n<h2 id=\"why-virtual-dispersive-networking\" style=\"position:relative;\"><a href=\"#why-virtual-dispersive-networking\" aria-label=\"why virtual dispersive networking permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Why Virtual Dispersive Networking?</h2>\n<ol>\n<li>Unparalleled Security: Dispersing the data over multiple different paths, eliminates the Man-in-the-Middle threat. Hackers can only obtain a small chunk of the original data on any given pathway, rendering any data obtained meaningless and nearly impossible to decrypt.</li>\n<li>Network Resilience: Suppose a connection is lost on any of the several pathways due to network failure,\ndata packets are then rerouted to an already existing path, or an additional path is established which leads us resulting in negligible network downtime.</li>\n<li>Speed / Performance: Since the data-flow is from multiple independent paths using unique methods, it increases available bandwidth and optimizes data flow on individual pathways. Therefore, speed and performance are improved.</li>\n</ol>\n<h2 id=\"conclusion\" style=\"position:relative;\"><a href=\"#conclusion\" aria-label=\"conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Conclusion</h2>\n<p>Today, Dispersive Technologies' business is largely government-centric, with initial forays into commercial industries with high-value targets like banks and utilities. There are many opportunities for Dispersive technology in the cloud computing world. The cloud can host the redirects at the center of their methodology without much of a stretch. However, cloud conditions can use Dispersive to set up secure communications between clouds or between on-premise information. These hybrid cloud situations regularly rely on VPNs, which will, in general, be flaky and moderate. Dispersive Technologies have become replacement of VPNs, thereby improving the security, performance, and manageability of hybrid clouds as well as virtual private clouds. </p>\n<p>As with any industry, change can be frightening (especially when sensitive data is part of the equation), but if the organization is aware of the new developments, they can begin implementing some of these security technologies into their existing IT infrastructure and enjoy some peace of mind without worrying about future threats.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"October 07, 2020","updated_date":null,"description":"Learn About VDN for CyberSecurity","title":"Virtual Dispersive Networking","tags":["VDN","Cyber Security"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/6d5defa57e9455bd106e0dc993e5dfc3/14b42/MIM.jpg","srcSet":"/static/6d5defa57e9455bd106e0dc993e5dfc3/f836f/MIM.jpg 200w,\n/static/6d5defa57e9455bd106e0dc993e5dfc3/2244e/MIM.jpg 400w,\n/static/6d5defa57e9455bd106e0dc993e5dfc3/14b42/MIM.jpg 800w,\n/static/6d5defa57e9455bd106e0dc993e5dfc3/9842e/MIM.jpg 900w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Binay Agarwal","github":"agarwalBinay18","avatar":null}}}},{"node":{"excerpt":"React context API, In this article you will explore what is Context API, what is react context API and how to use it in your React project…","fields":{"slug":"/engineering/react-context-api/"},"html":"<p>React context API, In this article you will explore what is Context API, what is react context API and how to use it in your React project. The Context API is a React structure that enables you to exchange unique details and assists in solving prop-drilling from all levels of your application.</p>\n<h2 id=\"what-is-context-api\" style=\"position:relative;\"><a href=\"#what-is-context-api\" aria-label=\"what is context api permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is Context API?</h2>\n<p>The React Context API is a way for a React app to effectively produce global variables that can be passed around. This is the alternative to \"prop drilling\" or moving props from grandparent to child to parent, and so on. Context is also touted as an easier, lighter approach to state management using Redux.</p>\n<p>Talking about the Context APIs, they’re a (kind of) new feature added in version 16.3 of React that allows one to share state across the entire app (or part of it) lightly and with ease.</p>\n<h2 id=\"react-context-api-how-it-works\" style=\"position:relative;\"><a href=\"#react-context-api-how-it-works\" aria-label=\"react context api how it works permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>React context API: How it works?</h2>\n<p>React.createContext() is all you need. It returns a consumer and a provider. <strong>Provider</strong> is a component that as it's names suggests provides the state to its children. It will hold the \"store\" and be the parent of all the components that might need that store. Apart from the react context <strong>Provider</strong>, <strong>Consumer</strong> as it so happens is a component that consumes and uses the state. More information can be found on <a href=\"https://reactjs.org/docs/context.html\">React's documentation page</a></p>\n<h2 id=\"context-api-will-replace-redux\" style=\"position:relative;\"><a href=\"#context-api-will-replace-redux\" aria-label=\"context api will replace redux permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Context API will replace redux?</h2>\n<p>No. Well, not entirely.  </p>\n<p>Redux is great and came perfectly to answer the need for state management. Actually, it answered this need so well that it came to be known that you can't be a \"true\" React developer if you don't know your way around Redux.\nHowever, Redux has its disadvantages, and that's why it's important to know what Context API gives us that Redux doesn't:</p>\n<ul>\n<li>\n<p>Simplicity - When using redux people tend to manage almost all of their state in redux and it causes 2 problems:  </p>\n<ol>\n<li>Overhead - Why should I create/update 3 files just to add one tiny feature? </li>\n<li>One of the significant advantages of React's one-way data binding is that it's easy to understand - A component passes state to its children. Using Redux takes it away from us.</li>\n</ol>\n</li>\n<li>Using Context API we can define several unrelated contexts (stores) and use each in its proper place in the app.  </li>\n</ul>\n<h3 id=\"important-note\" style=\"position:relative;\"><a href=\"#important-note\" aria-label=\"important note permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Important Note</h3>\n<p>Redux is just a concept. If you are comfortable with using reducers and actions and don't find hindering than you may also create reducers and actions that wrap Context API as the store as Redux's author <strong>Dan Abramov</strong> explained in <a href=\"https://medium.com/@dan_abramov/you-might-not-need-redux-be46360cf367\">his medium article about whether Redux is always required</a></p>\n<h2 id=\"how-to-use-context-api\" style=\"position:relative;\"><a href=\"#how-to-use-context-api\" aria-label=\"how to use context api permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How to use Context API?</h2>\n<p>You might think to yourself: \"Well, I'm convinced. How do I implement Context API in react for my app?\" First, make sure you need it. Sometimes people use shared state across nested components instead of just passing it as props. And if you do need it you should follow these very few steps:</p>\n<ol>\n<li>Create a folder under your app root named contexts (not required. just a convention)</li>\n<li>Create a file named &#x3C;your context name>Context.js, e.g. userContext.js</li>\n<li>import and create a context like so:</li>\n</ol>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">import</span><span class=\"mtk1\"> </span><span class=\"mtk12\">React</span><span class=\"mtk1\">, { </span><span class=\"mtk12\">createContext</span><span class=\"mtk1\"> } </span><span class=\"mtk15\">from</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;react&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk12\">UserContext</span><span class=\"mtk1\"> = </span><span class=\"mtk11\">createContext</span><span class=\"mtk1\">();</span></span></code></pre>\n<ol start=\"4\">\n<li>Create a component that will wrap the provider named <your context name>Provider e.g. UserProvider<br>\nExample using React Hooks:</li>\n</ol>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk11\">UserProvider</span><span class=\"mtk1\"> = ({ </span><span class=\"mtk12\">children</span><span class=\"mtk1\"> }) </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> [</span><span class=\"mtk12\">name</span><span class=\"mtk1\">, </span><span class=\"mtk12\">setName</span><span class=\"mtk1\">] = </span><span class=\"mtk11\">useState</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;John Doe&quot;</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> [</span><span class=\"mtk12\">age</span><span class=\"mtk1\">, </span><span class=\"mtk12\">setAge</span><span class=\"mtk1\">] = </span><span class=\"mtk11\">useState</span><span class=\"mtk1\">(</span><span class=\"mtk7\">1</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk11\">happyBirthday</span><span class=\"mtk1\"> = () </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk11\">setAge</span><span class=\"mtk1\">(</span><span class=\"mtk12\">age</span><span class=\"mtk1\"> + </span><span class=\"mtk7\">1</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> (</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">UserContext.Provider</span><span class=\"mtk1\"> </span><span class=\"mtk12\">value</span><span class=\"mtk1\">=</span><span class=\"mtk4\">{</span><span class=\"mtk1\">{ </span><span class=\"mtk12\">name</span><span class=\"mtk1\">, </span><span class=\"mtk12\">age</span><span class=\"mtk1\">, </span><span class=\"mtk12\">happyBirthday</span><span class=\"mtk1\"> }</span><span class=\"mtk4\">}</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk4\">{</span><span class=\"mtk12\">children</span><span class=\"mtk4\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">UserContext.Provider</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  );</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">};</span></span></code></pre>\n<ol start=\"5\">\n<li>Create a higher order component to consume the context named: with<your context name> e.g. withUser<br>\nExample using React Hooks:</li>\n</ol>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk11\">withUser</span><span class=\"mtk1\"> = (</span><span class=\"mtk12\">Child</span><span class=\"mtk1\">) </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">props</span><span class=\"mtk1\">) </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> (</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">UserContext.Consumer</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">{</span><span class=\"mtk1\">(</span><span class=\"mtk12\">context</span><span class=\"mtk1\">) </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">Child</span><span class=\"mtk1\"> </span><span class=\"mtk4\">{</span><span class=\"mtk1\">...</span><span class=\"mtk12\">props</span><span class=\"mtk4\">}</span><span class=\"mtk1\"> </span><span class=\"mtk4\">{</span><span class=\"mtk1\">...</span><span class=\"mtk12\">context</span><span class=\"mtk4\">}</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span><span class=\"mtk4\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk4\">{</span><span class=\"mtk3\">/* Another option is:  {context =&gt; &lt;Child {...props} context={context}/&gt;}*/</span><span class=\"mtk4\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">UserContext.Consumer</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">);</span></span></code></pre>\n<p>The difference between the two options above is if you want the context to be a single nested property by this name, to explode it to its properties (which in my opinion is more convenient).</p>\n<ol start=\"6\">\n<li>Finally export them</li>\n</ol>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">export</span><span class=\"mtk1\"> { </span><span class=\"mtk12\">UserProvider</span><span class=\"mtk1\">, </span><span class=\"mtk12\">withUser</span><span class=\"mtk1\"> };</span></span></code></pre>\n<ol start=\"7\">\n<li>And use them however you like<br>\nFor example:</li>\n</ol>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">ReactDOM</span><span class=\"mtk1\">.</span><span class=\"mtk11\">render</span><span class=\"mtk1\">(</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">UserProvider</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk17\">&lt;</span><span class=\"mtk10\">App</span><span class=\"mtk1\"> </span><span class=\"mtk17\">/&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk17\">&lt;/</span><span class=\"mtk10\">UserProvider</span><span class=\"mtk17\">&gt;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">document</span><span class=\"mtk1\">.</span><span class=\"mtk11\">getElementById</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;root&quot;</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">);</span></span></code></pre>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk15\">export</span><span class=\"mtk1\"> </span><span class=\"mtk15\">default</span><span class=\"mtk1\"> </span><span class=\"mtk11\">withUser</span><span class=\"mtk1\">(</span><span class=\"mtk12\">LoginForm</span><span class=\"mtk1\">);</span></span></code></pre>\n<p>You'll also be able to notice I used the new \"<a href=\"https://www.loginradius.com/blog/engineering/react-hooks-guide/\">Hooks</a>\" feature that is shipped with React since version 16.8 to make it even neater and easier to create contexts.</p>\n<h3 id=\"final-piece-of-advice\" style=\"position:relative;\"><a href=\"#final-piece-of-advice\" aria-label=\"final piece of advice permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Final piece of advice</h3>\n<p>I mentioned how people overuse Redux, and it also applies to Context API. Use it only when you need to share state between lot's of components with a lot of nesting.\nMost of the time, the data you have in one component will only be relevant to its children, so passing it in props is more indicative and nicer.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n  .dark-default-dark .mtk17 { color: #808080; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n</style>","frontmatter":{"date":"October 07, 2020","updated_date":null,"description":"Context API is a (kind of) new feature added in version 16.3 of React that allows one to share state across the entire app (or part of it) lightly and with ease. Let's see how to use it.","title":"React Context API: What is it and How it works?","tags":["React","Redux","Hooks"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5151515151515151,"src":"/static/caf00c33b55e22e63d32a724e11eea7d/14b42/react.jpg","srcSet":"/static/caf00c33b55e22e63d32a724e11eea7d/f836f/react.jpg 200w,\n/static/caf00c33b55e22e63d32a724e11eea7d/2244e/react.jpg 400w,\n/static/caf00c33b55e22e63d32a724e11eea7d/14b42/react.jpg 800w,\n/static/caf00c33b55e22e63d32a724e11eea7d/47498/react.jpg 1200w,\n/static/caf00c33b55e22e63d32a724e11eea7d/0226d/react.jpg 1499w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Eylon Ronen","github":"eylonronen","avatar":null}}}},{"node":{"excerpt":"What is 'this' in Javascript The this keyword is, without doubt one of the most difficult Javascript concepts to understand. However…","fields":{"slug":"/engineering/breaking-down-this-keyword-in-javascript/"},"html":"<h2 id=\"what-is-this-in-javascript\" style=\"position:relative;\"><a href=\"#what-is-this-in-javascript\" aria-label=\"what is this in javascript permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What is 'this' in Javascript</h2>\n<p>The <code>this</code> keyword is, without doubt one of the most difficult Javascript concepts to understand. However, understanding it is key to being a great developer because it is an extremely common part of Javascript code.\nIn simple terms, <a href=\"https://www.w3schools.com/js/js_this.asp\">this</a> refers to the object it belongs to. It can also be defined as a property of an execution context, which is always a reference to an object when not in strict mode. It is worthy to note that the 'this' keyword finds usage mostly in the context of <a href=\"https://www.geeksforgeeks.org/objects-in-javascript/#:~:text=Loosely%20speaking%2C%20objects%20in%20JavaScript,the%20context%20of%20an%20object\">object oriented programming</a>. With that in mind, the 'this' keyword will refer to the object to which it belongs; This is true most of the times. Let us use an example to explain this better.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">let</span><span class=\"mtk1\"> </span><span class=\"mtk12\">bellBoy</span><span class=\"mtk1\"> = {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">firstName:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Andrew&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">lastName:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Mike&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">gender:</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Male&quot;</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk12\">age:</span><span class=\"mtk1\"> </span><span class=\"mtk7\">18</span><span class=\"mtk1\">,</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk11\">greet</span><span class=\"mtk12\">:</span><span class=\"mtk1\"> </span><span class=\"mtk4\">function</span><span class=\"mtk1\"> () {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    </span><span class=\"mtk15\">return</span><span class=\"mtk1\"> (</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk8\">&quot;Hi! I am &quot;</span><span class=\"mtk1\"> +</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk4\">this</span><span class=\"mtk1\">.</span><span class=\"mtk12\">firstName</span><span class=\"mtk1\"> +</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk8\">&quot; &quot;</span><span class=\"mtk1\"> +</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk4\">this</span><span class=\"mtk1\">.</span><span class=\"mtk12\">lastName</span><span class=\"mtk1\"> +</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">      </span><span class=\"mtk8\">&quot;, a bell boy and I am at your service&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">    )</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  },</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">bellBoy</span><span class=\"mtk1\">.</span><span class=\"mtk11\">greet</span><span class=\"mtk1\">())</span></span></code></pre>\n<p>In the example above, there exists a bellBoy Object which consists of four properties and a greet method. When the greet method of the bellBoy object is called, can you figure out what will be returned? The console.log will print the following string: Hi! I am Andrew Mike, a bell boy, and I am at your service.</p>\n<p>How did 'this.firstName' and 'this.lastName' translate to Andrew and Mike respectively? Well, to answer that, let us go back to the definition of the 'this' keyword. It was said earlier, that it refers to the object it belongs to. So, in the example above, the 'this' keyword refers to the bellBoy object, which is the owner of the greet() method. The dot(.) operator can be used to access members of the object as defined by the 'this' keyword. In the current console.log(), we are using the dot(.) operator to call or access the greet() method. In the same vein, we can use the dot(.) operator to access the properties method of the bellBoy object like the gender and the age.</p>\n<h2 id=\"contexts-in-which-the-this-keyword-can-be-used\" style=\"position:relative;\"><a href=\"#contexts-in-which-the-this-keyword-can-be-used\" aria-label=\"contexts in which the this keyword can be used permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Contexts in which the 'this' keyword can be used</h2>\n<p>The definition of <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this\">this</a> as the property of an execution context is much more accurate because depending on how it is called at runtime, 'this' can refer to many things. Let's dive deeper.</p>\n<ul>\n<li>\n<h3 id=\"this-in-the-method-of-an-object\" style=\"position:relative;\"><a href=\"#this-in-the-method-of-an-object\" aria-label=\"this in the method of an object permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>this</code> in the method of an object</h3>\n<p>First, a method is used to refer to a function that is a member of an object. All methods are functions, but not all functions are methods. Now, when the 'this' keyword is used inside a method, it refers to the owner of the method it is used in. Let's use the example defined above to take a deeper look at 'this' in this context.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">greet : </span><span class=\"mtk4\">function</span><span class=\"mtk1\">() {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk8\">&quot;Hi! I am &quot;</span><span class=\"mtk1\"> + </span><span class=\"mtk4\">this</span><span class=\"mtk1\">.</span><span class=\"mtk12\">firstName</span><span class=\"mtk1\"> + </span><span class=\"mtk8\">&quot; &quot;</span><span class=\"mtk1\"> + </span><span class=\"mtk4\">this</span><span class=\"mtk1\">.  </span><span class=\"mtk12\">lastName</span><span class=\"mtk1\"> + </span><span class=\"mtk8\">&quot;, a bell boy and I am at your service&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span></code></pre>\n<p>In this example, <code>this</code> which is used inside the <code>greet()</code> method refers to the bellBoy object, which is the owner of that <code>greet()</code> method.</p>\n</li>\n<li>\n<h3 id=\"this-in-the-global-context\" style=\"position:relative;\"><a href=\"#this-in-the-global-context\" aria-label=\"this in the global context permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>this</code> in the Global Context</h3>\n<p>When the 'this' keyword is used alone, not inside any function or better referred to as being used in the global context, the keyword refers to the global object. The global object refers to the owner of the 'this' keyword in this case. When it is in a browser window, this global object refers to the window object.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">let</span><span class=\"mtk1\"> </span><span class=\"mtk12\">y</span><span class=\"mtk1\"> = </span><span class=\"mtk4\">this</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk12\">y</span><span class=\"mtk1\">)</span></span></code></pre>\n<p><img src=\"/984e3b001aba16c70bf989733cf5931c/global-context.png\" alt=\"this in the global context\">. </p>\n<p>Since that is true, if you make a strict comparison between the value of this and the window object, we get the boolean value of true.</p>\n<p>If you run this javascript file inside your computer using a tool like <a href=\"https://www.w3schools.com/nodejs/\">node</a>, this keyword refers to an object of type of object, like so......</p>\n<p><img src=\"/163bf0821eb883bd7f1a799628bab302/system.png\" alt=\"system\"></p>\n</li>\n<li>\n<h3 id=\"this-in-a-function\" style=\"position:relative;\"><a href=\"#this-in-a-function\" aria-label=\"this in a function permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>this</code> in a function</h3>\n<p>Note, we are talking about what the keyword 'this' refers to when it is used in an ordinary function, one not affiliated with any object. Just a function is standing on its own.\nIn such a javascript object, the default value of 'this' is the owner of the function. If the code is not in strict mode and it is not been set to a member of an object, then <code>this</code> defaults to the global object.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">function</span><span class=\"mtk1\"> </span><span class=\"mtk11\">function1</span><span class=\"mtk1\">() {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk4\">this</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">function1</span><span class=\"mtk1\">() === </span><span class=\"mtk12\">window</span></span></code></pre>\n<p>In the example above, the value of the <code>this</code> keyword as used inside this function refers to the window object. This is why the output of the string comparison between funtion1 and the window object will equal to <code>true</code> because they hold the exact same value.</p>\n</li>\n<li>\n<h3 id=\"this-in-a-funtion-strict-mode\" style=\"position:relative;\"><a href=\"#this-in-a-funtion-strict-mode\" aria-label=\"this in a funtion strict mode permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>this</code> in a funtion (Strict Mode)</h3>\n<p>When in <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode\">strict mode</a> however, Javascript does not permit default binding, and because of that, it is undefined. Put simply strict mode prevents sloppy code. Thinking it from a programmers' point of view, there is most likely no good reason to want to access the value of this in a function since it will return the window object. In most cases, we access the <code>this</code> keyword because we want to get some other properties from its owner. Strict mode enforces this. So when in this mode, 'this' is undefined.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk8\">&quot;use  strict&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk4\">function</span><span class=\"mtk1\"> </span><span class=\"mtk11\">function1</span><span class=\"mtk1\">() {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk15\">return</span><span class=\"mtk1\"> </span><span class=\"mtk4\">this</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">function1</span><span class=\"mtk1\">() === </span><span class=\"mtk12\">window</span></span></code></pre>\n<p>As can be seen in the above example, in the strict mode, the value of <code>this</code> inside a function is <code>undefined</code>.</p>\n</li>\n<li>\n<h3 id=\"this-when-used-inside-event-handlers\" style=\"position:relative;\"><a href=\"#this-when-used-inside-event-handlers\" aria-label=\"this when used inside event handlers permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>this</code> when used inside Event Handlers</h3>\n<p>An event handler is an action carried out when an event is perceived to have happened. For example, when a button is clicked, we as programmers might decide hide the button. To achieve that the click event must be listened for, and an event handler must be thrown to take the action when that event is triggered. In the case of event handlers, the <code>this</code> keyword refers to the element that received the event, like this:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk12\">window</span><span class=\"mtk1\">.</span><span class=\"mtk11\">addEventListener</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;keydown&quot;</span><span class=\"mtk1\">, </span><span class=\"mtk4\">function</span><span class=\"mtk1\"> (</span><span class=\"mtk12\">event</span><span class=\"mtk1\">) {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk3\">// `this` will point to `element`, in this case the window object</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk4\">this</span><span class=\"mtk1\">.</span><span class=\"mtk12\">event</span><span class=\"mtk1\">.</span><span class=\"mtk12\">key</span><span class=\"mtk1\">)</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">})</span></span></code></pre>\n<p>In the example above, an event listener of <code>keydown</code> is being listened for by the window object, and once that event is perceived, a function that takes in the event will be run. The job of that function is to console.log <code>this.event.key</code>. If you try to run this code on the browser, you will get back whichever key the user pressed. Hence, in this case, <code>this</code> refers to the window object which is the one receiving the object, and as with all other objects, its properties can be accessed using the dot(.) operator. The value of <code>this</code> when used in an event handler will refer to the receiver of the event, which can be the window object in this case or any other local HTML elements we might create.</p>\n</li>\n<li>\n<h3 id=\"this-in-an-inline-event-handler\" style=\"position:relative;\"><a href=\"#this-in-an-inline-event-handler\" aria-label=\"this in an inline event handler permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>this</code> in an inline Event Handler</h3>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"js\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk17\">&lt;</span><span class=\"mtk4\">button</span><span class=\"mtk1\"> </span><span class=\"mtk12\">onclick</span><span class=\"mtk1\">=</span><span class=\"mtk8\">&quot;alert(this.tagName.toLowerCase());&quot;</span><span class=\"mtk17\">&gt;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">I am a this</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk17\">&lt;/</span><span class=\"mtk4\">button</span><span class=\"mtk17\">&gt;</span></span></code></pre>\n<p>It is a little bit different when 'this' is used in an inline event handler. In this case, its value is set to the DOM element on which the listener is placed. In the example above, the button is returned because the onClick event is being accepted by the DOM element whose tag name is returned in the alert method.</p>\n</li>\n</ul>\n<h4 id=\"more-contexts-exist-in-which-the-value-of-the-this-keyword-differs\" style=\"position:relative;\"><a href=\"#more-contexts-exist-in-which-the-value-of-the-this-keyword-differs\" aria-label=\"more contexts exist in which the value of the this keyword differs permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>More contexts exist in which the value of the 'this' keyword differs.</h4>\n<ul>\n<li><b>this in classes</b></li>\n<li><b>this as a constructor</b></li>\n<li><b>this with a getter or setter method</b></li>\n<li><b>this on an object's prototype chain</b></li>\n<li><b>this in arrow functions</b></li>\n</ul>\n<p>And many more. For a full description of <code>this</code> keyword, check out these links:</p>\n<ul>\n<li><a href=\"https://www.w3schools.com/js/js_this.asp\">w3Schools</a></li>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this\">MDN</a></li>\n<li><a href=\"https://www.tutorialsteacher.com/javascript/this-keyword-in-javascript\">TutorialsTeacher</a></li>\n</ul>\n<p>It might be a good idea to run the snippets of code to be sure that you understand how they work. To do this, use the free <a href=\"https://webmaker.app/app/\">webmaker</a> or the <a href=\"https://www.codeply.com/\">codeplay</a> code playgrounds.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n  .dark-default-dark .mtk7 { color: #B5CEA8; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk3 { color: #6A9955; }\n  .dark-default-dark .mtk17 { color: #808080; }\n</style>","frontmatter":{"date":"October 06, 2020","updated_date":null,"description":"As one of the most popular programming languages currently being used all around the world, understanding the core of Javascript is essential. The 'this' keyword is one of the most difficult concepts to grasp. This blog post aims to break down the 'this' keyword into small and understandable bits.","title":"Breaking down the 'this' keyword in Javascript","tags":["JavaScript","JSConcepts"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7699115044247788,"src":"/static/5e05c372676e65429e1af2977d628233/ee604/this-image.png","srcSet":"/static/5e05c372676e65429e1af2977d628233/69585/this-image.png 200w,\n/static/5e05c372676e65429e1af2977d628233/497c6/this-image.png 400w,\n/static/5e05c372676e65429e1af2977d628233/ee604/this-image.png 800w,\n/static/5e05c372676e65429e1af2977d628233/f3583/this-image.png 1200w,\n/static/5e05c372676e65429e1af2977d628233/5707d/this-image.png 1600w,\n/static/5e05c372676e65429e1af2977d628233/eeb1b/this-image.png 1920w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Efereyan Karen","github":"KarenEfereyan","avatar":null}}}},{"node":{"excerpt":"You can have data without information, but you cannot have information without data  ~Daniel Keys Moran Who runs the World? Simple Question…","fields":{"slug":"/engineering/handling-cheapest-fuel-data/"},"html":"<blockquote>\n<p><strong>You can have data without information, but you cannot have information without data</strong></p>\n</blockquote>\n<p> <em>~Daniel Keys Moran</em></p>\n<h2 id=\"who-runs-the-world\" style=\"position:relative;\"><a href=\"#who-runs-the-world\" aria-label=\"who runs the world permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Who runs the World?</h2>\n<p><strong>Simple Question! Isn't it?</strong></p>\n<p><strong>Answer- Of course, we humans, \"People\" run the world.</strong></p>\n<p>The correct answer would be data. Precisely, the information we gain from data. In this digital world, the one most common thing we all do is\n\"We all generate data\". Whenever we do something digitally, we generate data. Listening to a song, watching a movie, playing a game, chatting with friends, reading a comic blah blah blah everything generates data.</p>\n<h2 id=\"can-you-imagine\" style=\"position:relative;\"><a href=\"#can-you-imagine\" aria-label=\"can you imagine permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Can you imagine?</h2>\n<p><strong>7.8 Billion</strong> people currently live on Earth, and almost <strong>4.57 Billion</strong> people are active internet users, encompassing 59 percent of the global population.\nThis is the sixth edition of DOMO's report, and according to their research:\n** \"Over 2.5 quintillion bytes of data are created every single day, and it's only going to grow from there. By 2020, it's estimated that 1.7MB of data will be created every second for every person on earth.\"**\nAs 1 Exabyte = 1 quintillion bytes, so 2.5 Exabytes ( 2.5 * 10¹⁸ bytes) of data is generated per day.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 69.6923076923077%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAOCAIAAACgpqunAAAACXBIWXMAAAsTAAALEwEAmpwYAAABlklEQVQoz41Sy27cMAz03/YP+hf9twA99ZBLYtfr9dpey5RIiXp0JCeLIAjQzIGWYHI4FKeb53noh+v1OgzDOI7TZULsh/5yudRD/9r3PRHFGFU1hFBK+fP88uPnr2Gcu3m+TdOETOReGqYGHNZ1NeYwxtBxWGsdwBV035+ffnvmLucM1vJN5FREckol15IOlWBNKeV3lDOWkj8BSciE/pw5JmR03+5ZsnMlxfBOXTt77zHY4/655PyRUiTSoB6HpjFqBN3/O2dVT+QV6SWG2AbPygGxS23mLzqfY4uItW3AkkJE85g1RtGwgKOrRHi9rxCZhTk1FugUj1JOSk17XXgnbXWPzucXQa0V505WVDLOchQ22fvAng9bi2EaXD/KxljBORV5u3px91uiKbst2OMg4xDWtTxWde7XazpcsMY64wImFOvN5pa/8bhFETQ8aHdC4mgZX/BY1WGw3bLt607TdWPy99vOVrd5YQtf7hphDdYQHTutBldmT06xsirbEuHBMZU0qSmnD/FtzRAHL542A1CF+A8/TTEGHeWSygAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"b\"\n        title=\"b\"\n        src=\"/static/b924543e8337fbee0cb6078b3d218bda/e5715/b.png\"\n        srcset=\"/static/b924543e8337fbee0cb6078b3d218bda/a6d36/b.png 650w,\n/static/b924543e8337fbee0cb6078b3d218bda/e5715/b.png 768w,\n/static/b924543e8337fbee0cb6078b3d218bda/71c8e/b.png 875w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Big companies like Google, Amazon, Netflix, Instagram, Facebook, Twitter, and many more are generating tons of data daily.\nInformation is taken from <a href=\"https://www.smartdatacollective.com/how-much-big-data-companies-make-on-internet/\">here</a>.</p>\n<h2 id=\"google-40000-google-web-searches-per-second\" style=\"position:relative;\"><a href=\"#google-40000-google-web-searches-per-second\" aria-label=\"google 40000 google web searches per second permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Google: 40,000 Google Web Searches Per Second</h2>\n<p>More than 3.7 billion humans now have regular access to and use the internet. That results in about 40,000 web searches per second — on Google alone.</p>\n<h2 id=\"facebook-500-terabytes-per-day\" style=\"position:relative;\"><a href=\"#facebook-500-terabytes-per-day\" aria-label=\"facebook 500 terabytes per day permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Facebook: 500 Terabytes Per Day</h2>\n<p>In 2012, Facebook's system was generating 2.5 billion pieces of content and more than 500 terabytes of data per day.</p>\n<h2 id=\"twitter-12-terabytes-per-day\" style=\"position:relative;\"><a href=\"#twitter-12-terabytes-per-day\" aria-label=\"twitter 12 terabytes per day permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Twitter: 12 Terabytes Per Day</h2>\n<p>One wouldn't think that 140-character messages comprise large stores of data, but it turns out that the Twitter community generates more than 12 terabytes of data per day.</p>\n<h2 id=\"general-stats-per-minute-ratings\" style=\"position:relative;\"><a href=\"#general-stats-per-minute-ratings\" aria-label=\"general stats per minute ratings permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>General Stats: Per Minute Ratings</h2>\n<p>Here are some of the per-minute ratings for various social networks:</p>\n<p><strong>Snapchat:</strong> Over 527,760 photos shared by users</p>\n<p><strong>LinkedIn:</strong> Over 120 professionals join the network</p>\n<p><strong>YouTube:</strong> 4,146,600 videos watched</p>\n<p><strong>Twitter:</strong> 456,000 tweets sent or created</p>\n<p><strong>Instagram:</strong> 46,740 photos uploaded</p>\n<p><strong>Netflix:</strong> 69,444 hours of video watched</p>\n<p><strong>Giphy:</strong> 694,444 GIFs served</p>\n<p><strong>Tumblr:</strong> 74,220 posts published</p>\n<p><strong>Skype:</strong> 154,200 calls made by users</p>\n<p>These companies use this data to uncover the hidden patterns, correlations, and also to give insights to make proper business decisions. They analyze data for Customer Acquisition and Retention and try to personalize their products for their customers to establish a solid customer base.</p>\n<p>As of August 2020, desktop hard disk drives typically had a capacity of 1 to 8 terabytes, with the largest-capacity drives reaching 20 terabytes (single-disk drives, \"dual\" drives are available up to 24 TB).</p>\n<h2 id=\"another-question--how-they-do-it\" style=\"position:relative;\"><a href=\"#another-question--how-they-do-it\" aria-label=\"another question  how they do it permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Another Question- How they do it?</h2>\n<p>If the capacity of storage devices is much lesser than the data generated per day by such companies, how they manage it. How they process such a large amount of data without storing it anywhere? How Google search gives results in just a few seconds after processing the data stored for years? Can we store data in a storage device whose volume exceeds the capacity of the hardware?</p>\n<h2 id=\"problem--big-data\" style=\"position:relative;\"><a href=\"#problem--big-data\" aria-label=\"problem  big data permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Problem:- Big Data</h2>\n<p>All these problems combined are called Big Data. Below are some subparts of the Big Data problem-</p>\n<ol>\n<li>Firstly, the <strong>volume of data</strong> is too large. Even if we build storage devices of huge capacity, we can't cope up with the increasing data per day.</li>\n<li>Secondly, the <strong>cost of manufacturing</strong>. Even if we manufacture large size storage, it is not possible to afford their manufacturing prices even for high-profit organizations. So, What are the solutions for low- budget companies? How can they manage data?</li>\n<li>Thirdly, <strong>Velocity of data transfer(I/O Operations)</strong>. If we ignore the above limitations, the next problem posed is the time taken by Processing units to process this data. Because of the huge volume of data stored in large-capacity storage devices, data transfer is time-consuming.</li>\n</ol>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 56.15384615384615%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAIAAADwazoUAAAACXBIWXMAAAsTAAALEwEAmpwYAAACLklEQVQoz12S2U7bYBSEg92sJnj5Hcdk37xkA28YHDtx4hDbhFLaBBLixBXqAgXxBO0tUAmpT9I+ZA1FIFWa22/OjM6E8DXhUaFtAhJzkd3ChpnesAqUW8oc5jCnuHlUBG6GdDKolY12qIRGwOIzsiaE/pEgIqfie6monk4Oi5jNp48kZibVl0rtTGHnjdIkh9qBKYl0Aay8wsQjLICIQsQ7XNyskAfN2onGLDRmNSh7JuPvMaseu2hVplXg8ut9OmkAWAqoQCESEghICPzySHeAjSpgbIjn3dYnRrnZbl5sidescmMwvtz2i5hrEiMq2SNghYIEChKfYkMC+UatIz0VHTWqpwPGa0lXVf7SXzycHN/m2a+K/M3il1z2WEu5JaSHh9XXzo/JExqLmDpmC1urXs3rFJez07tfP/883P+2R9+NgmeU5q3StJMeM+sm+j+MaCxuybhdy7wfcsumfOWe3J5O7meTO8P50d6+2G/6lfyHXdwux7upsEquCVgApyExqI3DCh0z+uiwRI7Vuter+cX2ZZv73OC/lOVrq3kucYsy/XYARqn17mZ45xkOzoJAsExENQ7pM/Rhk50ZnKfzH63qymL9butcbyz5zXdV3GGTfSK6R4Rl7CU2CYsAFsnwDojpaXSYB269PA3eK9XmUt3b4c/4YCrJfTo5IGN6KqrikPjaGXuqHSyMjOzSMZ3esDKEU0BHBczJok4wjwxhUwmTihtkWAVR5QX+Cz80bdfiDCY1AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"c\"\n        title=\"c\"\n        src=\"/static/8e0f521fcb10ddd6483faec088e4fd48/e5715/c.png\"\n        srcset=\"/static/8e0f521fcb10ddd6483faec088e4fd48/a6d36/c.png 650w,\n/static/8e0f521fcb10ddd6483faec088e4fd48/e5715/c.png 768w,\n/static/8e0f521fcb10ddd6483faec088e4fd48/71c8e/c.png 875w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<h2 id=\"solution-\" style=\"position:relative;\"><a href=\"#solution-\" aria-label=\"solution  permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Solution:-</h2>\n<p>Big Data can be taken as technology or field that treats ways to analyze, systematically extract information from, or otherwise deal with data sets that are too large or complex to be dealt with by traditional data processing.\nOne of the concepts that solve the above problem is Distributed Storage.</p>\n<p><strong>Distributed Storage Cluster-</strong></p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 435px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 65.28735632183907%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAIAAAAmMtkJAAAACXBIWXMAAAsTAAALEwEAmpwYAAABvklEQVQoz2P4TwFgAOIvX77cu3f/yZMnb968efr02UswePbs2aPHj4Dkk6dPP33+hFPzjx8/XoDB58+fgfpfv3797t279+/fgxhv3wLJr1+/4tSMFfz+9/fb39/f/v769u/3z7+///37h1PzPyTw999foIjb4Qa1XVmm+0u19+YZ7C16/u09SNn/fwRshqiIOtPveLzO83iTzaFKh4O1L4jRDHfek2evb957fObS9WOnL5y7eP3bt+9wB+K1GSwdk1Nv7ZMcmV7lHJzpGZX/6u0HZKPRNYN8+/cvMNp+/fr1+/fvpet2Tpi1YvqCNRNnLZ+1eP3bdyDN38EAbj+6zT9//gQagQjz379//foJZEAEIeYibIaIXrh4qbGpacKEid3dPU3NzWfOnl+2fEVTU3N3d29La9uUqdPOnDvf2dnV19s3ZfKUtra2/QcOgjT/+fMHSK1Zu05BTs7d1dXDzV1JQWHpshXpaenqqqqBAQEmRkZurq5Lli1XU1VzdnT0dPdQUlDs7ukFaYa4/uPHT7du3r51C4ref/gITKc3b92+efMWkPvgwcP37z/cuHnrxo2b12/cBJKvXr0G6gIAWb2kPX+THHwAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"d\"\n        title=\"d\"\n        src=\"/static/9024951b223197f7bf7a5116af24b446/330eb/d.png\"\n        srcset=\"/static/9024951b223197f7bf7a5116af24b446/330eb/d.png 435w\"\n        sizes=\"(max-width: 435px) 100vw, 435px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Distributed storage is a method that provides huge storage(even exceeding from physical storage) shared by multiple systems. These systems or the servers are connected following horizontal scaling. This multiple commodity server hardware is comparatively cheap than optimized servers with large storage(Hard Disk). Each virtual machine contributes directory to a centralized system and thereby shares its storage. The team of master and slave nodes working together for one purpose called a cluster.</p>\n<p>One of the Topologies or the architecture used for implementing a Distributed storage system is <strong>Master-slave architecture</strong>.\nMaster-slave architecture- Master-slave is a model of asymmetric communication or control where one device(the \"master\") connected to one or more other devices(the \"slaves\") are connected using a protocol(Network), where the slave nodes/devices can contribute a part/whole of their storage devices to the master node, like this centralized master node can store data exceeding its local storage limit.</p>\n<p>The slave nodes can be commodity hardware/devices that need not be expensive and high functioning.\nAs the data is split and stored in(and loaded from) other devices/nodes, the I/O operations (data transfer) can be performed parallelly on all the devices. Thus, reducing the time consumption by a large factor.</p>\n<p><strong>Hence, distributed storage solves all the problems- Volume, Cost, and Velocity.</strong></p>\n<h2 id=\"apache-hadoop\" style=\"position:relative;\"><a href=\"#apache-hadoop\" aria-label=\"apache hadoop permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Apache Hadoop</h2>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 30%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAYAAADDl76dAAAACXBIWXMAAAsTAAALEwEAmpwYAAAB8UlEQVQY0wHmARn+AC8vLwD//1YCsqhZAP//ZwCMciUA/56hArwqMxKtLDUNtS45D6guOAzSMDoRqWY5AvYPKQDtEysA6x8oAP9SHgD/WgAA2lslB/mgIgDzkSMAABMVLgD/8lMAioNHP8y8SJlucyAquAACKfcLDDH/Fx0w/wwOLP8CBB3XCAs+5QYdJvMMKivoFStH4CAsdO5QJYTuaiPJ8Igk6vSUI73whyQOAA8NABWnn1ej2MlS+vHfS//OvDz/VG9kzjVfgFsvPEFFSVNnU0g7WmQ+X3Otez9a8KIwSPWfL0T9pjtE/6xVQP+7Zzv/7Yki//ibIrnsiCQNAFdSLCLSw0b/5dNH/8y7PuqIgjO3RHqG5z14jvJGh53/TJ63/1R5lf9HhZ3/VH2V/0iGnv9WdIr/Touj/E59j/9Neortw2gjPrlpHAD/th0AAD02DAmnmjJ/qJs1pJ+NKlIAACgpJkJUhStPXYZKgZyzTGqLyllkidZZW3faY2J90UxpfrRJcIWdPm6C5kqAlMk5bH9mrW46AIp5YgLfkCYBAGheGwDi0UMA//9ZAM63NwD//wAATcrVAGi31gCv//8AfAAACIUAAA0A//8A/wAAAUf//wCBr9EACRQXKwARGgxBiaUAt41fA/9jAADXWQAArCvPD9WXLikAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"e\"\n        title=\"e\"\n        src=\"/static/ea8134ccb65d292f944f9e7d8f5173ba/e5715/e.png\"\n        srcset=\"/static/ea8134ccb65d292f944f9e7d8f5173ba/a6d36/e.png 650w,\n/static/ea8134ccb65d292f944f9e7d8f5173ba/e5715/e.png 768w,\n/static/ea8134ccb65d292f944f9e7d8f5173ba/71c8e/e.png 875w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>Distributed storage is just a concept, and some companies have launched different software or products that work on this concept which solve the problem of Big Data. One such company is <strong>APACHE and the software APACHE HADOOP</strong>.\nThe Apache Hadoop software is a collection of libraries that provides facility to create clusters/network of systems following the distributed system. It can be used in processing the huge data distributes in thousands of machines, each offering local computation and storage.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"October 06, 2020","updated_date":null,"description":"You can have data without information, but you cannot have information without data. Huge data is generated per day. What are the issues in handling it? How big companies manage and analyze it?","title":"Handling the Cheapest Fuel- Data","tags":["Data","BigData","Hadoop"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/197c7c10e56844e11cee38047766f8ab/ee604/a.png","srcSet":"/static/197c7c10e56844e11cee38047766f8ab/69585/a.png 200w,\n/static/197c7c10e56844e11cee38047766f8ab/497c6/a.png 400w,\n/static/197c7c10e56844e11cee38047766f8ab/ee604/a.png 800w,\n/static/197c7c10e56844e11cee38047766f8ab/f3583/a.png 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Samriddhi Mishra","github":"SamriddhiMishra","avatar":null}}}},{"node":{"excerpt":"The GitHub CLI is a recent GitHub released tool that takes tasks of issue / PR management to the terminal. It will be a useful tool that…","fields":{"slug":"/engineering/github-cli-tool/"},"html":"<p><em>The <a href=\"https://cli.github.com/\">GitHub CLI</a> is a recent GitHub released tool that takes tasks of issue / PR management to the terminal. It will be a useful tool that will put more of our workflow for software creation into the textual domain rather than the visual domain. It’s just called <code>gh</code>.</em></p>\n<p>*<strong>*Installation of GitHub CLI 💡**</strong></p>\n<p>GitHub CLI has releases with significant operating systems, visit the installation page and find instructions on how to install GitHub CLI for your operating system.</p>\n<p>For [Windows] and [macOS], you will use the package managers to update and maintain GitHub CLI, and for <a href=\"https://github.com/cli/cli/releases/tag/v1.0.0\">Linux</a> users, you may need to grab the software from the latest release website.</p>\n<p>Here are examples of the installation instructions for each compatible platform:</p>\n<p>→ Windows</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">scoop bucket add github-gh https://github.com/cli/scoop-gh.gitscoop install gh</span></span></code></pre>\n<p>→ macOS</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">brew install github</span></span></code></pre>\n<p>→ Debian/Ubuntu Linux</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">sudo apt install git &amp;&amp; sudo dpkg -i gh_*_linux_amd64.deb</span></span></code></pre>\n<p>→ Fedora/Centos Linux</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">sudo yum localinstall gh_*_linux_amd64.rpm</span></span></code></pre>\n<p>→ Arch Linux</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">yay -S github-cli</span></span></code></pre>\n<p>You’ll need to authenticate your account after you install GitHub CLI. Running any command would activate this process of authentication(via OAuth). Well, you can use Git CLI.\n<span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 623px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 126.64526484751204%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAZCAIAAAC+dZmEAAAACXBIWXMAAAsTAAALEwEAmpwYAAADNElEQVQ4y41UWWsUWRSu3zIPwgz44IvMgw+CL4IgCI5BRlFEQYm44wrz7OhMUBBFBEFwA1/ckhmDISC44ZIIOkl6S9Ld1bXdqurqVHXVrbv5VVWbODqtc/j69Klzz3fvueecKi1lvABN2eYt2zZsHFi1es3vfwwppWpesx6YMM5fuHT6zNDZofPAYjyg4ZfQFBHv/5leu2790ROn9h04vHHzr/D89vLcn5NXeSR27tkbxzE8g/sPNZotGDipRy7AuNi1e/CHZT/9uHzFxctXEGF1XCf0YVy4ePnhyF/Xrt84cuwkHpOcuUTGTlKpdtC5efvO6Ng4IoRUElCZJJQS15+vNxAAP/2CnPPTlGVeQly9ZRimZRHS0PUmHkzLdkg3Thjni8yCrCiTNJWUqZQrxw1qtUbLIPNNs2WCbDd1u9GydcPxgy4TyFllkTk0nrqSu4pDE0AJD+n3IP0lW/lYkowUYTx1AI1Hkx3nObFeB95E4L4NvEnfeePZr6Hb5C1ArFeZP8NEx5+E9skbFk8pXtZ4PJNGU0lYolEpiaDLOUqLurswA38eUC5i4rAkaE2xWdwZlUoY+xo0x6JBP/eAAmhcoCPoipRFbzJkPyEk/x40tHHixVPbtgzDgPZc1/bjukMxM6rX5kL/h2TkJ2OjtmU5jmNZ+LdNp90wPNsmEGjHIZ7f7gSdbjf+kiyESLngXDDGv94bq6q/aJirmXLVNJq10rvA0xd8Pex0MEzZzftLktD8ZFmIkIJKkQqWZGl888ClkzGuc/Wm53u6Xm825lot0yHEME1MN5b60ZBvRsYphmm3fWLpZbtVtUzD83y8vWEUif6Z83zfrGAoVQ4obCXV/5asYOXqrGXbU1PT5Up1tvIhDKzv0mj+8dFQK0qp+PTic5bwdKmfXPIc4t/IPL07q3w8heh1Bxp2gW8cjtWsVTwfEgDJoFRpfvdibEbnn92cHr5bGXtQG79beXy/On6vMnZrZmRk9gm6ioLJ/OuTMTCGc/P1MOrCxnNMkx2PTq689cum4YPbHx3f+vfR7aOnBkYO/nx7YGD40AKNNNlfcIGE0TCNwrQLHUFTGF0YMUuQ+UdA13EK+hZQxwAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Auhtorize\"\n        title=\"Auhtorize\"\n        src=\"/static/b6ad06259d464af651573dc4aed7dcba/6114d/Authorize.png\"\n        srcset=\"/static/b6ad06259d464af651573dc4aed7dcba/6114d/Authorize.png 623w\"\n        sizes=\"(max-width: 623px) 100vw, 623px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>*<strong>*What is CLI really doing? 🤔**</strong></p>\n<p>The GitHub CLI lets you handle issues/ PRs / repositories from inside your console. Let’s have a look at it:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">gh issue [status, list, view, create]</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">gh pr [status, list, view, checkout, create]</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">gh repo [view, create, clone, fork]</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">gh </span><span class=\"mtk11\">help</span></span></code></pre>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 64.76923076923077%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAYAAACpUE5eAAAACXBIWXMAAAsTAAALEwEAmpwYAAAB+ElEQVQ4y5WSSU9bMRSFjTKwa1XyxrzBb87UZNNtl5AumnRRVQKEIGLDBgkkghBDaJr+7/j0OHmp1NIKWHy6tuV7fO71FWI+XxKIxUKJHwsdX89P5mqN+VwJMf++3LqaYnsyUfXJCWrHx2Qdqy/hhHeZK25uNoLz5fbXb/gYOyr/4OGdYcLUmNbL2WmoyulpKfjwsKyPvyD2AiXTBL6MECUpTNuBQcxnWN0xTFU5OoKYzSh4d7esj0aQfqiiNIOME8SMluPCsOzn2QgeHIDm1oLbFPQcVxWdLvKihYzIKIYXhIj4QCDlah8S/WAQSvisQrbaaPLMaBh/CtY/jxAFoSq6PYRMSLIcTtOH5TZhE5Nu9drQrv9V+t8OtaC5Y6goS5GSwWCATqeNVquFoigQ5znSdhtpnqHp+2iY9u/+/bdkSYf6M9KUpbDELMtYboyE+w363HKcJ3186pCCUShVq99HQlfd/gBdutQ97ZBu7z16PIvzAn6UoCnjFR4N+GyP2/RUZX+/FLy/59iM0XjzVlmuy48I4IchPyCC53kIOJMpZy0kCYnpyGaZFrHZU91jSzs8PCzHhoJbZ2eojUaqNvyE6t4eqrua3fV6OERFR1Ip0etaGavMqY3HSpyflw5ns6W4vYWYTpW4vIS4uHgdOuf6Wq00Hh/VL6PvkYUjnVP6AAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"gh pr status\"\n        title=\"gh pr status\"\n        src=\"/static/dd3fb5eb26988074652e8f4e50e378f7/e5715/ghpr.png\"\n        srcset=\"/static/dd3fb5eb26988074652e8f4e50e378f7/a6d36/ghpr.png 650w,\n/static/dd3fb5eb26988074652e8f4e50e378f7/e5715/ghpr.png 768w,\n/static/dd3fb5eb26988074652e8f4e50e378f7/71c8e/ghpr.png 875w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p><em>It should be said that gh is not the same stuff as git. It’s because <code>gh</code> just adds GitHub tools to the terminal. Version management is yet to be managed with git.</em></p>\n<p>*<strong>*CLI Commands ➫**</strong></p>\n<p>We’re going to cover a bunch of exciting commands. Let’s use the official <a href=\"https://github.com/angular/angular\">Angular.js repo</a> to run <code>gh</code> commands</p>\n<p>Clone the <code>Angular</code> repo, and navigate to the repository. You can either clone the repo through HTTPS/ ssh/ Git CLI. I’m going to clone the repo through <code>git CLI</code> since we are working on GIT CLI.</p>\n<p>Let’s execute the <code>$gh issue --help</code> see what commands are available.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">gh issue --help  </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">Work with GitHub issues</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">USAGE</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  gh issue &lt;command&gt; [flags]</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">CORE COMMANDS</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  close:      Close issue</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  create:     Create a new issue</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  list:       List and filter issues </span><span class=\"mtk15\">in</span><span class=\"mtk1\"> this repository</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  reopen:     Reopen issue</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  status:     Show the status of relevant issues</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  view:       View an issue</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">FLAGS</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  -R, --repo OWNER/REPO   Select another repository using the OWNER/REPO format</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">INHERITED FLAGS</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  --help   Show </span><span class=\"mtk11\">help</span><span class=\"mtk1\"> </span><span class=\"mtk15\">for</span><span class=\"mtk1\"> </span><span class=\"mtk11\">command</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">ARGUMENTS</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  An issue can be supplied as an argument </span><span class=\"mtk15\">in</span><span class=\"mtk1\"> any of the following </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  formats:</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  - by number, e.g. </span><span class=\"mtk8\">&quot;123&quot;</span><span class=\"mtk1\">; or</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  - by URL, e.g. </span><span class=\"mtk8\">&quot;https://github.com/OWNER/REPO/issues/123&quot;</span><span class=\"mtk1\">.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">EXAMPLES</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  $ gh issue list</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  $ gh issue create --label bug</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  $ gh issue view --web</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">LEARN MORE</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  Use </span><span class=\"mtk8\">&#39;gh &lt;command&gt; &lt;subcommand&gt; --help&#39;</span><span class=\"mtk1\"> </span><span class=\"mtk15\">for</span><span class=\"mtk1\"> more information about a command.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  Read the manual at https://cli.github.com/manual</span></span></code></pre>\n<p>It’s Time to view Problems/issues in the angular repo.😁</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">gh issue list</span></span></code></pre>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 490px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 124.48979591836735%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAZCAIAAAC+dZmEAAAACXBIWXMAAAsTAAALEwEAmpwYAAADkklEQVQ4yy1UCY7TQBDMD7nZI85hO+Mjvu3YubPciIchIViOFbC7Ai3ZFTzAM5MHUDWJZEXjeLq7qrq6O7+d4ffQ/XdsqWGosqkKCulE0k3kIODBiZSXSTdWYanGlRwlEq8ilf2gfdzr/AjcD5W/tXray/WLd3p6ppEibVRSq3yG2wzDGb/FnAc/4znI20e9zqXvnGfi9tTSo1SvX6tRigp6ssKviioAQSJW9lJdr9W4VPEElQGnfTpAZec8F3ddSzuxymYS4MOSwdlU5zPl5/iTMUHOymHBSNQXaftk0LnynK+J+HtiguuVxtWgVPWGNxCA+Gii0ylK6WopRaKRAqS8dM/ZAWdW9gs93ehmo/EtrlFWxxOek4YBECKbEj+IVAsES8vr/PQJe2tZFKzZUFukn6yIGU88QX3IpjdvAJviAwX+HFeEfek5n3LvFpUBbHZGnbKGPBFQLgjYPQhOIeqVOaxlWLSP+6z8ofSg9s4vJFLiwWeAjMG5AGDiRxg6lDQSKgC2nwM/OV8L50sqtl0Go8msCWwEZjSn8ktVLaEzkkqRHRrJ4D4F+1QAdk8PxuQMV/g5PztjNhZZQAcH9AyMipm0hDKKyqMhOX+GSVAZJplu2NK0MWwbKhyWRjNCRat261d8hUnR54fWXjBxY1k79PPZW9wgZ/SGNqKrtPEG8aORxYKeFYns+/LYJuyPhbft9WASPX+Ob7wN2iIhBJMLUqGgNmND8LFxGAS7Es55YVo1CJkY8CAbsEUVDz5GKjKRM9QHHRIxbj8I9r4OMFU74GQYMbM4dDIFGT8ytoGcBywNCHOqrjwbDvtjRpIG7Hl69ZLewgwMQmpeLTS0dSKUxZDDm8Rv4inYt2R0d9rdwZ6wDqaKmNln5hqGVL5aIp4dAmfoWq+5D45sOmzfKg0bxvVhHnHPjASfyCi09xwy+hy19mjYPulzJC/iEYNhRgwdTAJ5SZVWgU77CTHroaTtwDmqwIKDYZaBdwPBwspIYsYYD/TDVOAel8mUzQf4vZbosz1uARuVfwYuRxLenj+nGCLV5RKJuABFYnQKFcMWHI+MRKQdUW1wvohGdyfdXWgUOnHZIUCFqugqOgfn0BslGaHhyIKeo3/GYS6CtxhJWKeco/scA6wEL6NChjkm0Wy12cG52IHDoL1/2vnl2teegx2m7EgZG+0rEJslkF6Xcy4T2wwZVy+Wbr990G3vnfwHK6J5DQ/JkAUAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Angular issue\"\n        title=\"Angular issue\"\n        src=\"/static/3049d6111c908f6724c7ccdf2b1227e6/41d3c/angular%20issue.png\"\n        srcset=\"/static/3049d6111c908f6724c7ccdf2b1227e6/41d3c/angular%20issue.png 490w\"\n        sizes=\"(max-width: 490px) 100vw, 490px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p>*<strong>*Pull Requests 🤖**</strong></p>\n<p>It is now possible to build a Pull Request (PR) on the terminal. You will perform <code>$gh pr create</code> right after you have committed a feature or bug branch. This interactively creates the pull request.😉</p>\n<p>Let’s execute the <code>$gh pr --help</code> see what commands are available.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"8\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">Work with GitHub pull requests</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">USAGE</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  gh pr &lt;command&gt; [flags]</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">CORE COMMANDS</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  checkout:   Check out a pull request </span><span class=\"mtk15\">in</span><span class=\"mtk1\"> git</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  checks:     Show CI status </span><span class=\"mtk15\">for</span><span class=\"mtk1\"> a single pull request</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  close:      Close a pull request</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  create:     Create a pull request</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  diff:       View changes </span><span class=\"mtk15\">in</span><span class=\"mtk1\"> a pull request</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  list:       List and filter pull requests </span><span class=\"mtk15\">in</span><span class=\"mtk1\"> this repository</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  merge:      Merge a pull request</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  ready:      Mark a pull request as ready </span><span class=\"mtk15\">for</span><span class=\"mtk1\"> review</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  reopen:     Reopen a pull request</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  review:     Add a review to a pull request</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  status:     Show status of relevant pull requests</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  view:       View a pull request</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">FLAGS</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  -R, --repo OWNER/REPO   Select another repository using the OWNER/REPO format</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">INHERITED FLAGS</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  --help   Show </span><span class=\"mtk11\">help</span><span class=\"mtk1\"> </span><span class=\"mtk15\">for</span><span class=\"mtk1\"> </span><span class=\"mtk11\">command</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">ARGUMENTS</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  A pull request can be supplied as an argument </span><span class=\"mtk15\">in</span><span class=\"mtk1\"> any of the following formats:</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  - by number, e.g. </span><span class=\"mtk8\">&quot;123&quot;</span><span class=\"mtk1\">;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  - by URL, e.g. </span><span class=\"mtk8\">&quot;https://github.com/OWNER/REPO/pull/123&quot;</span><span class=\"mtk1\">; or</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  - by the name of its head branch, e.g. </span><span class=\"mtk8\">&quot;patch-1&quot;</span><span class=\"mtk1\"> or </span><span class=\"mtk8\">&quot;OWNER:patch-1&quot;</span><span class=\"mtk1\">.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">EXAMPLES</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  $ gh pr checkout 353</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  $ gh pr create --fill</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  $ gh pr view --web</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">LEARN MORE</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  Use </span><span class=\"mtk8\">&#39;gh &lt;command&gt; &lt;subcommand&gt; --help&#39;</span><span class=\"mtk1\"> </span><span class=\"mtk15\">for</span><span class=\"mtk1\"> more information about a command.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  Read the manual at https://cli.github.com/manual</span></span></code></pre>\n<p><strong>**</strong>Let’s view some of it:👀<strong>**</strong></p>\n<p>current PR’s in the repo:</p>\n<p><code>$ gh pr list</code>\n<span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 630px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 104.28571428571429%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAVCAIAAADJt1n/AAAACXBIWXMAAAsTAAALEwEAmpwYAAADJ0lEQVQ4yzVU2W7TQBT1D7KWNrv3NfGaxUmapgXBz1FVJVKXIOAd8dBklnwA59ggjUb22HPPPcuMofxURaW0EjkK5SCQZqScibRjvroTDDEMxNBXYS7dMV7xsxj44nVXvO0bf85Gv89M0bGxTQ4DOYq4x4zEBVZi6U1Ez+U6v4Zcwdz3RM8T74fGLvbuYufFik6Lra4xrvViq9KFymvMevVRzTYqmWnM1aWablRcaXxabNGm8ZR4D7F7RGOTOTZIO1GTmQpy5WeqXHEultig4lIGmQTBqOQPRS27rrFL/bvMO4yC03yrVzc6W6iwVMVKL2+wWc+vWDHI9fRSrz8pfM2X6IWKdBzjOXR3Y/dl4Gmsjqf8HOYqyP49YE6m0hmTRVigOxTibMXi3DK+ZcEtkL2xrtZyPGV59JktdLHUQIYKs40uaiwCnL2AbaOWOBsZ+9B9iJ3DyFfjmYoKnS5IG+WjgrDpnFqAcFyCOVsYT+lIx+FmIuc+1AYUlABtdtiw1ZvPZFgQjfhZDedoG7z0UnlhG/vIffbtgxUyKs6EtJMZZ0iaL/G3wgA+Ba8QB/FuALYwHw/Gt9T/mnkv/gQ+k9jVFw0/0TYJX2tYUK2hWes8dKLOViRedcSbnvGrb/7ojY59jxpCXoD4mQwL+plUEkk8R/4c0XXFhSW6DhRByPiMhN1n/m3mHvyJLteIAaXOa2ICEOIjYZANaSlWSBh1wQzzIWHfJ+fHyDmYIdSmh8xQodoWYGzQPLSpguxR0cZetGo/2s6DaR2GAdGQKnADVLXW8w1fYThSDS2gNpRPpnShvkYt2XONfeA+ALnv6nYbdM4ZCYoE5jAW4UHCsQj8/6WxIpuENdm2whPSiwF66ZyEkSoUAj2Ijz3Vil3gtXGBWvY8ZpvIQ6/J0wL7WZVUkeqKM8/Qsol6Ac0ZLyshZyDvMv8+BXJ0Are8PqEqFEoqlkcwwDMudX3DQ47LpDkV6EjgPvhgGt9N+2loHq1QYxXxhDawp1oxWxkZwlhq1hwykkLFpjruE+OnZe9t6zjwaEw74BkPwEy1/Qd5W0I1keZphZB+hjvsLwWe5oWFwbmJAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"Angular pullrequest\"\n        title=\"Angular pullrequest\"\n        src=\"/static/c7c9214ed811a39667e4204bae7880cc/f058b/angular%20pr.png\"\n        srcset=\"/static/c7c9214ed811a39667e4204bae7880cc/f058b/angular%20pr.png 630w\"\n        sizes=\"(max-width: 630px) 100vw, 630px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></p>\n<p><strong>*</strong>Let’s view an individual pr:<strong>*</strong></p>\n<p>I’m going with the first pull request <code>#38899</code>. Through gh cmd $ gh pr view <code>38899</code>.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"9\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">refactor(compiler): simplify visitor logic </span><span class=\"mtk15\">for</span><span class=\"mtk1\"> attributes</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">Draft • atscott wants to merge 1 commit into master from testrefactor</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">Labels: cla: yes, comp: compiler, state: WIP, target: patch</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">Milestone: needsTriage</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">The logic </span><span class=\"mtk15\">for</span><span class=\"mtk1\"> computing identifiers, specifically </span><span class=\"mtk15\">for</span><span class=\"mtk1\"> bound attributes can  </span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  be simplified by using the value span of the binding rather than the </span><span class=\"mtk11\">source</span><span class=\"mtk1\"> span.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">View this pull request on GitHub: https://github.com/angular/angular/pull/38899</span></span></code></pre>\n<p>*<strong>*Repository 🤖**</strong></p>\n<p>Let’s execute the <code>$gh repo --help</code> see what commands are available</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"10\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">Work with GitHub repositories</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">USAGE</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  gh repo &lt;command&gt; [flags]</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">CORE COMMANDS</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  clone:      Clone a repository locally</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  create:     Create a new repository</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  fork:       Create a fork of a repository</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  view:       View a repository</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">INHERITED FLAGS</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  --help   Show </span><span class=\"mtk11\">help</span><span class=\"mtk1\"> </span><span class=\"mtk15\">for</span><span class=\"mtk1\"> </span><span class=\"mtk11\">command</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">ARGUMENTS</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  A repository can be supplied as an argument </span><span class=\"mtk15\">in</span><span class=\"mtk1\"> any of the following formats:</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  - </span><span class=\"mtk8\">&quot;OWNER/REPO&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  - by URL, e.g. </span><span class=\"mtk8\">&quot;https://github.com/OWNER/REPO&quot;</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">EXAMPLES</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  $ gh repo create</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  $ gh repo clone cli/cli</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  $ gh repo view --web</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">LEARN MORE</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  Use </span><span class=\"mtk8\">&#39;gh &lt;command&gt; &lt;subcommand&gt; --help&#39;</span><span class=\"mtk1\"> </span><span class=\"mtk15\">for</span><span class=\"mtk1\"> more information about a command.</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  Read the manual at https://cli.github.com/manual</span></span></code></pre>\n<p>It is better to clone a repository using the gh command than with the git command. I have done this above. Only through gh cmd, I have cloned angular repo.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"11\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">$ gh repo clone angular/angular</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">$ gh repo fork</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">- Forking angular/angular...</span></span></code></pre>\n<p>Start functioning. You should create a new PR after this (<code>$gh pr create</code>)! It’s sort of remarkable that all of that element is now available in the terminal!😍</p>\n<p>*<strong>*Gist 🐱‍🚀**</strong></p>\n<p>It is now simple to create a gist on GitHub from the terminal using the CLI cmd.</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"bash\" data-index=\"12\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk1\">gh gist create &lt; file &gt;</span></span></code></pre>\n<p>*<strong>*Conclusion🙀**</strong></p>\n<p><a href=\"https://cli.github.com/\">Git CLI's</a> primary objective is to \"minimize context switching\" by allowing you to continue inside your terminal/console, rather than opening your browser to access <a href=\"https://github.com/\">GitHub</a>. For additional functionality and knowledge on using the current resources, you may link to the <a href=\"https://cli.github.com/manual/\">manual</a>.</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk15 { color: #C586C0; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n</style>","frontmatter":{"date":"October 05, 2020","updated_date":null,"description":"Learn about GitHub CLI tool and how/when to use it","title":"GitHub CLI Tool ⚒","tags":["Cloud","GIT","Version control"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5384615384615385,"src":"/static/83b212a04295c14c34c4446afe679467/d8212/GitHub%20CLI%20Tool.png","srcSet":"/static/83b212a04295c14c34c4446afe679467/69585/GitHub%20CLI%20Tool.png 200w,\n/static/83b212a04295c14c34c4446afe679467/497c6/GitHub%20CLI%20Tool.png 400w,\n/static/83b212a04295c14c34c4446afe679467/d8212/GitHub%20CLI%20Tool.png 757w","sizes":"(max-width: 757px) 100vw, 757px"}}},"author":{"id":"Saravanan Vijayamuthu","github":"SaravananVijayamuthu","avatar":null}}}}]},"markdownRemark":{"excerpt":"Google has prepared a roadmap to restrict third-party cookies in Chrome. Since 04 January 2024, Chrome has rolled out third-party cookie…","fields":{"slug":"/engineering/identity-impact-of-google-chrome-thirdparty-cookie-restrictions/"},"html":"<p>Google has prepared a roadmap to restrict third-party cookies in Chrome. Since 04 January 2024, Chrome has rolled out third-party cookie restrictions for 1% of stable clients and 20% of Canary, Dev, and Beta clients.</p>\n<p><strong>What does it mean for user authentication?</strong></p>\n<p>On one hand, Google believes third-party cookies are widely used for cross-site tracking, greatly affecting user privacy. Hence, Google wants to phase out (or restrict) supporting third-party cookies in Chrome by early Q2 2025 (subject to regulatory processes).</p>\n<p>On the other hand, Google introduced Privacy Sandbox to support the use cases (other than cross-site tracking and advertising) previously implemented using third-party cookies.</p>\n<p>In this article, we’ll discuss:</p>\n<ul>\n<li>How is user authentication (identity) affected?</li>\n<li>What is Google offering as part of Privacy Sandbox to support various identity use cases when third-party cookies are phased out?</li>\n</ul>\n<h2 id=\"how-is-user-authentication-affected\" style=\"position:relative;\"><a href=\"#how-is-user-authentication-affected\" aria-label=\"how is user authentication affected permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How is User Authentication Affected?</h2>\n<p>Third-party cookie restrictions affect user authentication in three ways, as follows.</p>\n<h3 id=\"external-identity-providers\" style=\"position:relative;\"><a href=\"#external-identity-providers\" aria-label=\"external identity providers permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>External Identity Providers</h3>\n<p>If your website or app uses an external Identity Provider (IdP) — like LoginRadius, the IdP sets a third-party cookie when the user authenticates on your app.</p>\n<h3 id=\"web-sso\" style=\"position:relative;\"><a href=\"#web-sso\" aria-label=\"web sso permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Web SSO</h3>\n<p>If you have multiple apps across domains within your organization and authentication is handled using an IdP (internal or external) with web SSO, you already use third-party cookies to facilitate seamless access for each user using a single set of credentials.</p>\n<p>If you have implemented web SSO with one primary domain and multiple sub-domains of the primary domain, third-party cookie restrictions may not apply. For now, Google doesn’t consider the cookies set by sub-domains as third-party cookies, although this stance may change in the future.</p>\n<p>For example, you have apps at <code>example.com</code>, <code>travel.example.com</code>, <code>stay.example.com</code>, and web SSO is handled by <code>auth.example.com</code>. In this case, third-party cookie restrictions don’t apply.</p>\n<h3 id=\"federated-sso\" style=\"position:relative;\"><a href=\"#federated-sso\" aria-label=\"federated sso permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Federated SSO</h3>\n<p>Federated SSO is similar to, albeit different from, web SSO. It can handle multiple IdPs and applications—aka., Service Providers (SPs)—spanning multiple organizations. It can also implement authentication scenarios that are usually implemented through web SSO.</p>\n<p>Usually, authentication is handled on a separate pop-up or page when the user wants to authenticate rather than on the application or website a user visits. </p>\n<p>For example, you already use federated SSO if you facilitate authentication for a set of apps through multiple social identity providers as well as traditional usernames and passwords.</p>\n<blockquote>\n<p><strong>Note</strong>: It is also possible to store tokens locally, not within cookies. In this case, third-party cookie restrictions won’t affect token-based authentication. However, the restrictions still affect authentication where tokens are stored within third-party cookies (a common and secure method).</p>\n</blockquote>\n<h2 id=\"chromes-alternatives-for-third-party-cookies\" style=\"position:relative;\"><a href=\"#chromes-alternatives-for-third-party-cookies\" aria-label=\"chromes alternatives for third party cookies permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Chrome’s Alternatives for Third-Party Cookies</h2>\n<p>Google has been developing alternative features and capabilities for Chrome to replace third-party cookies as part of its Privacy Sandbox for Web initiative.</p>\n<p>Specific to authentication, Google recommends the following:</p>\n<ol>\n<li>Cookies Having Independent Partitioned State (CHIPS)</li>\n<li>Storage Access API</li>\n<li>Related Website Sets</li>\n<li>Federated Credential Management (FedCM) API</li>\n</ol>\n<h3 id=\"cookies-having-independent-partitioned-state-chips\" style=\"position:relative;\"><a href=\"#cookies-having-independent-partitioned-state-chips\" aria-label=\"cookies having independent partitioned state chips permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Cookies Having Independent Partitioned State (CHIPS)</h3>\n<p><a href=\"https://developers.google.com/privacy-sandbox/3pcd/chips\">CHIPS</a> are a restricted way of setting third-party cookies on a top-level site without making them accessible on other top-level sites. Thus, they limit cross-site tracking and enable specific cross-site functionalities, such as maps, chat, and payment embeds.</p>\n<p>For example, a user visits <code>a.com</code> with a map embed from <code>map-example.com</code>, which can set a partitioned cookie that is only accessible on a.com. </p>\n<p>If the user visits <code>b.com</code> with a map embed from <code>map-example.com</code>, it cannot access the partitioned cookie set on <code>a.com</code>. It has to create a separate partitioned cookie specific to <code>b.com</code>, thus blocking cross-site tracking yet allowing limited cross-site functionality.</p>\n<p>You should specifically opt for partitioned cookies (CHIPS), which are set with partitioned and secure cookie attributes.</p>\n<p>If you’re using an external identity provider for your application, CHIPS is a good option to supplant third-party cookie restrictions. </p>\n<p>However, CHIPS may not be ideal if you have a web SSO or federated SSO implementation. It creates separate partitioned cookies for each application with a separate domain, which can increase complexity and create compatibility issues.</p>\n<h3 id=\"storage-access-api\" style=\"position:relative;\"><a href=\"#storage-access-api\" aria-label=\"storage access api permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Storage Access API</h3>\n<p>With <a href=\"https://developers.google.com/privacy-sandbox/3pcd/storage-access-api\">Storage Access API</a>, you can access the local storage in a third-party context through iframes, similar to when users visit it as a top-level site in a first-party context. That is, it gives access to unpartitioned cookies and storage.</p>\n<p>Storage Access API requires explicit user approval to grant access, similar to locations, camera, and microphone permissions. If the user denies access, unpartitioned cookies and storage won’t be accessible in a third-party context.</p>\n<p>It is most suitable when loading cross-site resources and interactions, such as:</p>\n<p>Verifying user sessions when allowing interactions on an embedded social post or providing personalization for an embedded video.\nEmbedded documents requiring user verification status to be accessible.</p>\n<p>As it requires explicit user approval, it is advisable to use Storage Access API when you can’t implement an identity use case with the other options.</p>\n<h3 id=\"related-website-sets\" style=\"position:relative;\"><a href=\"#related-website-sets\" aria-label=\"related website sets permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Related Website Sets</h3>\n<p>With <a href=\"https://developers.google.com/privacy-sandbox/3pcd/related-website-sets\">Related Website Sets</a>, you can declare a <code>primary</code> website and <code>associatedSites</code> for limited purposes to grant third-party cookie access and local storage for a limited number of sites.</p>\n<p>Chrome automatically recognizes related website sets declared, accepted, and maintained in this open-source GitHub repository: <a href=\"https://github.com/GoogleChrome/related-website-sets\">Related Website Sets</a></p>\n<p>It provides access through Storage Access API directly without prompting for user approval, but only after the user interacts with the relevant iframe.</p>\n<p>It is important to declare a limited number of domains in related website sets that are meaningful and used for specific purposes. Google may block or suspend any exploitative use of this feature.</p>\n<p>The top-level site can also request approval for specific cross-site resources and scripts to Storage Access API using <code>resuestStorageAccessFor()</code> API.</p>\n<p>If you’re using an external identity provider for your web application, you can declare the domain of the identity provider in the related set to ensure limited third-party cookies and storage access to the identity provider, thus ensuring seamless user authentication.</p>\n<p>Related Website Sets can also work to supplement third-party cookie restrictions in web SSO and federated SSO if the number of web applications (or domains) is limited.</p>\n<h3 id=\"federated-credential-management-fedcm-api\" style=\"position:relative;\"><a href=\"#federated-credential-management-fedcm-api\" aria-label=\"federated credential management fedcm api permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Federated Credential Management (FedCM) API</h3>\n<p>FedCM API enables federated SSO without third-party cookies.</p>\n<p>With FedCM API, a user follows these steps for authentication:</p>\n<ol>\n<li>The User navigates to a Service Provider (SP) — aka., Relying Party (RP)</li>\n<li>As the user requests to authenticate, the SP requests the browser through FedCM API to initiate authentication.</li>\n<li>The browser displays a list of available identity providers (supported by the RP), such as social IdPs like Google, Apple, LinkedIn, and Facebook, or other OAuth IdPs like LoginRadius.</li>\n<li>Once the user selects an IdP, the browser communicates with the IdP. Upon valid authentication, the IdP generates a secure token.\nThe browser delivers this secure token to the RP to facilitate user authorization.</li>\n</ol>\n<p>You can access a user demo of FedCM here: <a href=\"https://fedcm-rp-demo.glitch.me/\">FedCM</a>. </p>\n<p>For more information about implementing federated SSO with FedCM API, go through the <a href=\"https://developers.google.com/privacy-sandbox/3pcd/fedcm-developer-guide\">FedCM developer guide</a>.</p>\n<h2 id=\"how-is-loginradius-preparing-for-the-third-party-cookie-phase-out\" style=\"position:relative;\"><a href=\"#how-is-loginradius-preparing-for-the-third-party-cookie-phase-out\" aria-label=\"how is loginradius preparing for the third party cookie phase out permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How is LoginRadius Preparing for the Third-party Cookie Phase-out?</h2>\n<p>Firstly, we’re committed to solving our customers' user identity pain points — and preparing for the third-party cookies phase-out is no different.</p>\n<p>We’ll implement the most relevant and widely useful solutions to facilitate a smooth transition for our customers.</p>\n<p>Please subscribe to our blog for more information. We’ll update you on how we help with the third-party cookie phase-out.</p>\n<h2 id=\"in-conclusion\" style=\"position:relative;\"><a href=\"#in-conclusion\" aria-label=\"in conclusion permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>In Conclusion</h2>\n<p>The proposed changes to phase out third-party cookies and suggested alternatives are evolving as Google has been actively collaborating and discussing changes with the border community.</p>\n<p>Moreover, browsers like Firefox, Safari, and Edge may approach restricting third-party cookies differently than Google does.</p>\n<p>From LoginRadius, we’ll keep you updated on what we’re doing as a leading Customer Identity and Access Management (CIAM) vendor to prepare for the third-party cookie phase-out.</p>\n<h2 id=\"glossary\" style=\"position:relative;\"><a href=\"#glossary\" aria-label=\"glossary permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Glossary</h2>\n<p><strong>Top-level site</strong>: It is the primary site a user has visited.</p>\n<p><strong>First-party cookie</strong>: A cookie set by the top-level site.</p>\n<p><strong>Third-party cookie</strong>: A cookie set by a domain other than the top-level site. For example, let’s assume that a user has visited <code>a.com</code>, which might use an embed from <code>loginradius.com</code> to facilitate authentication. If <code>loginradius.com</code> sets a cookie when the user visits <code>a.com</code>, it is called a third-party cookie as the user hasn’t directly visited <code>loginradius.com</code>.</p>\n<h2 id=\"references\" style=\"position:relative;\"><a href=\"#references\" aria-label=\"references permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>References</h2>\n<ul>\n<li><a href=\"https://developers.google.com/privacy-sandbox/3pcd/prepare/prepare-for-phaseout\">Changes to Chrome's treatment of third-party cookies</a></li>\n<li><a href=\"https://developers.google.com/privacy-sandbox/3pcd/guides/identity\">Check the impact of the third-party cookie changes on your sign-in workflows</a></li>\n</ul>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","frontmatter":{"date":"July 08, 2024","updated_date":null,"description":"Google Chrome has planned to phase out third-party cookies, which will affect different website functionalities depending on third-party cookies. This blog focuses on how this phase-out affects identity and user authentication and discusses alternatives for overcoming challenges.","title":"How Chrome’s Third-Party Cookie Restrictions Affect User Authentication?","tags":["Identity","Cookies","Chrome"],"pinned":null,"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/eb7396060c0adc430dbed2d04b63d431/ee604/third-party-cookies-phaseout-chrome.png","srcSet":"/static/eb7396060c0adc430dbed2d04b63d431/69585/third-party-cookies-phaseout-chrome.png 200w,\n/static/eb7396060c0adc430dbed2d04b63d431/497c6/third-party-cookies-phaseout-chrome.png 400w,\n/static/eb7396060c0adc430dbed2d04b63d431/ee604/third-party-cookies-phaseout-chrome.png 800w,\n/static/eb7396060c0adc430dbed2d04b63d431/f3583/third-party-cookies-phaseout-chrome.png 1200w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Raghunath Reddy","github":"raghunath-r-a","avatar":null}}}},"pageContext":{"limit":6,"skip":150,"currentPage":26,"type":"//engineering//","numPages":52,"pinned":"17fa0d7b-34c8-51c4-b047-df5e2bbaeedb"}},"staticQueryHashes":["1171199041","1384082988","2100481360","23180105","528864852"]}