<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[FSVDR's Blog RSS]]></title><description><![CDATA[My name is Fernando Saavedra, I'm a front end developer based in Mexico City. I make websites and apps that express uniqueness through design, interactivity and accessibility.]]></description><link>https://fsvdr.me</link><generator>GatsbyJS</generator><lastBuildDate>Mon, 19 Jun 2023 17:55:59 GMT</lastBuildDate><item><title><![CDATA[Search items that match query]]></title><description><![CDATA[A nifty one-liner to filter data by a search query based on multiple fields]]></description><link>https://fsvdr.me/search-items-that-match-query</link><guid isPermaLink="false">https://fsvdr.me/search-items-that-match-query</guid><pubDate>Fri, 23 Oct 2020 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;TL;DR&lt;/h2&gt;
&lt;pre class=&quot;grvsc-container horizon&quot; data-language=&quot;js&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk9&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;items&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; [&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;/* some items */&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk9&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;itemsThatAreCool&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;items&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk5&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mtk7 mtki&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;mtk5&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;mtk5&quot;&gt;includes&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;cool&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Right? Let&apos;s examine this beauty with an example ⬇️&lt;/p&gt;
&lt;h2&gt;Too Long; Read Anyway&lt;/h2&gt;
&lt;p&gt;Imagine you&apos;re working with the following data:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container horizon&quot; data-language=&quot;js&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk9&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phones&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; [&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;iphone-12&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;iPhone 12&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;cameras&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;Ultra Wide&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;Wide&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;5G. A14 Bionic. All‑new design. Ceramic Shield. Edge‑to‑edge OLED display. Night mode on every camera. All in two perfect sizes — including the new iPhone 12 mini.&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  }&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;iphone-12-pro&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;iPhone 12 Pro&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;cameras&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;Ultra Wide&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;Wide&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;Telephoto&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;5G. A14 Bionic. All‑new design. Ceramic Shield. LiDAR Scanner. A Pro camera system optimized for low light — and pushed even further on iPhone 12 Pro Max.&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  }&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;iphone-11&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;iPhone 11&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;cameras&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;Ultra Wide&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;Wide&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;A new dual‑camera system captures more of what you see and love. The fastest chip ever in a smartphone and all‑day battery life let you do more and charge less. And the highest‑quality video in a smartphone, so your memories look better than ever.&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  }&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;iphone-xr&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;iPhone XR&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;cameras&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; [&lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;Wide&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;All-screen design. Longest battery life ever in an iPhone. Fastest performance. Water and splash resistant. Studio-quality photos and 4K video. More secure with Face ID. The new iPhone XR. It’s a brilliant upgrade.&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  }&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now let&apos;s say you want user&apos;s to be able to search for phones by name, you&apos;d do something like this&lt;/p&gt;
&lt;pre class=&quot;grvsc-container horizon&quot; data-language=&quot;js&quot; data-index=&quot;2&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk9&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phones&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; [&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;/* Same as above */&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk9&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;searchQuery&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;12&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk9&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phonesFilteredByName&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phones&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk5&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mtk7 mtki&quot;&gt;phone&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phone&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk5&quot;&gt;includes&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;searchQuery&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Nice, but what if later on you want users to also be able to search based on the phone&apos;s description? Do you add another condition for the return? That would get messy fast as you add lookup fields, right?&lt;/p&gt;
&lt;p&gt;How about we compose a string with all the fields we want to lookup?&lt;/p&gt;
&lt;pre class=&quot;grvsc-container horizon&quot; data-language=&quot;js&quot; data-index=&quot;3&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk9&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phones&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; [&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;/* Same as above */&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk9&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;searchQuery&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;iPhone&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk9&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phonesFilteredByNameAndDescription&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phones&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk5&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mtk7 mtki&quot;&gt;phone&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phone&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phone&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk5&quot;&gt;includes&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;searchQuery&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Better, but having to type the &lt;code&gt;${}&lt;/code&gt; every time we add a field can be troublesome, what if it&apos;s late, we haven&apos;t slept and for some reason we forget to put a field inside &lt;code&gt;${}&lt;/code&gt; then we&apos;ll also be matching the word &apos;phone&apos; and &apos;whatever field we intended to look for&apos;. Not to mention that we&apos;d eventually end up with a very long string that gets hard to read and could potentially lead to hours of debugging, JavaScript isn&apos;t gonna yell at us, as far as it is concerned, everything is fine.&lt;/p&gt;
&lt;p&gt;So, a nicer syntax would be something like this&lt;/p&gt;
&lt;pre class=&quot;grvsc-container horizon&quot; data-language=&quot;js&quot; data-index=&quot;4&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk9&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phones&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; [&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;/* Same as above */&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk9&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;searchQuery&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;iPhone&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk9&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phonesFilteredByNameAndDescription&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phones&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk5&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mtk7 mtki&quot;&gt;phone&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  [&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phone&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phone&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;mtk5&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;mtk5&quot;&gt;includes&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;searchQuery&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;No we don&apos;t have to worry about wrapping each field in &lt;code&gt;${}&lt;/code&gt;, we just add it to an array, straightforward. Then every field will be joined to a string into which we can lookup for the search query!&lt;/p&gt;
&lt;p&gt;I think this is nicer because we now have dependency array we can easily modify to fit our needs.&lt;/p&gt;
&lt;p&gt;Let&apos;s say we want to include the cameras array into our lookup, how do we do that?&lt;/p&gt;
&lt;pre class=&quot;grvsc-container horizon&quot; data-language=&quot;js&quot; data-index=&quot;5&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk9&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phones&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; [&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;/* Same as above */&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk9&quot;&gt;let&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;searchQuery&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;Telephoto&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk9&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phonesFilteredByNameDescriptionAndCameras&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phones&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk5&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mtk7 mtki&quot;&gt;phone&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  [&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phone&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phone&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;phone&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;cameras&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;mtk5&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;mtk5&quot;&gt;includes&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;searchQuery&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Nice! Now the cameras will be part of our lookup string. One last thing to note here is that &lt;code&gt;String.includes&lt;/code&gt; is case sensitive so it might me good to through in a &lt;code&gt;String.toLowerCase&lt;/code&gt; both to the lookup string and search query 🙃&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .horizon { background-color: #1C1E26; }
  .horizon .mtki { font-style: italic; }
  .horizon .mtk9 { color: #B877DBE6; }
  .horizon .mtk1 { color: #D5D8DA; }
  .horizon .mtk7 { color: #E95678E6; }
  .horizon .mtk10 { color: #BBBBBB; }
  .horizon .mtk3 { color: #BBBBBB4D; }
  .horizon .mtk5 { color: #25B0BCE6; }
  .horizon .mtk8 { color: #FAB795E6; }
  .horizon .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[How to calculate travel distance and time]]></title><description><![CDATA[Google Maps. Right? Let's go with Google Maps and call it a day. Cool? NO. Not this time pal, let me show you just how much you're missing out on Mapbox. The cool kid in town.]]></description><link>https://fsvdr.me/how-to-calculate-travel-distance-and-time</link><guid isPermaLink="false">https://fsvdr.me/how-to-calculate-travel-distance-and-time</guid><pubDate>Mon, 14 Sep 2020 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;Making a case for Mapbox&lt;/h2&gt;
&lt;p&gt;Let me just say... it is no fun working with Google Maps APIs. I&apos;m sorry, don&apos;t @ me it might be just me but the burden of working with anything Google is enough to make me roll my eyes and want to cuddle my bed pillow till the weekend.&lt;/p&gt;
&lt;p&gt;Fortunately the Internet is a big place and there are other players in town (yes there are, just... google or even better &lt;a href=&quot;https://duckduckgo.com&quot;&gt;duckduckgo&lt;/a&gt; them).&lt;/p&gt;
&lt;p&gt;And when it comes to maps I&apos;ve found that &lt;a href=&quot;https://mapbox.com&quot;&gt;Mapbox&lt;/a&gt; is &lt;strong&gt;the&lt;/strong&gt; alternative. Not only is it really easy to get started but they also have a very &lt;strong&gt;&lt;a href=&quot;https://www.mapbox.com/pricing/&quot;&gt;generous free tier&lt;/a&gt;&lt;/strong&gt; for most of their services unlike (&lt;em&gt;cof cof&lt;/em&gt; you know who).&lt;/p&gt;
&lt;p&gt;Enough rambling, you&apos;re here for the code so let&apos;s get to it ...&lt;/p&gt;
&lt;h2&gt;Creating an account&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;You can skip this step if you already have an account 🙃&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;First of you&apos;re going to need a Mapbox account before we do anything so head over to their &lt;a href=&quot;https://account.mapbox.com/auth/signup/&quot;&gt;signup page&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Once you do that you&apos;ll receive an email to confirm your account click the big blue button and just like that you&apos;ll be ready to start coding 🎉&lt;/p&gt;
&lt;p&gt;If everything went right you should be looking at the dashboard, it&apos;s a pretty simple UI and if you look closer you&apos;ll see that Mapbox has already created a default access token for us!&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;gatsby-resp-image-figure&quot; style=&quot;
                margin-block-start: 4rem;
                margin-block-end: 4rem;
              &quot;&gt;
    &lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 800px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/5d914c5dff1749b0750b1dc0bc100292/cc42b/mapbox-dashboard.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 71.50000000000001%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAOCAIAAACgpqunAAAACXBIWXMAAAsSAAALEgHS3X78AAACcklEQVQoz32S20tUURTG/Yt6EYIw6aV68CEs7I5EEPiQL6P4UmNeZsY0a4geJIK0sgjREooeBiskTBCrkegCReg0jXM7Z87Z57Lvl9aZmcQg2qyHs2H91vetb5+W8YnJy4OJ/oErQyOTqavp8Yn0jfStZGoikRyHSo01K5Ecg8744BDU8OjYyGhqOJFsMcYQZpQyO4dr/sH7uO5srFnZpVw2s/l+ufDJxhh6pNZCKcwNE1EnwPrLprjzhN1drNdTPrUQDj3IxWdy1+a3vlby3+0CVEApCojl+kJqGCGV5lJHynMZ0XpKdFwUh3vEoR5x8IJq7zZ7OvXxmJFChV4guIS2YqX2q2RRLgNiMDNSRcrm2bI4cF509MpjfeLsgD7aT0/Ewq5Y4dwlxw9lvuhyEbl0vbBiIy8gAeZUgP8/8L5u3naanOkj8dnNroevrmczA0uZkXs5jI3rG62jDR0vzBer+VK1UkNMqAas51+KvSeDzkS2/fHttunp/TMLrSuxI6vp+2s/tDBeqJUGXvshraHACymMArKpvP6ZLy6xd/bWzY3Vmdfb09/ePNp6u7KBFl6QkIh6wAKcWyjcrtQqtkPrshEMWUgF+XFFpaEwaufR4ENhqn4WZaGsCFOQtu36DvJdL4CoG7CG9H0fF0rVfLGMCQMRyhXjkdV8SU/NqdnnAvnacrxqzQOY7VIGWIWYlKt21XZqDrJs10EKcnIQtp2QcclF/aksVLZcqZsLN2EuFWXcRb7nBwx6pXQ9Vb/6jFG4Um7AHQg23P4Ngw0hMaFeECA/wIRYDrMdGAWysEQkq5Tecbsbhh9Vmv8e/S8YVH8DKWvceE6GNeoAAAAASUVORK5CYII=&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Mapbox Dashboard&quot;
        title=&quot;— Mapbox Dashboard&quot;
        src=&quot;/static/5d914c5dff1749b0750b1dc0bc100292/5a190/mapbox-dashboard.png&quot;
        srcset=&quot;/static/5d914c5dff1749b0750b1dc0bc100292/772e8/mapbox-dashboard.png 200w,
/static/5d914c5dff1749b0750b1dc0bc100292/e17e5/mapbox-dashboard.png 400w,
/static/5d914c5dff1749b0750b1dc0bc100292/5a190/mapbox-dashboard.png 800w,
/static/5d914c5dff1749b0750b1dc0bc100292/c1b63/mapbox-dashboard.png 1200w,
/static/5d914c5dff1749b0750b1dc0bc100292/29007/mapbox-dashboard.png 1600w,
/static/5d914c5dff1749b0750b1dc0bc100292/cc42b/mapbox-dashboard.png 2597w&quot;
        sizes=&quot;(max-width: 800px) 100vw, 800px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;figcaption class=&quot;gatsby-resp-image-figcaption&quot;&gt;— Mapbox Dashboard&lt;/figcaption&gt;
  &lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Good stuff. We could plug this token right into our app and everything would work just fine.&lt;/p&gt;
&lt;h2&gt;The Navigation Service&lt;/h2&gt;
&lt;p&gt;Now, the service we need to calculate the travel distance between geographical points is the &lt;a href=&quot;https://docs.mapbox.com/api/navigation/&quot;&gt;Navigation Service&lt;/a&gt;, specifically we care about the &lt;em&gt;Matrix API&lt;/em&gt; which defined by their own documentation:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The Mapbox Matrix API returns travel times between many points.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So if we pass 3 geographical points to it, say A, B and C the API will return us a &lt;del&gt;matrix&lt;/del&gt; table with each and every travel combination between these points so we get the travel time from A to A, A to B, A to C, B to A, B to B and so on ...&lt;/p&gt;
&lt;p&gt;Here&apos;s the table I &lt;del&gt;stole&lt;/del&gt; borrowed from their documentation which helps me visualize this &lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;gatsby-resp-image-figure&quot; style=&quot;
                margin-block-start: 4rem;
                margin-block-end: 4rem;
              &quot;&gt;
    &lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 800px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/a4f9a881494d4870ce6342bba3d1550a/5bd27/navigation-matrix.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 30%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAIAAABM9SnKAAAACXBIWXMAAAsSAAALEgHS3X78AAAAoElEQVQY01WOWRLDIAxDuf9dOyUFW16A1qnTJPXo4zGyJQp0kPhd9QXCDqyjNmxd+LcT3HGsQb2QWO6demy9sQbAZu14Nj6t2riRJEdrMbO11vs2Zi6qyWNMFvEx8qnmEEuecxWGuM+gU50BSECMqrVOEZcWsTBLcuQW/RrRfSoOQsnuA6Kxd1l2WHuzanzqr1nEGEd8HBMhmiM+LcjV/AHGVGAZA30gNwAAAABJRU5ErkJggg==&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Navigation Matrix&quot;
        title=&quot;— Navigation Matrix&quot;
        src=&quot;/static/a4f9a881494d4870ce6342bba3d1550a/5a190/navigation-matrix.png&quot;
        srcset=&quot;/static/a4f9a881494d4870ce6342bba3d1550a/772e8/navigation-matrix.png 200w,
/static/a4f9a881494d4870ce6342bba3d1550a/e17e5/navigation-matrix.png 400w,
/static/a4f9a881494d4870ce6342bba3d1550a/5a190/navigation-matrix.png 800w,
/static/a4f9a881494d4870ce6342bba3d1550a/c1b63/navigation-matrix.png 1200w,
/static/a4f9a881494d4870ce6342bba3d1550a/5bd27/navigation-matrix.png 1432w&quot;
        sizes=&quot;(max-width: 800px) 100vw, 800px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;figcaption class=&quot;gatsby-resp-image-figcaption&quot;&gt;— Navigation Matrix&lt;/figcaption&gt;
  &lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Aren&apos;t we getting duplicated travels here? Isn&apos;t A to B the same as B to A? Well no, turns out the API is smart enough to understand that the path you took from A to B isn&apos;t necessarily going to be the same path you take on your way back cause... you know, lanes and/or traffic as we&apos;ll see in a bit.&lt;/p&gt;
&lt;h2&gt;The Code Dammit!&lt;/h2&gt;
&lt;p&gt;Ok so the way we interact with this API is through a &lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;0&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;GET&lt;/span&gt;&lt;/code&gt; HTTP request to &lt;code class=&quot;inline-code horizon&quot; data-language=&quot;html&quot; data-index=&quot;1&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; https://api.mapbox.com/directions-matrix/v1/{profile}/{coordinates}&lt;/span&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Where &lt;code&gt;profile&lt;/code&gt; is one of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;2&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;mapbox&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;driving&lt;/span&gt;&lt;/code&gt; - if you prefer to drive 🚗&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;3&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;mapbox&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;walking&lt;/span&gt;&lt;/code&gt; - if you prefer to walk 🚶‍♂️&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;4&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;mapbox&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;cycling&lt;/span&gt;&lt;/code&gt; - if you prefer to bike 🚲&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;5&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;mapbox&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;driving&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;traffic&lt;/span&gt;&lt;/code&gt; - if you prefer to drive and you care about the traffic ⭐&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And where &lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;6&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;coordinates&lt;/span&gt;&lt;/code&gt; is a list of &lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;7&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;longitude&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;latitude&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;}&lt;/span&gt;&lt;/code&gt; each separated by a semicolon (&lt;code&gt;;&lt;/code&gt;). You can pass a minimum of two and a maximum of 25 if you&apos;re a busy person...&lt;/p&gt;
&lt;p&gt;Note that it is &lt;strong&gt;longitude&lt;/strong&gt; &lt;em&gt;then&lt;/em&gt; &lt;strong&gt;latitude&lt;/strong&gt; and not the other way around otherwise it&apos;s not going to work and you&apos;ll be sad 🙁.&lt;/p&gt;
&lt;p&gt;So far I&apos;ve delivered you the travel time between points but this post is about time &lt;em&gt;and&lt;/em&gt; distance so let&apos;s keep rolling.&lt;/p&gt;
&lt;p&gt;Another parameter we can pass to our HTTP request is &lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;8&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;annotations&lt;/span&gt;&lt;/code&gt; this tells the API what sort of matrix are we interested in and the possible values are &lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;9&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;duration&lt;/span&gt;&lt;/code&gt; for travel times (this is the default), &lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;10&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;distance&lt;/span&gt;&lt;/code&gt; for travel distances or you can use both values separated by a comma (,).&lt;/p&gt;
&lt;p&gt;One other parameter you might want to use is &lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;11&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;approaches&lt;/span&gt;&lt;/code&gt;. See by default the travel that gets calculated doesn&apos;t care about lanes so it could be from either side of the road. Because driving on the wrong side of the lane is considered cheating, we can set its value to &lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;12&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;curb&lt;/span&gt;&lt;/code&gt; to indicate that we want to care about arriving on the right side of the road. One important thing to notice is that we need to provide a value for each geographical point so if we want to calculate the travels between three points we would pass &lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;13&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;approaches&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;curb&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;curb&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;curb&lt;/span&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;With all this we have a fine request of the shape: &lt;code class=&quot;inline-code horizon&quot; data-language=&quot;html&quot; data-index=&quot;14&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; https://api.mapbox.com/directions-matrix/v1/mapbox/driving-traffic/{coordinates}?annotations=duration,distance&amp;amp;approaches=curb;curb&lt;/span&gt;&lt;/code&gt;. But you know what we&apos;re missing? &lt;del&gt;Some tunes for the ride&lt;/del&gt; Our access token.&lt;/p&gt;
&lt;h2&gt;Authenticating our request&lt;/h2&gt;
&lt;p&gt;We can&apos;t just go around sending random requests without some sort of authentication, that&apos;s what our access token from the dashboard comes in handy. &lt;/p&gt;
&lt;p&gt;For the sake of this tutorial we&apos;ll stick to the default token Mapbox generated for us but when moving to real world production apps &lt;strong&gt;you should create specific tokens for each different project&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;You&apos;ll also probably want to put your token in an &lt;a href=&quot;https://www.twilio.com/blog/2017/08/working-with-environment-variables-in-node-js.html&quot;&gt;environment variable&lt;/a&gt; before using it in your code because we don&apos;t want it to be lying around for other people to grab it and make requests on our behalf.&lt;/p&gt;
&lt;p&gt;Now that it&apos;s all safe to use, add an &lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;15&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;access_token&lt;/span&gt;&lt;/code&gt; parameter to the request with your access token as the value (if using environment variables, which again you should you would access it with &lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;16&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;process&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;env&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;THE_NAME_OF_YOUR_VARIABLE&lt;/span&gt;&lt;/code&gt;).&lt;/p&gt;
&lt;h2&gt;Request and you shall receive&lt;/h2&gt;
&lt;p&gt;Assuming you&apos;re making this request from Node.js you could create a fetch call by plugging in some random coordinates:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container horizon&quot; data-language=&quot;js&quot; data-index=&quot;0&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk9&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;fetch&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk5&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;isomorphic-fetch&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;); &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;// In order to use fetch&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk9&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;origin&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; { &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;lat&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk4&quot;&gt;19.3896346&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;lng&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mtk4&quot;&gt;99.2486547&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; };&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk9&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;destination&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; { &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;lat&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk4&quot;&gt;20.8443792&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;lng&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mtk4&quot;&gt;101.2292119&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; };&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk9&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;await&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk5&quot;&gt;fetch&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;// Mapbox endpoint&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;https://api.mapbox.com/&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;// The navigation matrix endpoint (not sure why it says directions here)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;directions-matrix/v1/&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;// Get there by car and get there fast&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;mapbox/driving-traffic/&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;// Our colon separated list of coordinates (remember LONGITUDE then LATITUDE)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;// we&amp;#39;re using two points here but remember you can use up to 25&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;origin&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;lng&lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;origin&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;lat&lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;destination&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;lng&lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;destination&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;lat&lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;// We want duration and distance please&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;?annotations=duration,distance&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;// We follow the law and drive on the right lane&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;#39;&amp;amp;approaches=curb;curb&amp;#39;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;// Our secret token hidden from curious eyes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;`access_token=&lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;process&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;env&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;ACCESS_TOKEN&lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;`&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;mtk5&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mtk7 mtki&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk9&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk5&quot;&gt;json&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;());&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If everything goes right we should now have a response object with a couple properties of which we&apos;ll use:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;17&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;code&lt;/span&gt;&lt;/code&gt; - The status code of the response (hopefully 200)&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;18&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;durations&lt;/span&gt;&lt;/code&gt; - The travel durations matrix&lt;/li&gt;
&lt;li&gt;&lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;19&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;distances&lt;/span&gt;&lt;/code&gt; - The travel distances matrix&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For this specific request we would get the following structures:&lt;/p&gt;
&lt;pre class=&quot;grvsc-container horizon&quot; data-language=&quot;js&quot; data-index=&quot;1&quot;&gt;&lt;code class=&quot;grvsc-code&quot;&gt;&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk6&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk5&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;durations&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk10&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;quot;durations&amp;quot;&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; [&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;// These are durations from point A&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;      [&lt;/span&gt;&lt;span class=&quot;mtk4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk4&quot;&gt;15360.4&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;// to point [A, B]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;// These are durations from point B&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;      [&lt;/span&gt;&lt;span class=&quot;mtk4&quot;&gt;14886.3&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;// to point [A, B]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    ]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk6&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk5&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;distances&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk10&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;mtk8&quot;&gt;&amp;quot;distances&amp;quot;&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; [&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;// These are distances from point A&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;      [&lt;/span&gt;&lt;span class=&quot;mtk4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk4&quot;&gt;345994&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;// to point [A, B]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;      &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;// These are distances from point A&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;      [&lt;/span&gt;&lt;span class=&quot;mtk4&quot;&gt;357204.4&lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk4&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;mtk1&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;mtk3 mtki&quot;&gt;// to point [A, B]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;    ]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;grvsc-line&quot;&gt;&lt;span class=&quot;grvsc-source&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that the values are in seconds and meters respectively and that in each case the travel between a point and itself will always be 0. If no route is found between some given points the value will be &lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;20&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk4&quot;&gt;null&lt;/span&gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Also note that the exact values might change since we&apos;re considering traffic and well, it might be different when you check.&lt;/p&gt;
&lt;p&gt;And so we got the travel distance and time between our origin and destination points 🎉&lt;/p&gt;
&lt;p&gt;If you want to read more about the differences between Google Maps and Mapbox I recommend you &lt;a href=&quot;https://madappgang.com/blog/mapbox-vs-google-maps-choosing-a-map-for-your-app&quot;&gt;this article&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;See you next time folks! 👋&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .horizon { background-color: #1C1E26; }
  .horizon .mtki { font-style: italic; }
  .horizon .mtk9 { color: #B877DBE6; }
  .horizon .mtk1 { color: #D5D8DA; }
  .horizon .mtk7 { color: #E95678E6; }
  .horizon .mtk10 { color: #BBBBBB; }
  .horizon .mtk5 { color: #25B0BCE6; }
  .horizon .mtk8 { color: #FAB795E6; }
  .horizon .mtk3 { color: #BBBBBB4D; }
  .horizon .mtk4 { color: #F09483E6; }
  .horizon .mtk6 { color: #FAC29AE6; }
  .horizon .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[The making of: This site]]></title><description><![CDATA[The design, the stack, the decisions! All the good stuff and a peak at what's still to come...]]></description><link>https://fsvdr.me/the-making-of-this-site</link><guid isPermaLink="false">https://fsvdr.me/the-making-of-this-site</guid><pubDate>Sun, 16 Aug 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;We&apos;re back folks! And this time I bring all the goodies behind the development of this site, just as I promised in the last post! I gotta say tho, I thought I&apos;d give up with this blog after the release hype so the fact that I&apos;m still writing this is... uhm... &lt;em&gt;pretty neat&lt;/em&gt; 👌.&lt;/p&gt;
&lt;h2&gt;But maaa, it has too look great!&lt;/h2&gt;
&lt;p&gt;Honestly I think the reason I kept pushing this site down the line is that I focused — nay, &lt;strong&gt;obsessed&lt;/strong&gt; too much over the design. I wanted it to be unique, modern, playful, stylish, minimalist, brutalist, full of animations, text-over-white simple! &lt;strong&gt;UUUUUGHHH&lt;/strong&gt; the possibilities burden!&lt;/p&gt;
&lt;p&gt;Which is why early on this year, when I opened that dusty Sketch file with all the previous design iterations in it, I took a minute to see if I happened to still liked one. Could I stick to one of those designs and sget it through the finish line? 😃&lt;/p&gt;
&lt;p&gt;No, I thought I could... but couldn&apos;t. &lt;strong&gt;But this time!&lt;/strong&gt; This time I would do things right, and stick to it. I opened Dribbble, Twitter, Pinterest and every other portfolio/blog that I had liked and kept for future reference.&lt;/p&gt;
&lt;p&gt;Over my years in college I would often help designing flyers and posters for events — I liked that, good times. It&apos;s with these small projects that I felt most creative so I figured I could try designing my site as a series of posters. Focusing heavily on typography and content would keep me out of thinking too much about colors, backgrounds and images which had been huge blockers for me in the past.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;gatsby-resp-image-figure&quot; style=&quot;
                margin-block-start: 4rem;
                margin-block-end: 4rem;
              &quot;&gt;
    &lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 792px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/776b7bbac4deaef7de09edb694f7e55c/9a86a/poster-based-design.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 154.50000000000003%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAfCAYAAADnTu3OAAAACXBIWXMAAAsSAAALEgHS3X78AAAGB0lEQVRIx61WW1NTVxhNQu4hd3JPyI3EJCThUgiERLkIAcNFLhFQbBBFLiKCpoCi1CoFdexQdbTFS6oy6kyH4lv7wLRPdfrSh9bp/zmre5+gmaJOO1Mfvtk5+5yzzre/b631hcPhcECDx+OxUVBQwK5cLvft3u57u58nzzI7OHTNAf7PYCQSCUjkAGUyGQYHBzE8PIy5uTmMj4+jpqYGvb29GBkZQTqdxuTkJMbGxnDmzBmEw2G0t7ejL5Vir81mMyMQCKBQKHKASqUSN2/exPr6OjY2NtiHKioqcOXKFTx58gQ3btzA8tWrePlyC9euXUckEiG/X+L66gqWlpagUCrZDJXKHUA+nw+xWAyhUAipVPq2TiaTGUU6NSKxPYgnQtDbTXC5LSgpcaJIq4FFLkbUqkWsuIhpDtgRdZlzgCRV9ou3b9/G/fv3cffuXTbTV69+I8dP4+bXX+D3P/9AS18U0f1epA61oqk5hoBNhz1FciScOuZQeQl6y0tygDQzWrNEIoFkMonOzk7E43F0tnehKh7GwOkujJ8eRSQeQGmVDY2JMJIdUbTuDaHYoIFBJmY+3RfGbE95DpCe/8iRIxgdHWWbQ5vQ3d2NxvpGtKfaMXJhCJmFCSyvXEYmk8HC4hIOp7tRHrLA5TBBpVIyEbsenSFbDlCv12N+fh63bt3CgwcPsLm5iex3WWQfZbHx4ik2th7hx+1NPHmRxbOn3+L7jae4+vkSgqVW8q4cKrmc2V9hwNEuYw6QNsFoNMJms0Eul6OwsBBCkRD8AgGsbiPqkmFEWm2IJYIExICIvxgVPi/8PhssFhXUUhHTn/RjJOVjOJTphEeYmprC6uoqnj9/jrq6OmSzWbhcbrg9TuxrrUJHqgb1LWWIRstQGy2F121HwGOF06qCViJkTGoZ6kpNDMfhcBB6EDq4XKiqqkJ/fz9LXFpTNwFUaOQIhB2orfHC67PCVWyFm9TNZNTBbFBDXiiCmMdjpPwC+E2Eh7QhVLdarZYluEgkQlFR0VtZFSqlsDu1kAiIjslLdJXyOagmlCnRyiEq4ELML2BkZN+lkeVqSAF9Ph8CgQC8XlIbvx8GgyEHKJcQQD00Gg255kLE48DgcaMu7ENFqQdKrRoComU+lwhBKsibA1UK1SNdaZY0+HxyXShAecSC6lgxtEYJVOSYhmgjdJF90MVb4WyKw6ArYIxEORVuW77LHo+HzTIYDLIZBkoDCIXCCJX5cKA7hqZkOaLNe5DuaUBHWwKO2nqIveR+2I3DPbXM6qUFzB4fymdIM6KuQ7VMO5/TtwQO0oTDgz1w+Sww2pUo91sw0LYPvcdGMTR+GidHjuJ4fx8zMzmBzMxMXnrT09NoaGjA3r17MTAwwFrYiROjZH8Cp06dwOLFi1i8tIj9rU0wG6VIdbVhbjaDs+fOY2r6LJP57DzmFpbyfri1tYVnz56xFra2tsb+Zs3iwTomJkexvf0LXr/+C+fOzUJB6mqUc1EfLIabSC7VVMnMjh1BZXUob1+UMmq1Gm63m+203W6HzVqMQMiL+uZKTEwfw7GpFC4uL6PtQBLRKj96EjEkW2oxnT7IzIz2YSTdlQNUqVS4c+cOHj9+zNrWysoK7n1zD18uX8NXa4vY/vUHXLw6j8Ur4/jp5yyebz7Ew0dreEE0nTl+GB1RP5PqacTwWEPebahChoaGWMunTpMi9p5oaUP/0EFcPk/r2Y79zdWYvzCJgfQBdPTGcHIygcGOOIJOFeP3W1FZa//3IcUTc+ANm2GySqE18GFx6eEIGlHTqMUnMQX0NgE0Bi5TWmpGWbktD0jrSIOSm6WNgE8UxINUIYbFXwSViUjSKobZpYav0oY6AljiU8HpUUFvEjLWYhVcHu0OIJEeNQhqX1arlViShV2dTgdbXwnho1QiZYMygl6LhHRPBpm0EFwO7925LCKZiXYG1ZtBvzPE/9Nc/gcgl45S8mU1MQBKnzdT7018EJT7AcCP8c/hHUBq+4WEPu97Qa/TQUFOsHtfR2aRhpzovYB0NlOlvA+QNkZLyrH76LQ8qg8Bfqwj/w3teJxl0NCLDwAAAABJRU5ErkJggg==&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Poster based design of the landing page&quot;
        title=&quot;— Reminds me of a movie poster, or something&quot;
        src=&quot;/static/776b7bbac4deaef7de09edb694f7e55c/9a86a/poster-based-design.png&quot;
        srcset=&quot;/static/776b7bbac4deaef7de09edb694f7e55c/772e8/poster-based-design.png 200w,
/static/776b7bbac4deaef7de09edb694f7e55c/e17e5/poster-based-design.png 400w,
/static/776b7bbac4deaef7de09edb694f7e55c/9a86a/poster-based-design.png 792w&quot;
        sizes=&quot;(max-width: 792px) 100vw, 792px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;figcaption class=&quot;gatsby-resp-image-figcaption&quot;&gt;— Reminds me of a movie poster, or something&lt;/figcaption&gt;
  &lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;I figured &quot;I don&apos;t really have much to say so I&apos;ll make text real big and bold to fill all that space 🙂&quot;. And I think it did the trick!&lt;/p&gt;
&lt;p&gt;Once I felt confident with the direction of the first poster the rest of the site came easier, I don&apos;t usually design every single screen/state combination of a website — I&apos;m too impatient for it tbh. So I kept going with the landing page and the first part of the about page with this poster-design approach and at some point the visual language became clear enough so that I could move to the code and let the rest of the site to align to it.&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;gatsby-resp-image-figure&quot; style=&quot;
                margin-block-start: 4rem;
                margin-block-end: 4rem;
              &quot;&gt;
    &lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 800px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/cceaf2488a9e8421cbade6b16893ce6f/5a190/visual-language.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 111.99999999999999%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAWCAIAAABPIytRAAAACXBIWXMAAAsSAAALEgHS3X78AAAD20lEQVQ4y4VTSU9iaRR9iLaliBPgwwl5+LCU6QGCIjYzj0EeasFDWrujXVZDt3ZSlVibbhNXJhpXXcZx5RBNrf0bJiautBzikKg4xYULE5d9LDvGrqTtu7j5Hh/n3nPPuR8xOTnpdDoTXXGPz+Gymjo4rtlmc7vdBoNBoVDYbDaNRuNwOKRSqVar5Tiup6entbWVIIjV1VVidm6W46Lp3/v5rnCoVffzT0m9gTGbTCUlJZWVlcFgMBQKJRIJq9VqNps9Hg8y6ubk5CwvLxOzs7NKJUWrayhaYTRoenu6Q+FwnI8rlcpyudzlcqFtS0tLXl6e0WhUq9UymayoqAidl5aWiKmpKa/Xm/71XSzePpju7+3tJhvkRqeR9bbYTHXR9s4P799jLmAArqqqkkgkj+CHztPT01aL9Q0fbY+7u+L+rh/eFNUXVLyW6l5Tbnuz3d5aX19fWFgoEonAvLi4GLCsrCzklZUVAoLhJBQKkaFKW1v4O3GOTC4lZbLaWrqiouLpFqOiCg4CgQB5cXGRmJ+fBysI43F7eJ4fGvro8/q4CAfB8Tk8PJxKpQYGBtLp9MjISDgchgo+nw9CrK2tEQGWlZMk+IjFYr1en0wmX+W9KisrKygoaGpqurm5ubu7u729vb+/39/fh4rwr6amBlNALCIUDGoaGmppOj8/nyTJSCQCh8rLy1EOCgFwenp6fHx8cXGxvr6OX2A18KA9MTFBgIBOp4MZKpUKDUEMYIyHQpDq4ODg/Pz85OTk+vp6Y2PDYrGwLEvTNMDj4+OEyWSCe7AeGVX8fj8usrOzkUHy6OjoEXx1dbW5uQnBIDU443ZsbIzAYOgAZG5ubnV1dXcyKRQIhF/B6PANGHYAifwPbYZhsGvE15BKJLFY7MkbzHZ4ePgcjD174jU6Okr09fVZrNbGxkYjwwQCbCqdApHm5iaGMXS0d0CqTCYDzS4vL7e2tmCS3W6HW/j/w3ouLCxQCoVWq6NptZ4xt3NRFUVpNfqqakWM59H27FlkngU+iZmZGY1GG/Xbf4k52mwVUY5lGOPbpPudV/+BD2Uy/wJ/E8T83Nz3LneKj3zs8/8WqUvEoywb+mOwbeJt3ec/f8ycZV4Cz8xM03UNCdZUo6KKpCReGKM38E6jrZkaGoidnp2/gMarmioQl/ocVCdb2csZwn4nKSf7o2ax0uzpTDzO9p/gT5/+yhLm1KvKQk3Fg6FaV4slXyQya8hikSAY8L6IPXt4VdhKSkVJSiWVVQo2EMCeqtV1JSWlUY77n85wcnt7+8v2l52dnb3dXbyE3d3dvb09HLDYZy/G3x9jF8p/hLovAAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Some of the other posters that helped define the visual language&quot;
        title=&quot;— Enough posters to understand the visual language&quot;
        src=&quot;/static/cceaf2488a9e8421cbade6b16893ce6f/5a190/visual-language.png&quot;
        srcset=&quot;/static/cceaf2488a9e8421cbade6b16893ce6f/772e8/visual-language.png 200w,
/static/cceaf2488a9e8421cbade6b16893ce6f/e17e5/visual-language.png 400w,
/static/cceaf2488a9e8421cbade6b16893ce6f/5a190/visual-language.png 800w&quot;
        sizes=&quot;(max-width: 800px) 100vw, 800px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;figcaption class=&quot;gatsby-resp-image-figcaption&quot;&gt;— Enough posters to understand the visual language&lt;/figcaption&gt;
  &lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Now of course this ain&apos;t a legit design process, in terms of design I identify with this guy&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;gatsby-resp-image-figure&quot; style=&quot;
                margin-block-start: 4rem;
                margin-block-end: 4rem;
              &quot;&gt;
    &lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 800px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/2e7819c5a7f2efa8ed20187f1678a5f3/906b5/office-dog.png&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 66.5%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAANCAIAAAAmMtkJAAAACXBIWXMAAAsSAAALEgHS3X78AAADJElEQVQozwEZA+b8APj5+n14d2FXUYmEgsHCxbGztebp7Pr5+r67uIB6dTsyLoZ7ca6nnq2po8LBwNLPy8/R1PLz9f///+Pj4wDk5ulvaWhsY12QjYu/wMWytLfs7/L7+/vAvruAenU/NjKKgnmwqqK0sayysbHIx8S+wMLx8vP////j4+MAzdHWUExKeXBpoJyYx8fIvby3zMjF4N3axsO+f3p1PzgzioN7trKsc3FuU0tDWVJLISEgYF5d6+vr4uLiALi3t4WAeqqkmLmzqL25r7m1rKylm8S6s8fFwnt3c0E5NY6HgLu4tXd1c3NoWi8kGwMAAAAAAMHAv/b29gCkn5Suq6OsqaGsqqOsqaOzsKqmoZqQjo+uqqtsZGA7NjJ+eHG8urminpyAb2B7a1lNPi1RSUOlo6KUlJUAn5uSoJ2VpqKar6ukr6ukuravg4B6TExPmYuGbF5US0E7U0M6npyax8PCqJaJopaDxr+xwr23IyIiFRMTAHlyapuViquon6qnn6uooLazqXRvakQ+O0U6My0mImpbVYJiU5qRjbi5u+Pd05qJdcvBs+3l2FlWUg8ODgBKQ0FSSEOLgXanopevrKSvq6OakouQiYZWTksqJydnYFyNeG2Dd3J4bmvTxK+FcmGjmYjv5tV3c24CAQEAHxwbExERRT42ZV5YnJeOqaWbe3dza2djc21rcm5wgIGGmpiaf3hzh3xytamWc2ZcjIZ9zsa3t7KqIR8eALCrorCpnGhgUy8tLnRuaFJOSS4sKjc2NFFMSVtWUo6Hfbywn6Wcjnx3cHNuaHFsZoF7dNrOud/WyWxrcAD68eH15MqunYNFQjxtaGB+eXGBfneUkIimo5rLxbvVzb7Vzb7Qy8Lc1crk28vj2svTxrPQvqPa1cm9u7YAz8a12Miuwq6NpJ6SpqKaqKWcqqafqaWdq6efqqWduLWv3trS497U4tvQ8efX9erZ6t7M0ce229bM3trQAMrDttbLucS0mo2JgZKOiJWRip6ak6ejmrezqcS/tL25sr+7s7Gtp66ro9LMwOLay+HazeTe0tzWy9bRx9voyT+vdeLjAAAAAElFTkSuQmCC&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Dog wearing a tie sitting in front of a vintage computer&quot;
        title=&quot;— This me while &amp;quot;designing&amp;quot;&quot;
        src=&quot;/static/2e7819c5a7f2efa8ed20187f1678a5f3/5a190/office-dog.png&quot;
        srcset=&quot;/static/2e7819c5a7f2efa8ed20187f1678a5f3/772e8/office-dog.png 200w,
/static/2e7819c5a7f2efa8ed20187f1678a5f3/e17e5/office-dog.png 400w,
/static/2e7819c5a7f2efa8ed20187f1678a5f3/5a190/office-dog.png 800w,
/static/2e7819c5a7f2efa8ed20187f1678a5f3/906b5/office-dog.png 950w&quot;
        sizes=&quot;(max-width: 800px) 100vw, 800px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;figcaption class=&quot;gatsby-resp-image-figcaption&quot;&gt;— This me while &amp;quot;designing&amp;quot;&lt;/figcaption&gt;
  &lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;but hey, one can dream! And also, I think it didn&apos;t turn too bad if I may weight in. 🤓&lt;/p&gt;
&lt;h2&gt;The JAMstack&lt;/h2&gt;
&lt;p&gt;With the very first version of this site back in 2015 (maybe?) I went all in with vanilla JS, vanilla CSS and of course vanilla HTML — again, good times. But of course over the time the web became... a bit more complex than that.&lt;/p&gt;
&lt;p&gt;The prior version to this (which was just a pretty work-in-progress notice) was running on pretty much the same stack except with the addition of PostCSS and my custom go-to ITCSS base styling.&lt;/p&gt;
&lt;p&gt;This time I knew I wanted to go with Gatsby from day one. I wouldn&apos;t need a server at all, all my pages would be, well... pages and I was definitely going to avoid configuring a build tool or any kind of tooling at all for the sake of getting lost on the process. So the ease of use, performance optimizations and focus on accessibility that Gatsby provides out of the box was a no-brainer for me.&lt;/p&gt;
&lt;p&gt;The one thing I did change halfway in was using Styled Components instead of my ITCSS-PostCSS styles. I didn&apos;t like how decoupled things felt having HTML and JavaScript already in well, JavaScript. Also, making that circular text &quot;badge&quot; you can see next to the title of this post was soooo cool and easy with Styled Components.&lt;/p&gt;
&lt;p&gt;Finally, for this blog I didn&apos;t felt like using an external CMS would be too much overkill, I could get by with plain Markdown files for the posts (at least for now). Hopefully once &lt;a href=&quot;https://github.com/features/codespaces&quot;&gt;GitHub Codespaces&lt;/a&gt; is out it&apos;ll be even easier to create posts on the go!&lt;/p&gt;
&lt;h2&gt;Netlify ecosystem and the serverless hype&lt;/h2&gt;
&lt;p&gt;Where do you host a Gatsby site? Well, anywhere really but I think Gatsby+Netlify is a popular choice nowadays.&lt;/p&gt;
&lt;p&gt;Netlify&apos;s free tier along with their &lt;a href=&quot;https://docs.netlify.com/configure-builds/build-plugins&quot;&gt;Build Plugins&lt;/a&gt; and simplified serverless functions were enough to bring me on board.&lt;/p&gt;
&lt;p&gt;In order to boost the SEO of my site I used &lt;code&gt;gatsby-plugin-feed&lt;/code&gt; to create an RSS feed of the blog and &lt;code&gt;gatsby-plugin-sitemap&lt;/code&gt; and &lt;code&gt;netlify-plugin-submit-sitemap&lt;/code&gt; to create a sitemap and submit it to search engines.&lt;/p&gt;
&lt;p&gt;Now, I&apos;ve never really dived into serverless mostly because my whole concept of it sums up to a mental image of the AWS&apos;s console which... let&apos;s be honest looks daunting to newcomers. But then I heard &lt;a href=&quot;https://syntax.fm/show/247/hasty-treat-wes-new-personal-website&quot;&gt;this Syntax.fm episode&lt;/a&gt; where Wes Bos describes his new website and how he used Netlify [serverless] functions to query social media data and generate Twitter and Open Graph images.&lt;/p&gt;
&lt;p&gt;It seemed quite straightforward and I was definitely sold on the idea of automatically generated social images so that I wouldn&apos;t have to worry about that 👍&lt;/p&gt;
&lt;h2&gt;It doesn&apos;t need to be perfect...&lt;/h2&gt;
&lt;p&gt;There&apos;s still a couple of things I have planned for the site but I knew that if I waited for those I would never release this thing. So, couple of things I&apos;m looking forward:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Using &lt;a href=&quot;https://plausible.io/&quot;&gt;Plausible&apos;s privacy-friendly analytics&lt;/a&gt; — Because I would like to know how my site is performing but I&apos;m also privacy aware — cheers 🍻&lt;/li&gt;
&lt;li&gt;Adding i11n support — So that I can have the site in spanish as well as english and it still makes sense to search engines.&lt;/li&gt;
&lt;li&gt;Using &lt;a href=&quot;https://tinacms.org/&quot;&gt;TinaCMS&lt;/a&gt; — I&apos;d like to be able to change the Spotify songs in the &lt;code class=&quot;inline-code horizon&quot; data-language=&quot;javascript&quot; data-index=&quot;0&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;about&lt;/span&gt;&lt;/code&gt; page and other details without having to open the code but I don&apos;t really need a full-blown CMS...&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Overall I&apos;m quite happy with how things turned out here and I learned a lot in the process. It was &lt;strong&gt;hard&lt;/strong&gt; to push myself through the finish line, I had to keep reminding me that web development is a never ending process, if you wait till everything is in place and perfect you&apos;ll most likely end up pushing things down the line for 5 years.&lt;/p&gt;
&lt;p&gt;Anyhow, that&apos;s it, that&apos;s all I&apos;ve got! If you&apos;re curious about the actual code you can check it out &lt;a href=&quot;https://github.com/fsvdr/dot-me&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Till next time, folks! 👋&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .horizon { background-color: #1C1E26; }
  .horizon .mtk1 { color: #D5D8DA; }
  .horizon .mtk10 { color: #BBBBBB; }
  .horizon .mtk7 { color: #E95678E6; }
  .horizon .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[It's here! Finally.]]></title><description><![CDATA[I've just been soooo busy lately. I need to redesign it first, it feels outdated already. I know, I know... Soon™. NO. No more — its finally here.]]></description><link>https://fsvdr.me/its-here-finally</link><guid isPermaLink="false">https://fsvdr.me/its-here-finally</guid><pubDate>Sat, 08 Aug 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;First of... welcome 😏 whoever you are, whenever you&apos;re reading. It&apos;s taken too long for this website to exist so it&apos;s nice to have someone hanging around — cheers 🍻.&lt;/p&gt;
&lt;p&gt;Do people normally click other people&apos;s website linked on their Twitter bio and look around even though you&apos;re not looking for something specific? I do, in fact a while back I even had a &lt;em&gt;lists&lt;/em&gt; (the Twitter kind, not like a sociopath&apos;s list of names) specifically for people&apos;s whose websites I found to be cool.&lt;/p&gt;
&lt;p&gt;I mean I like websites... that&apos;s sort of what I do for a living. And I&apos;ve always wanted one of my own, don&apos;t really knew why at the moment, it&apos;s not like I was looking for a job or anything at the beginning but anyhow, the point is that that it&apos;s been a push-down-the-line kind of a project for what? over 5 years now? 6?&lt;/p&gt;
&lt;p&gt;And boy did I had some ideas along the road...&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;gatsby-resp-image-figure&quot; style=&quot;
                margin-block-start: 4rem;
                margin-block-end: 4rem;
              &quot;&gt;
    &lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 800px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/2bd6f58cdeeb5a3f4284cc87ea0a4c54/72e01/fsvdr-v1.jpg&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 55.00000000000001%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAALABQDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAYCBAX/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIQAxAAAAHOsMEhdGIP/8QAGhAAAgMBAQAAAAAAAAAAAAAAAAEDEhMCEf/aAAgBAQABBQKvNnykURhF7lGZRn//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAZEAACAwEAAAAAAAAAAAAAAAAAARESMhD/2gAIAQEABj8CrPZojKMo/8QAGhAAAgMBAQAAAAAAAAAAAAAAAAERUfFBkf/aAAgBAQABPyFRWaRcvOCCw7gyjKP/2gAMAwEAAgADAAAAEPPP/8QAFREBAQAAAAAAAAAAAAAAAAAAARD/2gAIAQMBAT8QGf/EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8QP//EABsQAAICAwEAAAAAAAAAAAAAAAERADEQIVGR/9oACAEBAAE/ENyMGHKKD4t2JsskwA8OuWYxv//Z&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Website attempt #1 Unsplash photo on the background with white text over it. Colorful, playful&quot;
        title=&quot;— I believe this one I actually coded at some point 🤔&quot;
        src=&quot;/static/2bd6f58cdeeb5a3f4284cc87ea0a4c54/4b190/fsvdr-v1.jpg&quot;
        srcset=&quot;/static/2bd6f58cdeeb5a3f4284cc87ea0a4c54/e07e9/fsvdr-v1.jpg 200w,
/static/2bd6f58cdeeb5a3f4284cc87ea0a4c54/066f9/fsvdr-v1.jpg 400w,
/static/2bd6f58cdeeb5a3f4284cc87ea0a4c54/4b190/fsvdr-v1.jpg 800w,
/static/2bd6f58cdeeb5a3f4284cc87ea0a4c54/72e01/fsvdr-v1.jpg 1024w&quot;
        sizes=&quot;(max-width: 800px) 100vw, 800px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;figcaption class=&quot;gatsby-resp-image-figcaption&quot;&gt;— I believe this one I actually coded at some point 🤔&lt;/figcaption&gt;
  &lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;gatsby-resp-image-figure&quot; style=&quot;
                margin-block-start: 4rem;
                margin-block-end: 4rem;
              &quot;&gt;
    &lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 800px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/7a4c8f97b3229158d68dff8c37b07816/72e01/fsvdr-v2.jpg&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 66.5%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAANABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAMEBf/EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhADEAAAAceyFokA/8QAGRAAAwADAAAAAAAAAAAAAAAAAAESEBMh/9oACAEBAAEFAkiFeNnT/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAGBABAQADAAAAAAAAAAAAAAAAARAAERL/2gAIAQEABj8CwODVGf/EABkQAAMBAQEAAAAAAAAAAAAAAAABETEhcf/aAAgBAQABPyGgtEkvR6xOFKXqNP/aAAwDAQACAAMAAAAQC+//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/ED//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/ED//xAAbEAEBAQACAwAAAAAAAAAAAAABEQAhUTFBYf/aAAgBAQABPxA3yzAS9h9qcvnGF0uWopfuIJRCVjCXLS9t3//Z&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Website attempt #2 Darker Unsplash photo on the background, black and white selfie and grid-shaped letters&quot;
        title=&quot;— Don&amp;#39;t really know where I was going with this...&quot;
        src=&quot;/static/7a4c8f97b3229158d68dff8c37b07816/4b190/fsvdr-v2.jpg&quot;
        srcset=&quot;/static/7a4c8f97b3229158d68dff8c37b07816/e07e9/fsvdr-v2.jpg 200w,
/static/7a4c8f97b3229158d68dff8c37b07816/066f9/fsvdr-v2.jpg 400w,
/static/7a4c8f97b3229158d68dff8c37b07816/4b190/fsvdr-v2.jpg 800w,
/static/7a4c8f97b3229158d68dff8c37b07816/72e01/fsvdr-v2.jpg 1024w&quot;
        sizes=&quot;(max-width: 800px) 100vw, 800px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;figcaption class=&quot;gatsby-resp-image-figcaption&quot;&gt;— Don&amp;#39;t really know where I was going with this...&lt;/figcaption&gt;
  &lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;gatsby-resp-image-figure&quot; style=&quot;
                margin-block-start: 4rem;
                margin-block-end: 4rem;
              &quot;&gt;
    &lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 800px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/fb3d5f5b416bf13f83d14a48015cc8d1/72e01/fsvdr-v3.jpg&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 66%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAANABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAQFAQL/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIQAxAAAAFxyXYOzQ//xAAaEAACAgMAAAAAAAAAAAAAAAACAwEhABAi/9oACAEBAAEFAmG2HdRo7eFjn//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8BP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8BP//EABoQAAICAwAAAAAAAAAAAAAAAAABEBECMTL/2gAIAQEABj8CrHk3Cdij/8QAHBAAAQQDAQAAAAAAAAAAAAAAAQARMUEQIVFx/9oACAEBAAE/IWzUqUBVPqEIS4dmETruP//aAAwDAQACAAMAAAAQcA//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/ED//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/ED//xAAcEAEBAAICAwAAAAAAAAAAAAABEQAxIZEQUWH/2gAIAQEAAT8QGEKEih2j7OesjQo6ezrFQ4mBAUfMrJyL4//Z&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Website attempt #3 Keep it simple, big black and white selfie, black bold name&quot;
        title=&quot;— Back to the basics... but went to a bit too boring&quot;
        src=&quot;/static/fb3d5f5b416bf13f83d14a48015cc8d1/4b190/fsvdr-v3.jpg&quot;
        srcset=&quot;/static/fb3d5f5b416bf13f83d14a48015cc8d1/e07e9/fsvdr-v3.jpg 200w,
/static/fb3d5f5b416bf13f83d14a48015cc8d1/066f9/fsvdr-v3.jpg 400w,
/static/fb3d5f5b416bf13f83d14a48015cc8d1/4b190/fsvdr-v3.jpg 800w,
/static/fb3d5f5b416bf13f83d14a48015cc8d1/72e01/fsvdr-v3.jpg 1024w&quot;
        sizes=&quot;(max-width: 800px) 100vw, 800px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;figcaption class=&quot;gatsby-resp-image-figcaption&quot;&gt;— Back to the basics... but went to a bit too boring&lt;/figcaption&gt;
  &lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;gatsby-resp-image-figure&quot; style=&quot;
                margin-block-start: 4rem;
                margin-block-end: 4rem;
              &quot;&gt;
    &lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 800px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/4d664bc0e8f5b9a849bcf43ae17c34cf/72e01/fsvdr-v4.jpg&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 66.5%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAANABQDASIAAhEBAxEB/8QAFwAAAwEAAAAAAAAAAAAAAAAAAAECBf/EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhADEAAAAdtUigD/xAAXEAEBAQEAAAAAAAAAAAAAAAAAARAR/9oACAEBAAEFAnU2P//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8BP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8BP//EABYQAAMAAAAAAAAAAAAAAAAAAAAgQf/aAAgBAQAGPwIq/wD/xAAbEAACAQUAAAAAAAAAAAAAAAAAASEQETFBUf/aAAgBAQABPyFtrrNIGElhKj//2gAMAwEAAgADAAAAEBPP/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPxA//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPxA//8QAHRABAAMAAQUAAAAAAAAAAAAAAQARITFBYYGhsf/aAAgBAQABPxC9QC+DmDUeWvsba3WbVvXIltvqDHsz/9k=&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Website attempt #4 Weirder, black bold uppercase name and letters around in different depths using blur&quot;
        title=&quot;— ... I mean... looks kind of cool&quot;
        src=&quot;/static/4d664bc0e8f5b9a849bcf43ae17c34cf/4b190/fsvdr-v4.jpg&quot;
        srcset=&quot;/static/4d664bc0e8f5b9a849bcf43ae17c34cf/e07e9/fsvdr-v4.jpg 200w,
/static/4d664bc0e8f5b9a849bcf43ae17c34cf/066f9/fsvdr-v4.jpg 400w,
/static/4d664bc0e8f5b9a849bcf43ae17c34cf/4b190/fsvdr-v4.jpg 800w,
/static/4d664bc0e8f5b9a849bcf43ae17c34cf/72e01/fsvdr-v4.jpg 1024w&quot;
        sizes=&quot;(max-width: 800px) 100vw, 800px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;figcaption class=&quot;gatsby-resp-image-figcaption&quot;&gt;— ... I mean... looks kind of cool&lt;/figcaption&gt;
  &lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;gatsby-resp-image-figure&quot; style=&quot;
                margin-block-start: 4rem;
                margin-block-end: 4rem;
              &quot;&gt;
    &lt;span
      class=&quot;gatsby-resp-image-wrapper&quot;
      style=&quot;position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 800px; &quot;
    &gt;
      &lt;a
    class=&quot;gatsby-resp-image-link&quot;
    href=&quot;/static/75c897195ef83b764fae43ad4fc91297/72e01/fsvdr-v5.jpg&quot;
    style=&quot;display: block&quot;
    target=&quot;_blank&quot;
    rel=&quot;noopener&quot;
  &gt;
    &lt;span
    class=&quot;gatsby-resp-image-background-image&quot;
    style=&quot;padding-bottom: 61.5%; position: relative; bottom: 0; left: 0; background-image: url(&apos;data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAAMABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAQACBf/EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhADEAAAAeE5QmP/xAAWEAEBAQAAAAAAAAAAAAAAAAABECD/2gAIAQEAAQUCMM//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/AT//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAUEAEAAAAAAAAAAAAAAAAAAAAg/9oACAEBAAY/Al//xAAcEAEAAgEFAAAAAAAAAAAAAAABABEQIUFhcZH/2gAIAQEAAT8hF7h3E5PZrgVCf//aAAwDAQACAAMAAAAQI8//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAEDAQE/ED//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/ED//xAAbEAEAAgMBAQAAAAAAAAAAAAABABEhMXFRgf/aAAgBAQABPxBUv2KlRh+bQRgWuzaHsB4mk//Z&apos;); background-size: cover; display: block;&quot;
  &gt;&lt;/span&gt;
  &lt;img
        class=&quot;gatsby-resp-image-image&quot;
        alt=&quot;Website attempt #4 Almost there, background darker image with two-headed me and white text over. Colorful shapes floating around&quot;
        title=&quot;— Not bad actually but never got past the work-in-progress phase&quot;
        src=&quot;/static/75c897195ef83b764fae43ad4fc91297/4b190/fsvdr-v5.jpg&quot;
        srcset=&quot;/static/75c897195ef83b764fae43ad4fc91297/e07e9/fsvdr-v5.jpg 200w,
/static/75c897195ef83b764fae43ad4fc91297/066f9/fsvdr-v5.jpg 400w,
/static/75c897195ef83b764fae43ad4fc91297/4b190/fsvdr-v5.jpg 800w,
/static/75c897195ef83b764fae43ad4fc91297/72e01/fsvdr-v5.jpg 1024w&quot;
        sizes=&quot;(max-width: 800px) 100vw, 800px&quot;
        style=&quot;width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;&quot;
        loading=&quot;lazy&quot;
      /&gt;
  &lt;/a&gt;
    &lt;/span&gt;
    &lt;figcaption class=&quot;gatsby-resp-image-figcaption&quot;&gt;— Not bad actually but never got past the work-in-progress phase&lt;/figcaption&gt;
  &lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Which brings us to this year&lt;/h2&gt;
&lt;p&gt;It&apos;s been almost 2 years now since I graduated from college and a bit more since I began my &lt;em&gt;professional&lt;/em&gt; career as a web developer so I figured it was time for me to put myself out there.&lt;/p&gt;
&lt;p&gt;Wether I&apos;d like to move another job or start doing some side freelancing I&apos;d need to have a website/portfolio to showcase my work, it was time. No more procrastinating on it.&lt;/p&gt;
&lt;p&gt;Sure it still took me a couple of months to get this out — 6 months (!) according to the git history of the repo. But considering that I did this as side work from my real job during a pandemic and that it went through one and a half redesigns in that time frame...I&apos;m quite happy with it and even more that it&apos;s finally out in the wild!&lt;/p&gt;
&lt;p&gt;So, I was really hoping for this very first post to be about the technical implementation of the site, y&apos;know all the good stuff. But I think I went too off topic now so I decided to leave that for the &lt;strong&gt;next&lt;/strong&gt; one!&lt;/p&gt;
&lt;p&gt;Gotta fill that &lt;code class=&quot;inline-code horizon&quot; data-language=&quot;js&quot; data-index=&quot;0&quot;&gt;&lt;span class=&quot;mtk1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mtk10&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mtk7&quot;&gt;blog&lt;/span&gt;&lt;/code&gt; page somehow ¯\&lt;em&gt;(ツ)&lt;/em&gt;/¯&lt;/p&gt;
&lt;p&gt;Till next time, folks 👋&lt;/p&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
  .horizon { background-color: #1C1E26; }
  .horizon .mtk1 { color: #D5D8DA; }
  .horizon .mtk10 { color: #BBBBBB; }
  .horizon .mtk7 { color: #E95678E6; }
  .horizon .grvsc-line-highlighted::before {
    background-color: var(--grvsc-line-highlighted-background-color, rgba(255, 255, 255, 0.1));
    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, rgba(255, 255, 255, 0.5));
  }
&lt;/style&gt;</content:encoded></item><item><title><![CDATA[A year in TV series]]></title><description><![CDATA[I like to keep track of what I watch, don't @ me]]></description><link>https://fsvdr.me/a-year-in-series</link><guid isPermaLink="false">https://fsvdr.me/a-year-in-series</guid><pubDate>Wed, 01 Jan 2020 00:00:00 GMT</pubDate><content:encoded>&lt;ol&gt;
&lt;li&gt;Supernatural S11&lt;/li&gt;
&lt;li&gt;Mad Men S7&lt;/li&gt;
&lt;li&gt;Lost in Space S2&lt;/li&gt;
&lt;li&gt;Supernatural S12&lt;/li&gt;
&lt;li&gt;Sex Education S2&lt;/li&gt;
&lt;li&gt;Pequeñas Coincidencias&lt;/li&gt;
&lt;li&gt;Pequeñas Coincidencias S2&lt;/li&gt;
&lt;li&gt;The Morning Show&lt;/li&gt;
&lt;li&gt;Truth Be Told&lt;/li&gt;
&lt;li&gt;The Stranger&lt;/li&gt;
&lt;li&gt;Supernatural S13&lt;/li&gt;
&lt;li&gt;Narcos: México S2&lt;/li&gt;
&lt;li&gt;Servant&lt;/li&gt;
&lt;li&gt;Hunters&lt;/li&gt;
&lt;li&gt;I’m not okay with this&lt;/li&gt;
&lt;li&gt;This is Us S3&lt;/li&gt;
&lt;li&gt;The Handmaids Tale S3&lt;/li&gt;
&lt;li&gt;The office&lt;/li&gt;
&lt;li&gt;The office S2&lt;/li&gt;
&lt;li&gt;The office S3&lt;/li&gt;
&lt;li&gt;Supernatural S14&lt;/li&gt;
&lt;li&gt;The office S4&lt;/li&gt;
&lt;li&gt;Danny Phantom&lt;/li&gt;
&lt;li&gt;Luis Miguel: La Serie&lt;/li&gt;
&lt;li&gt;Ozark S3&lt;/li&gt;
&lt;li&gt;La casa de papel&lt;/li&gt;
&lt;li&gt;The office S5&lt;/li&gt;
&lt;li&gt;The office S6&lt;/li&gt;
&lt;li&gt;Danny Phantom S2&lt;/li&gt;
&lt;li&gt;Better call Saul S5&lt;/li&gt;
&lt;li&gt;La casa de papel S2&lt;/li&gt;
&lt;li&gt;The office S7&lt;/li&gt;
&lt;li&gt;La casa de papel S3&lt;/li&gt;
&lt;li&gt;The office S8&lt;/li&gt;
&lt;li&gt;Trying&lt;/li&gt;
&lt;li&gt;Defending Jacob&lt;/li&gt;
&lt;li&gt;The office S9&lt;/li&gt;
&lt;li&gt;La casa de papel S4&lt;/li&gt;
&lt;li&gt;Danny Phantom S3&lt;/li&gt;
&lt;li&gt;Killing Eve&lt;/li&gt;
&lt;li&gt;Upload&lt;/li&gt;
&lt;li&gt;Tales from the Loop&lt;/li&gt;
&lt;li&gt;Little Fires Everywhere&lt;/li&gt;
&lt;li&gt;Modern Family&lt;/li&gt;
&lt;li&gt;Modern Family S2&lt;/li&gt;
&lt;li&gt;The Walking Dead S9&lt;/li&gt;
&lt;li&gt;Modern Family S3&lt;/li&gt;
&lt;li&gt;Modern Family S4&lt;/li&gt;
&lt;li&gt;Modern Family S5&lt;/li&gt;
&lt;li&gt;Il Processo&lt;/li&gt;
&lt;li&gt;Recursos Inhumanos&lt;/li&gt;
&lt;li&gt;Killing Eve S2&lt;/li&gt;
&lt;li&gt;Billions S1&lt;/li&gt;
&lt;li&gt;Billions S2&lt;/li&gt;
&lt;li&gt;Historia de un crimen: La Búsqueda&lt;/li&gt;
&lt;li&gt;Modern Family S6&lt;/li&gt;
&lt;li&gt;Modern Family S7&lt;/li&gt;
&lt;li&gt;The Sinner S3&lt;/li&gt;
&lt;li&gt;Billions S3&lt;/li&gt;
&lt;li&gt;Historia de un crimen: Colmenares&lt;/li&gt;
&lt;li&gt;Modern Family S8&lt;/li&gt;
&lt;li&gt;Shark Tank México S3&lt;/li&gt;
&lt;li&gt;El pantano&lt;/li&gt;
&lt;li&gt;Modern Family S9&lt;/li&gt;
&lt;li&gt;Shark Tank México S4&lt;/li&gt;
&lt;li&gt;Unsolved mysteries&lt;/li&gt;
&lt;li&gt;Oscuro Deseo&lt;/li&gt;
&lt;li&gt;Dark S3&lt;/li&gt;
&lt;li&gt;Billions S4&lt;/li&gt;
&lt;li&gt;Modern Family S10&lt;/li&gt;
&lt;li&gt;La Jauria&lt;/li&gt;
&lt;li&gt;Legion S3&lt;/li&gt;
&lt;li&gt;Seinfeld&lt;/li&gt;
&lt;li&gt;Seinfeld S2&lt;/li&gt;
&lt;li&gt;Seinfeld S3&lt;/li&gt;
&lt;li&gt;Killing Eve S3&lt;/li&gt;
&lt;li&gt;The Umbrella Academy S2&lt;/li&gt;
&lt;li&gt;Seinfeld S4&lt;/li&gt;
&lt;li&gt;Billions S5&lt;/li&gt;
&lt;li&gt;Dirty John: Betty Broderick&lt;/li&gt;
&lt;li&gt;Seinfeld S5&lt;/li&gt;
&lt;li&gt;Seinfeld S6&lt;/li&gt;
&lt;li&gt;Seinfeld S7&lt;/li&gt;
&lt;li&gt;Stumptown&lt;/li&gt;
&lt;li&gt;Seinfeld S8&lt;/li&gt;
&lt;li&gt;Seinfeld S9&lt;/li&gt;
&lt;li&gt;Biohackers&lt;/li&gt;
&lt;li&gt;Shark Tank México S5&lt;/li&gt;
&lt;li&gt;Daredevil&lt;/li&gt;
&lt;/ol&gt;
&lt;style class=&quot;grvsc-styles&quot;&gt;
  .grvsc-container {
    overflow: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
    padding-top: 1rem;
    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));
    padding-bottom: 1rem;
    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));
    border-radius: 8px;
    border-radius: var(--grvsc-border-radius, 8px);
    font-feature-settings: normal;
    line-height: 1.4;
  }
  
  .grvsc-code {
    display: table;
  }
  
  .grvsc-line {
    display: table-row;
    box-sizing: border-box;
    width: 100%;
    position: relative;
  }
  
  .grvsc-line &gt; * {
    position: relative;
  }
  
  .grvsc-gutter-pad {
    display: table-cell;
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  .grvsc-gutter {
    display: table-cell;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter::before {
    content: attr(data-content);
  }
  
  .grvsc-source {
    display: table-cell;
    padding-left: 1.5rem;
    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));
    padding-right: 1.5rem;
    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));
  }
  
  .grvsc-source:empty::after {
    content: &apos; &apos;;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
  }
  
  .grvsc-gutter + .grvsc-source {
    padding-left: 0.75rem;
    padding-left: calc(var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem)) / 2);
  }
  
  /* Line transformer styles */
  
  .grvsc-has-line-highlighting &gt; .grvsc-code &gt; .grvsc-line::before {
    content: &apos; &apos;;
    position: absolute;
    width: 100%;
  }
  
  .grvsc-line-diff-add::before {
    background-color: var(--grvsc-line-diff-add-background-color, rgba(0, 255, 60, 0.2));
  }
  
  .grvsc-line-diff-del::before {
    background-color: var(--grvsc-line-diff-del-background-color, rgba(255, 0, 20, 0.2));
  }
  
  .grvsc-line-number {
    padding: 0 2px;
    text-align: right;
    opacity: 0.7;
  }
  
&lt;/style&gt;</content:encoded></item></channel></rss>