<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: tiff</title>
    <description>The latest articles on Forem by tiff (@tiffengineer).</description>
    <link>https://forem.com/tiffengineer</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F470%2F98634d6c-be26-477f-a7ab-3ff7cbf07984.jpeg</url>
      <title>Forem: tiff</title>
      <link>https://forem.com/tiffengineer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/tiffengineer"/>
    <language>en</language>
    <item>
      <title>Let's See Your Terminal</title>
      <dc:creator>tiff</dc:creator>
      <pubDate>Tue, 16 Apr 2024 20:56:34 +0000</pubDate>
      <link>https://forem.com/tiffengineer/lets-see-your-terminal-mgo</link>
      <guid>https://forem.com/tiffengineer/lets-see-your-terminal-mgo</guid>
      <description>&lt;p&gt;Since I've decided to pivot to another area of tech over the past two years, I returned here to DEV to clean out my over 1100+ Reading List articles and to follow new tags.&lt;/p&gt;

&lt;p&gt;While pruning, I came across this article:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/itsjzt" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F41065%2F2dde0a31-7a8a-4089-ab15-ffdf8192e082.jpg" alt="itsjzt"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/itsjzt/can-i-see-your-terminal--62e" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Can I see your terminal?&lt;/h2&gt;
      &lt;h3&gt;Saurabh Sharma ・ Feb 28 '18&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#discuss&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#windows&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#mac&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;This got me thinking about my recent pivot, my switch to &lt;a href="https://neovim.io/" rel="noopener noreferrer"&gt;Neovim&lt;/a&gt; by way of &lt;a href="https://www.lazyvim.org/" rel="noopener noreferrer"&gt;LazyVim&lt;/a&gt; to write most of my code, and using &lt;a href="https://github.com/tmux/tmux/wiki" rel="noopener noreferrer"&gt;tmux&lt;/a&gt; to keep terminal states alive after closing a session.&lt;/p&gt;

&lt;p&gt;I've tricked out my terminal with &lt;a href="https://iterm2.com/index.html" rel="noopener noreferrer"&gt;iTerm2&lt;/a&gt; being my editor of choice and seeing that old article made me want to share my terminal with the DEV Community.&lt;/p&gt;

&lt;p&gt;More on that at the end of the post.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where I've been
&lt;/h2&gt;

&lt;p&gt;It's been a long time. Life has not been easy. Like &lt;em&gt;at all&lt;/em&gt;. Landing and losing two jobs, my mother to dementia, the best therapist I've ever had, my mobility for a whole year after a severe leg injury, and the townhome I rented before our startup cut the non-essential devs from the roster, has worn on me mentally and emotionally, so much so I am not even sure how I am still here. I am currently couch surfing with an old school friend's mom and she's been kind enough to let me setup my computer, TV, PS5, and homelab setup in this tiny room I am in. I am forever grateful for this because if it wasn't for her, I would have been on the street for a year plus as no family here has or is willing to help me out with shelter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6qga8j4grijkcaogrx9q.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6qga8j4grijkcaogrx9q.jpeg" alt="My humble abode" width="800" height="529"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The room before I rearranged it for the 20th time this year&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Regardless, I have pivoted to cybersecurity. While I still build software, &lt;a href="https://www.tiffanywhite.dev/posts/final-thoughts" rel="noopener noreferrer"&gt;I am no longer interested in the frontend part of software development&lt;/a&gt; and am strictly working in VMs for pentesting and SOC analysis and using Python, Rust, and Go to build tools for red team projects.&lt;/p&gt;

&lt;p&gt;I also have a homelab stocked with used and new rack mounted NUCs, a TP-Link 24 port managed switch, a UniFi Dream Machine Pro Switch and AP, and some really old Raspberry Pis I bought a few years ago connected up to another old UPS unit till I move from here to the new place in a couple months.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmmbuw6u87juof5do4ywj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmmbuw6u87juof5do4ywj.jpg" alt="Homelab rack" width="800" height="1263"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;My server rack with all components mentioned above.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  You said something about a terminal, no?
&lt;/h2&gt;

&lt;p&gt;Yes! Here is mine. Share yours if you want to in the comments. Or don't. I'm not your dad.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F17v37xn1eckeivblwqet.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F17v37xn1eckeivblwqet.png" alt="LazyVim with open Neotree" width="800" height="451"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The linter I installed with mason.vim is really particular&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjvw8e9f5qcpo0clee98g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjvw8e9f5qcpo0clee98g.png" alt="LazyVim working on a DNS enumeration tool" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>neovim</category>
      <category>terminal</category>
      <category>lazyvim</category>
      <category>homelab</category>
    </item>
    <item>
      <title>Can I use RSpec without Rails?</title>
      <dc:creator>tiff</dc:creator>
      <pubDate>Thu, 29 Sep 2022 05:38:17 +0000</pubDate>
      <link>https://forem.com/tiffengineer/can-i-use-rspec-without-rails-32id</link>
      <guid>https://forem.com/tiffengineer/can-i-use-rspec-without-rails-32id</guid>
      <description>&lt;p&gt;📸 Photo by &lt;a href="https://unsplash.com/@joshuafuller?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Joshua Fuller&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/ruby?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am working on a &lt;a href="https://www.tiffanywhite.dev/2022/09/26/update-on-my-static-site-generator/" rel="noopener noreferrer"&gt;static site generator&lt;/a&gt; using just Ruby and a few gems.&lt;/p&gt;

&lt;p&gt;It seems that testing with RSpec is the way to go, however most tutorials or blog posts associate RSpec with Rails and I don't have, want, or need a Rails component to this; it's just a CLI tool.&lt;/p&gt;

&lt;p&gt;My question is can I use RSpec with a pure Ruby CLI tool or should I try something like Minitest instead?&lt;/p&gt;

&lt;p&gt;**Oh and maybe someone would be willing to take a look at what I've got?"&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/twhite96" rel="noopener noreferrer"&gt;
        twhite96
      &lt;/a&gt; / &lt;a href="https://github.com/twhite96/static-gen-ruby" rel="noopener noreferrer"&gt;
        static-gen-ruby
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A static site generator scaffold built with Ruby
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Static Gen&lt;/h1&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;A static site generator built with Ruby.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/5f022b1267b221ffedd3947de1eb8f703e7297d1748d4242ced91f3637f206ad/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6d6d69742d61637469766974792f6d2f74776869746539362f7374617469632d67656e2d727562793f636f6c6f723d253233656337666666267374796c653d666f722d7468652d6261646765"&gt;&lt;img src="https://camo.githubusercontent.com/5f022b1267b221ffedd3947de1eb8f703e7297d1748d4242ced91f3637f206ad/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6d6d69742d61637469766974792f6d2f74776869746539362f7374617469632d67656e2d727562793f636f6c6f723d253233656337666666267374796c653d666f722d7468652d6261646765" alt="GitHub commit activity"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/ebb55b16ab608672d9788f1793fe83595a71a2aedb0c6e8d716fb0f811f37943/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f74776869746539362f7374617469632d67656e2d727562793f636f6c6f723d253233313765396266267374796c653d666f722d7468652d6261646765"&gt;&lt;img src="https://camo.githubusercontent.com/ebb55b16ab608672d9788f1793fe83595a71a2aedb0c6e8d716fb0f811f37943/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f74776869746539362f7374617469632d67656e2d727562793f636f6c6f723d253233313765396266267374796c653d666f722d7468652d6261646765" alt="GitHub"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/aeaefe7fb3f5db7ffff167fe4d3a8022e88fa2890f225241ec42cdd9020b3d69/68747470733a2f2f696d672e736869656c64732e696f2f6d61696e74656e616e63652f7965732f323032323f636f6c6f723d253233663038303830267374796c653d666f722d7468652d6261646765"&gt;&lt;img src="https://camo.githubusercontent.com/aeaefe7fb3f5db7ffff167fe4d3a8022e88fa2890f225241ec42cdd9020b3d69/68747470733a2f2f696d672e736869656c64732e696f2f6d61696e74656e616e63652f7965732f323032323f636f6c6f723d253233663038303830267374796c653d666f722d7468652d6261646765" alt="Maintenance"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/37e7d3f46c6ae8f56ee569c6a007f3b21cab28059c71bf60f58633f9a70faf48/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d61646525323077697468253230527562792d7265643f7374796c653d666f722d7468652d6261646765266c6f676f3d72756279"&gt;&lt;img src="https://camo.githubusercontent.com/37e7d3f46c6ae8f56ee569c6a007f3b21cab28059c71bf60f58633f9a70faf48/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d61646525323077697468253230527562792d7265643f7374796c653d666f722d7468652d6261646765266c6f676f3d72756279" alt="Made with Ruby"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;How to use:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;🌀 Clone the repo at &lt;code&gt;https://github.com/twhite96/static-gen-ruby.git&lt;/code&gt; or with GitHub CLI &lt;code&gt;gh repo clone twhite96/static-gen-ruby&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;🏃 Run: &lt;code&gt;bundle&lt;/code&gt; to install dependencies.&lt;/li&gt;
&lt;li&gt;🎊 Have fun with it.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Motivation for this app&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;I wanted to show that I could build something, even if it was small, on my own, with little guidance.&lt;/p&gt;
&lt;p&gt;Ben Halpern started a thread about his generator on DEV and I took his scaffold and ran with it.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🥞 Stack&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Ruby and &lt;code&gt;ruby-handlebars&lt;/code&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;👊🏽 Wins&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Just getting the script running is a win for me, as I am not a Ruby dev at all.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;😐 Difficulties&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Ruby is a &lt;em&gt;whole other animal&lt;/em&gt; compared to JavaScript and React. No semicolons, defining different methods (Ruby is class based, so there are more methods than functions in this instance), etc. I spent a whole month stuck on what this method did:&lt;/p&gt;
&lt;div class="highlight highlight-source-ruby notranslate position-relative overflow-auto js-code-highlight"&gt;…
&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/twhite96/static-gen-ruby" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


</description>
      <category>rspec</category>
      <category>ruby</category>
      <category>question</category>
    </item>
    <item>
      <title>What is meant by a "shape" in programming</title>
      <dc:creator>tiff</dc:creator>
      <pubDate>Mon, 07 Mar 2022 22:14:09 +0000</pubDate>
      <link>https://forem.com/tiffengineer/what-is-meant-by-a-shape-in-programming-263c</link>
      <guid>https://forem.com/tiffengineer/what-is-meant-by-a-shape-in-programming-263c</guid>
      <description>&lt;p&gt;Devs like to talk about imagining the shape of the code or data and when people say that, all I can think of is a circle and square, traditional &lt;em&gt;shapes&lt;/em&gt; and I can't get past that mental model.&lt;/p&gt;

&lt;p&gt;Whenever it is explained to me I'm lost and have no idea what it means.&lt;/p&gt;

&lt;p&gt;Can someone help me understand this?&lt;/p&gt;

</description>
      <category>explainlikeimfive</category>
      <category>discuss</category>
    </item>
    <item>
      <title>How Do You Pass a Method to gsub in Ruby?</title>
      <dc:creator>tiff</dc:creator>
      <pubDate>Tue, 24 Nov 2020 04:14:30 +0000</pubDate>
      <link>https://forem.com/tiffengineer/how-do-you-pass-a-method-to-gsub-in-ruby-210g</link>
      <guid>https://forem.com/tiffengineer/how-do-you-pass-a-method-to-gsub-in-ruby-210g</guid>
      <description>&lt;p&gt;I am building off of Ben's static site generator, and I wanted to DRY it up a bit.&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/ben" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1%2Fbabb96d0-9cd2-49bc-a412-2dc4caf94c2a.png" alt="ben"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/ben/one-thing-led-to-another-and-i-built-my-own-static-site-generator-today-5enj" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;One thing led to another and I built my own static site generator today&lt;/h2&gt;
      &lt;h3&gt;Ben Halpern ・ May 3 '20&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#ruby&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#html&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;I have a few methods:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;prod_build&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;ARGV&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"production_build"&lt;/span&gt;

&lt;span class="c1"&gt;# Read files&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;page_partials&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_page_partial&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;pages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"site/&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;page_partial&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.html"&lt;/span&gt;
  &lt;span class="n"&gt;new_page_partial&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pages&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;script_partials&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_script_partial&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;scripts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"site/&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;script_partial&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.js"&lt;/span&gt;
  &lt;span class="n"&gt;new_script_partial&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;scripts&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;style_partial&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_style_partial&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;styles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"site/&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;style_partial&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.css"&lt;/span&gt;
  &lt;span class="n"&gt;new_style_partial&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;page_partials&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I'm not a Rubyist, though I've dabbled in it. I assume these methods are correct, considering:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;build_string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;base_html&lt;/span&gt;
  &lt;span class="c1"&gt;# How do you use a block in a .gsub method???&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;gsub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"{{ head }}"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;page_partials&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;gsub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"{{ seo }}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seo_html&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;gsub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"{{ main }}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;main_css&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;gsub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"{{ dev }}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dev_html&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I have a bunch of &lt;code&gt;.gsub&lt;/code&gt; methods that expect a file, will change the file name, and in the build string, will create the file.&lt;/p&gt;

&lt;p&gt;What I want to know is, as a JavaScript dev, &lt;em&gt;how&lt;/em&gt; to pass these methods as parameters to the &lt;code&gt;.gsub&lt;/code&gt; method in a block and &lt;em&gt;if&lt;/em&gt; you can do this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shifting paradigms
&lt;/h2&gt;

&lt;p&gt;I haven't looked at this code in a month as I was sick for that long. I have no idea what I was aiming for as such I am a little lost. JavaScript handles things much differently and I am trying to apply my js knowledge to Ruby and that seems to be a bad idea.&lt;/p&gt;

&lt;p&gt;Thanks for helping, if you can.&lt;/p&gt;

</description>
      <category>help</category>
      <category>ruby</category>
    </item>
    <item>
      <title>Flexing My CSS Muscles by Adding A Bit of Panache</title>
      <dc:creator>tiff</dc:creator>
      <pubDate>Wed, 11 Nov 2020 01:32:25 +0000</pubDate>
      <link>https://forem.com/tiffengineer/flexing-my-css-muscles-by-adding-a-bit-of-panache-hhb</link>
      <guid>https://forem.com/tiffengineer/flexing-my-css-muscles-by-adding-a-bit-of-panache-hhb</guid>
      <description>&lt;p&gt;📸  &lt;a href="https://unsplash.com/@casparrubin?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Photo by Caspar Camille Rubin&lt;/a&gt; on &lt;a href="https://dev.to/s/photos/css?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well, this was a ride. But I came out on the other end. The following is a case study of my journey adding low highlights to headings and links to this blog.&lt;/p&gt;

&lt;p&gt;To add a bit more color and &lt;em&gt;style&lt;/em&gt; to this blog by adding a &lt;em&gt;low highlight&lt;/em&gt; to headers and links, much like you can find on the &lt;a href="https://www.rust-lang.org/" rel="noopener noreferrer"&gt;Rust landing page&lt;/a&gt; and &lt;a href="https://wesbos.com/" rel="noopener noreferrer"&gt;Wes Bos' website&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvby09a0g85jhsgece9lw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvby09a0g85jhsgece9lw.png" alt="Rust's landing page with header highlights" width="800" height="357"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Rust's landing page highlights&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy59o1ntfcynaexmb8i64.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy59o1ntfcynaexmb8i64.png" alt="Wes Bos' link highlights" width="800" height="180"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Wes' sense of design is always top notch. Always a bit of whimsy with his stuff.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Motivation
&lt;/h2&gt;

&lt;p&gt;I wanted my blog to look cool and modern, fancy, like the big kids in this space. I also wanted to flex my CSS muscles, as that is one of my weaker areas&lt;sup id="fnref1"&gt;1&lt;/sup&gt;. &lt;/p&gt;
&lt;h2&gt;
  
  
  Process
&lt;/h2&gt;

&lt;p&gt;At first, I went into DevTools and copied the CSS from Rust's webpage. It didn't quite work. None of my highlights were showing and I didn't debug because I felt like something deeper was at play&lt;sup id="fnref2"&gt;2&lt;/sup&gt;. I decided to skip this idea and go a different route.&lt;/p&gt;

&lt;p&gt;I did a bit of Google-fu on how to get this effect and came across  &lt;a href="https://thirtyeightvisuals.com/blog/low-highlight-heading-links-squarespace" rel="noopener noreferrer"&gt;How to create a low highlight behind your text&lt;/a&gt; by Thirty Eight Visuals. It's a tutorial on how to do this on Squarespace but you can apply it to any website.&lt;/p&gt;

&lt;p&gt;I copied this snippet of code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt; &lt;span class="nt"&gt;background&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;linear-gradient&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;180&lt;/span&gt;&lt;span class="nt"&gt;deg&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;rgba&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;255&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="err"&gt;255&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="err"&gt;255&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="err"&gt;65&lt;/span&gt;&lt;span class="o"&gt;%,&lt;/span&gt; &lt;span class="nf"&gt;#ffc1d2&lt;/span&gt; &lt;span class="err"&gt;65&lt;/span&gt;&lt;span class="o"&gt;%);&lt;/span&gt;
  &lt;span class="nt"&gt;display&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;inline&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;created a class and added that to the &lt;code&gt;h1&lt;/code&gt; element in my &lt;code&gt;page.html&lt;/code&gt; file. The resulting code looks something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="nc"&gt;.highlight&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;linear-gradient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;180deg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rgba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="m"&gt;65%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;#ffc1d2&lt;/span&gt; &lt;span class="m"&gt;65%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;inline&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This worked for all the &lt;code&gt;h1&lt;/code&gt; elements, but I also wanted the &lt;code&gt;h2&lt;/code&gt; and &lt;code&gt;h3&lt;/code&gt; elements to be highlighted. In this instance, it also only highlighted the &lt;code&gt;h1&lt;/code&gt; elements on the index page, which in my Jekyll theme is &lt;code&gt;default.html&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I tried to add a class to all the header elements but it still didn't work. I found it difficult to actually target those specific elements with the &lt;code&gt;.highlight&lt;/code&gt; class. If I added the class to all the header elements in one template, it didn't go across all the other templates in my &lt;code&gt;_layouts&lt;/code&gt; folder.&lt;/p&gt;

&lt;h2&gt;
  
  
  Targeting inline header elements
&lt;/h2&gt;

&lt;p&gt;I wanted all header elements to be highlighted on every page. It was difficult to accomplish this with the different templates that my Jekyll theme has in its &lt;code&gt;_layouts&lt;/code&gt; folder.&lt;/p&gt;

&lt;p&gt;I dug into the Sass in my theme and looked for any classes that targeted what I wanted and added the gradient to them but that also didn't work.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1man2p7iuvtfulrou38t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1man2p7iuvtfulrou38t.png" alt="Header highlights" width="800" height="829"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;This image doesn't capture the half of it...&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I decided to head back to Google, Stack Overflow and try to find &lt;em&gt;something&lt;/em&gt; to help me with this.&lt;/p&gt;
&lt;h2&gt;
  
  
  MDN and the &lt;em&gt;:not()&lt;/em&gt; selector
&lt;/h2&gt;

&lt;p&gt;One of the things I wanted to do was &lt;em&gt;exclude&lt;/em&gt; certain elements with certain classes. I found the  &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:not" rel="noopener noreferrer"&gt;:not() selector on MDN&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;At first it confused me; what are we excluding?&lt;/p&gt;

&lt;p&gt;At first I selected all of the elements I wanted to change and added the &lt;code&gt;:not()&lt;/code&gt; selector, for instance &lt;code&gt;p:not(.some-class)&lt;/code&gt; which highlighted &lt;em&gt;all&lt;/em&gt; the &lt;code&gt;p&lt;/code&gt; elements that did not have that class. This meant all paragraphs in the body were selected.&lt;/p&gt;

&lt;p&gt;I tried to add the linear gradient to all the main &lt;code&gt;hn&lt;/code&gt; selectors which meant even those elements that I didn't want selected, like the tags or header in the newsletter box had the gradient added to them which I didn't want. I also wanted to add the gradient to different links in the body. I did the same for the anchor elements, not realizing that the social icons and tags were also links, thus having all the social icons, tags, and other buttons included in the linear gradient selection. It was a &lt;em&gt;disaster&lt;/em&gt; so I went back to the docs and reread them.&lt;/p&gt;
&lt;h2&gt;
  
  
  Decided &lt;em&gt;:not()&lt;/em&gt; was &lt;em&gt;not&lt;/em&gt; the right selector&lt;sup id="fnref3"&gt;3&lt;/sup&gt;
&lt;/h2&gt;

&lt;p&gt;I tried to use &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:first-child" rel="noopener noreferrer"&gt;:first-child() selector&lt;/a&gt; but then I'd need to select different elements that were not descendants to the parent element because this Jekyll theme and Liquid templating is hard to reason about when it comes to custom styles.&lt;/p&gt;

&lt;p&gt;Looked up the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-child" rel="noopener noreferrer"&gt;:nth-child() selector&lt;/a&gt; and decided that wouldn't work either.&lt;/p&gt;

&lt;p&gt;Sat on it for a few minutes, Googling and trawling Stack Overflow.&lt;/p&gt;
&lt;h2&gt;
  
  
  Back to basics
&lt;/h2&gt;

&lt;p&gt;Went back to CSS fundamentals and realized I could just add a &lt;code&gt;background: #fff&lt;/code&gt; to the elements that I didn't want the highlight to be included in. Learned more about specificity and how to order selectors along the cascade to target specific elements, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="nc"&gt;.site-info&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#fff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to target all the &lt;code&gt;p&lt;/code&gt; elements with the class &lt;code&gt;site.info&lt;/code&gt; that have an anchor tag, &lt;code&gt;a&lt;/code&gt; as a descendant I also changed the color of the text selection when a user selects text on most of the site with the &lt;code&gt;::selection&lt;/code&gt; selector.&lt;/p&gt;

&lt;h2&gt;
  
  
  Oh ...and a scrollbar
&lt;/h2&gt;

&lt;p&gt;What good is a dev blog without a fancy scrollbar?&lt;/p&gt;

&lt;p&gt;Got the idea from &lt;a href="https://swyx.io" rel="noopener noreferrer"&gt;swyx&lt;/a&gt; and &lt;a href="https://css-tricks.com" rel="noopener noreferrer"&gt;CSS-Tricks&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="nd"&gt;::-webkit-scrollbar&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1em&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="nd"&gt;::-webkit-scrollbar-track&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;-webkit-box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;inset&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;6px&lt;/span&gt; &lt;span class="n"&gt;rgba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="nd"&gt;::-webkit-scrollbar-thumb&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;215&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;217&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;linear-gradient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;45deg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rgba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;215&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;217&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="m"&gt;0%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rgba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;193&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;210&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1.00&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="m"&gt;35%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rgba&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;215&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;217&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3em&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://css-tricks.com/almanac/properties/s/scrollbar/" rel="noopener noreferrer"&gt;scrollbar CSS-Tricks&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/tiffanywhitedev/embed/BajppPj?height=600&amp;amp;default-tab=css&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;CSS can be fun at times and sprucing up this blog with some fancy CSS tricks was quite an adventure.&lt;/p&gt;

&lt;p&gt;Learning about specificity, different CSS selectors, and the like, made for a fun yet frustrating evening and I am glad I did it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Edit&lt;/em&gt;&lt;/strong&gt;: &lt;/p&gt;

&lt;p&gt;I could have used a CSS variable instead of writing &lt;code&gt;background: #fff&lt;/code&gt; everywhere, declaring the &lt;code&gt;:root&lt;/code&gt; pseudo-class and declaring a variable like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;--non-highlights&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#fff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then applying this variable everywhere I need, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.non-highlights&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="err"&gt;var(--non-highlights)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I plan on implementing this soon.&lt;/p&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;Also, admittedly, my least favorite. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn2"&gt;
&lt;p&gt;Maybe something custom that I was missing. I just didn't feel like digging any deeper for such a minor enhancement. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn3"&gt;
&lt;p&gt;Ba dum tiss ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>css</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Real Artists Ship: Portfolio Finished</title>
      <dc:creator>tiff</dc:creator>
      <pubDate>Tue, 10 Nov 2020 03:31:44 +0000</pubDate>
      <link>https://forem.com/tiffengineer/real-artists-ship-portfolio-finished-de9</link>
      <guid>https://forem.com/tiffengineer/real-artists-ship-portfolio-finished-de9</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Long time no DEV! Been heads down but have some fresh content for y'all, originally posted on my blog.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;📸   Photo by &lt;a href="https://unsplash.com/@otenteko?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Anas Alshanti&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/portfolio?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is monumental for me; I actually shipped something I said I was going to ship, and in less than a month. The thing I shipped is my &lt;a href="https://www.tiffanyrwhite.com/" rel="noopener noreferrer"&gt;new portfolio&lt;/a&gt;, built with Gatsby and based on the work of Jacob Martinez and heavily inspired by Brittany Chiang's portfolio &lt;a href="https://dev.to/2020/07/08/portfolio-redesign-part-1-ideas/#portfolio-inspo"&gt;which I gush over in this post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It took me two weeks working on it every couple days for a couple hours a day. I took the &lt;em&gt;gatsby-simple-portfolio&lt;/em&gt; theme, a simple starter, and made it my own.&lt;/p&gt;

&lt;h2&gt;
  
  
  The easy part
&lt;/h2&gt;

&lt;p&gt;I wanted the color theme to look like Brittany's because, well, I &lt;em&gt;really like it&lt;/em&gt;. I used a tool for Mac called &lt;a href="https://sipapp.io/" rel="noopener noreferrer"&gt;Sip&lt;/a&gt; to grab the colors from her site and went to work.&lt;/p&gt;

&lt;h2&gt;
  
  
  The hard parts
&lt;/h2&gt;

&lt;p&gt;There were several hard parts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I wanted to have a downloadable resume in the resume button instead of a link to my resume site&lt;/li&gt;
&lt;li&gt;I wanted to have navigation on the site instead of relying on &lt;em&gt;scroll-reveal&lt;/em&gt; and scrolling all the way down the page&lt;/li&gt;
&lt;li&gt;I wanted each nav item to scroll to its id on the page&lt;/li&gt;
&lt;li&gt;I wanted a hamburger menu to show only on mobile&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We'll tackle these in the next few sections.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Downloadable resume
&lt;/h3&gt;

&lt;p&gt;For this I wanted a pdf file to download when users clicked the &lt;code&gt;resume&lt;/code&gt; button. I didn't know or understand how people could download files, whether in Gatsby, or HTML in general.&lt;/p&gt;

&lt;p&gt;I spent a lot of time in the &lt;a href="https://www.gatsbyjs.com/docs/importing-assets-into-files/#querying-for-a-file-in-graphql-using-gatsby-source-filesystem" rel="noopener noreferrer"&gt;Gatsby documentation learning about the filesystem&lt;/a&gt; and how to store files. The example showed a GraphQL query but I didn't need GraphQL; this was a static site with no moving parts. The theme did not include GraphQL because it was basic. I could have added all of that but why? I just needed to serve up some images, links, and a pdf; there was no content and no pages.&lt;/p&gt;

&lt;p&gt;I went back a couple pages in the docs and found what I needed.&lt;/p&gt;

&lt;p&gt;I created a &lt;code&gt;download&lt;/code&gt; directory in the &lt;code&gt;src&lt;/code&gt; directory and placed the pdf in there. I then needed a way to download the pdf from that directory.&lt;/p&gt;

&lt;p&gt;First, I added the directory to &lt;code&gt;gatsby-config.js&lt;/code&gt; using the &lt;a href="https://www.gatsbyjs.com/plugins/gatsby-source-filesystem/" rel="noopener noreferrer"&gt;&lt;code&gt;gatsby-source-filesystem&lt;/code&gt;&lt;/a&gt; plugin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`gatsby-source-filesystem`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`downloads`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;__dirname&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/src/downloads/`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I imported the pdf into the &lt;code&gt;About.jsx&lt;/code&gt; component like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// some other imports&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;resumeDownload&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;../../downloads/resume.pdf&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, I needed to figure out a way to download a file from a React component.&lt;/p&gt;

&lt;p&gt;Initially, I thought I'd need to come up with some convoluted system to do this but it was as simple as using an anchor tag and a couple built-in React props:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"d-flex mt-3"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;
    &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"_blank"&lt;/span&gt;
    &lt;span class="na"&gt;rel&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"noopener noreferrer"&lt;/span&gt;
    &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"cta-btn cta-btn--resume"&lt;/span&gt;
    &lt;span class="na"&gt;download&lt;/span&gt;
    &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;resumeDownload&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    Resume
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, when the user clicks the &lt;code&gt;Resume&lt;/code&gt; button, a copy of my resume will download with some sort of UUID at the end&lt;sup id="fnref1"&gt;1&lt;/sup&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Navigation
&lt;/h3&gt;

&lt;p&gt;Brittany Chiang's portfolio has an interesting navigation bar that I wanted to have. I picked a similar font to the one on her portfolio, and went about building the nav.&lt;/p&gt;

&lt;p&gt;In order to get the numbers to be a separate color from the text, I wrapped the numbers in a &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt; and added a class so that I could target just those spans:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"menu-numbers"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;01.&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;Intro&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;nbsp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which results in this nice navbar at the top:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Farwl4h6dbaoz8ewfz727.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Farwl4h6dbaoz8ewfz727.png" width="724" height="131"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It took a little bit of CSS-fu to get it aligned properly, trying to not rely on the &lt;code&gt;react-bootstrap&lt;/code&gt; CSS that came with the theme&lt;sup id="fnref2"&gt;2&lt;/sup&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Anchor tag scrolling
&lt;/h3&gt;

&lt;p&gt;I forgot how this worked. I did some searching and found that I could add an &lt;code&gt;id&lt;/code&gt; to the top node in the component tree and target each component that way:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;section&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"projects"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and in the &lt;code&gt;Nav&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"#projects"&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"menu-text"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"menu-numbers"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;03.&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; Projects &lt;span class="ni"&gt;&amp;amp;nbsp;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, tapping any of those links in the nav take you to the section immediately instead of needing to scroll down the page&lt;sup id="fnref3"&gt;3&lt;/sup&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Creating a responsive hamburger nav
&lt;/h3&gt;

&lt;p&gt;This was &lt;em&gt;the hardest part&lt;/em&gt; about this project. I didn't use react-bootstrap for the navigation, which would have made this whole endeavor easier. Bootstrap has some utility classes that make adding a hambuger nav easy.&lt;/p&gt;

&lt;p&gt;But since I wanted a custom nav, using Bootstrap wasn't going to work. So I built a hamburger nav from scratch. Only, &lt;em&gt;it was hard&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;I wasn't sure how to do it in a React app. I did some searching and came across &lt;a href="https://css-tricks.com/hamburger-menu-with-a-side-of-react-hooks-and-styled-components/" rel="noopener noreferrer"&gt;a tutorial on CSS-Tricks&lt;/a&gt; that gave a step by step guide on how to build a hambuger nav&lt;sup id="fnref4"&gt;4&lt;/sup&gt;. The issue was I wanted the hamburger nav to show up &lt;em&gt;only&lt;/em&gt; when the viewport reached &lt;code&gt;769px&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I searched some more and found that I could make the hamburger icon its own component, called &lt;code&gt;Burger.jsx&lt;/code&gt; and a mobile nav called &lt;code&gt;MobileNav.jsx&lt;/code&gt;. I used styled-components to create both of these, with code from a video that &lt;em&gt;also&lt;/em&gt; used the same code in that CSS-Tricks article&lt;sup id="fnref5"&gt;5&lt;/sup&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Mobile nav
&lt;/h4&gt;

&lt;p&gt;For the mobile nav we have a simple unordered list of menu items that link to the sections ids of the sections of the portfolio:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;StyledList&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ul&lt;/span&gt;&lt;span class="s2"&gt;`
  list-style: none;
  display: flex;
  flex-flow: row nowrap;
  li {
    padding: 18px 10px;
  }

  // More styled component CSS
}
`&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MobileNav&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;open&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;StyledList&lt;/span&gt; &lt;span class="na"&gt;open&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;open&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"#hero"&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"menu-text"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"menu-numbers"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;01.&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; Intro &lt;span class="ni"&gt;&amp;amp;nbsp;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"#about"&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"menu-text"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"menu-numbers"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;02.&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; About &lt;span class="ni"&gt;&amp;amp;nbsp;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"#projects"&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"menu-text"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"menu-numbers"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;03.&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; Projects &lt;span class="ni"&gt;&amp;amp;nbsp;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"#contact"&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"menu-text"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"menu-numbers"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;04.&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;span&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; Contact &lt;span class="ni"&gt;&amp;amp;nbsp;&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;StyledList&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we use the &lt;code&gt;StyledList&lt;/code&gt; to create the &lt;code&gt;MobileNav&lt;/code&gt; passing in an &lt;code&gt;open&lt;/code&gt; prop to the styled list.&lt;/p&gt;

&lt;p&gt;Then, in &lt;code&gt;Burger.jsx&lt;/code&gt; we set &lt;code&gt;open&lt;/code&gt;'s state using the &lt;code&gt;useState&lt;/code&gt; hook and setting the intial state to &lt;code&gt;false&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Burger&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;open&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setOpen&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;StyledBurger&lt;/span&gt; &lt;span class="na"&gt;open&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;open&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setOpen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;open&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;MobileNav&lt;/span&gt; &lt;span class="na"&gt;open&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;open&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;StyledBurger&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When someone taps or clicks on the burger part of the mobile nav, the new state returns true, and the mobile nav opens. Having &lt;code&gt;MobileNav&lt;/code&gt; outisde &lt;code&gt;StyledBurger&lt;/code&gt; tripped me up; I kept seeing two menus and no burger when testing on mobile. I moved the &lt;code&gt;MobileNav&lt;/code&gt; inside the &lt;code&gt;StyledBurger&lt;/code&gt; which worked and gave me the hamburger menu I wanted. But it was &lt;em&gt;always there&lt;/em&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Media queries, breakpoints, and defeat
&lt;/h4&gt;

&lt;p&gt;I tried to use media queries to get the hamburger menu to only show when the viewport reached &lt;code&gt;769px&lt;/code&gt; &amp;gt;. Nothing I tried worked.&lt;/p&gt;

&lt;p&gt;I kept searching and, in a moment of defeat, because I spent a couple days trying to figure this out, I used a little library called &lt;a href="https://github.com/flexdinesh/react-socks" rel="noopener noreferrer"&gt;react-socks, a React library to render components only on specific viewports&lt;/a&gt;. I was able to easily set the breakpoints I needed with an import and some nesting in &lt;code&gt;App.jsx&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;BreakpointProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Breakpoint&lt;/span&gt; &lt;span class="na"&gt;large&lt;/span&gt; &lt;span class="na"&gt;up&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;       
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Nav&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Breakpoint&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Breakpoint&lt;/span&gt; &lt;span class="na"&gt;medium&lt;/span&gt; &lt;span class="na"&gt;down&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Burger&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Breakpoint&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;BreakpointProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Couldn't get any easier than that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fixes
&lt;/h2&gt;

&lt;p&gt;The navigation jumps a bit when loaded on mobile. I think it may have to do with the library or how I am implementing the mobile nav. In either case, I need to fix it.&lt;/p&gt;

&lt;p&gt;There are some content fixes that need to happen as well so I will work on them this weekend.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I shipped a thing I said I was going to ship and I am proud of that. I am not done shipping new projects. I am starting another this weekend and when that one is finished I want to build a full stack app with Next.js. &lt;/p&gt;

&lt;p&gt;I am a better dev and know much more now. Real artists ship. Now onto the next.&lt;/p&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;I'm assuming it is a UUID; a weird combination of letters and numbers follow after the filename. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn2"&gt;
&lt;p&gt;Which has its own &lt;code&gt;Navbar&lt;/code&gt; component but I needed a custom one, and all Bootstrap navs are unappealing. I also just wanted it quick and without the need to override stubborn Bootstrap utility classes with &lt;code&gt;!important&lt;/code&gt; littered everywhere. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn3"&gt;
&lt;p&gt;I am going to wrap each anchor tag &lt;em&gt;scroll-reveal&lt;/em&gt;'s &lt;code&gt;&amp;lt;Fade&amp;gt;&lt;/code&gt; component for a smoother scroll experience. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn4"&gt;
&lt;p&gt;And with Hooks! ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn5"&gt;
&lt;p&gt;The video creator didn't mention the article. It was a blatant copy of the CSS-Tricks article. Not sure how I feel about that, but will make sure to credit the author of the article and link to the repo. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>career</category>
      <category>gatsby</category>
      <category>portfolio</category>
      <category>showdev</category>
    </item>
    <item>
      <title>A LinkedIn Learning Playlist for Corporate Newcomers</title>
      <dc:creator>tiff</dc:creator>
      <pubDate>Mon, 09 Dec 2019 00:31:45 +0000</pubDate>
      <link>https://forem.com/tiffengineer/a-linkedin-learning-playlist-for-corporate-newcomers-2nkn</link>
      <guid>https://forem.com/tiffengineer/a-linkedin-learning-playlist-for-corporate-newcomers-2nkn</guid>
      <description>&lt;p&gt;If you're over 30 and have just made your way up from some place like Target as a cashier to having a nice, cushy dev job in a corporation, it can seem really daunting at first. I was out of my element for a good portion of the past 5 months.&lt;/p&gt;

&lt;p&gt;I am a bad communicator and that means I hit some snags. I also know there is a lot to being a corporate worker, such as being assertive, pitching an idea, or giving a presentation.&lt;/p&gt;

&lt;p&gt;Being broke and working fast food or retail jobs then working corporate is &lt;em&gt;hard&lt;/em&gt;. There is leeway there that you &lt;em&gt;just don't have&lt;/em&gt; at your retail job.&lt;/p&gt;

&lt;p&gt;I was really struggling so I went on LinkedIn Learning, formerly Lynda.com, and made a playlist to help me and anyone else of a certain age navigate their first corporate job.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/learning/collections/6597542880389185536?u=2181681" rel="noopener noreferrer"&gt;First Time In Corporate&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;LinkedIn is a necessary evil today. My company pays for us to use this to level up our skills but I still think it is worth the investment if you're struggling to adjust. It's helped me.&lt;/p&gt;

&lt;p&gt;Have you used LinkedIn Learning? Are you a dev of a certain age just breaking into corporate? &lt;a href="https://twitter.com/tiffanywhitedev" rel="noopener noreferrer"&gt;Tell me your story&lt;/a&gt;. I'd love to hear it.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>career</category>
    </item>
    <item>
      <title>A Simple Terminal Website with CSS and Typewriter.js</title>
      <dc:creator>tiff</dc:creator>
      <pubDate>Sun, 08 Dec 2019 21:49:44 +0000</pubDate>
      <link>https://forem.com/tiffengineer/a-simple-terminal-website-with-css-and-typewriter-js-aj9</link>
      <guid>https://forem.com/tiffengineer/a-simple-terminal-website-with-css-and-typewriter-js-aj9</guid>
      <description>&lt;p&gt;Just recently, I was searching for how to create a terminal-esque website, much like Jeremy Wagner's old site where you could run commands to open different links and places on his site.&lt;/p&gt;

&lt;p&gt;It was really cool, and interesting idea: a command line interface to navigate a website&lt;sup id="fnref1"&gt;1&lt;/sup&gt;. Neat!&lt;/p&gt;

&lt;p&gt;I went in search of doing something similar however couldn't find any articles or tutorials on how to do it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hacker Noon
&lt;/h2&gt;

&lt;p&gt;I found an &lt;a href="https://hackernoon.com/how-to-make-a-terminal-like-portfolio-website-for-yourself-27d7a7030004" rel="noopener noreferrer"&gt;interesting article&lt;/a&gt; on how to make a terminal landing page. It was kind of what I was looking for, but still had some flaws:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The UI of the site was decent but still not what &lt;em&gt;I&lt;/em&gt; would want&lt;/li&gt;
&lt;li&gt;I dug into the code on &lt;a href="https://github.com/CodeNerve/CodeNerve.github.io" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; and decided that piping in a text file to do the typewriter effect was a hack I wasn't willing to put up with&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The interesting bits, like the typing and the introduction to what the site is about, was something I could take with me.&lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub diving
&lt;/h2&gt;

&lt;p&gt;I came across this site, &lt;a href="https://www.0x44.pw/" rel="noopener noreferrer"&gt;0x44&lt;/a&gt; and instantly knew I wanted my landing page to look like this.&lt;/p&gt;

&lt;p&gt;I copied the CSS when I inspected the site&lt;sup id="fnref2"&gt;2&lt;/sup&gt;, added a bit of my own, and went to work.&lt;/p&gt;

&lt;h2&gt;
  
  
  The HTML
&lt;/h2&gt;

&lt;p&gt;It's just plain old HTML; a header and nav, footer, like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;nav&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"underline"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;/about&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"your email here"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"underline"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;/contact&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"site-title"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;twhite96:$&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"cursor"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;█&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"app"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;footer&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://github.com/twhite96/"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"svglink"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      //GitHub svg here
    &lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/span&gt;
    © Copyright 2019 - twhite96.

  &lt;span class="nt"&gt;&amp;lt;/footer&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we have a nav that will have the core links underlined. Then, we give the main part of the terminal header the class, &lt;code&gt;site-title&lt;/code&gt; where we will give it its 1980s terminal vibe. You can find the block cursor with an online search.&lt;/p&gt;

&lt;p&gt;The second &lt;code&gt;div&lt;/code&gt; is where the cool stuff happens.&lt;/p&gt;

&lt;p&gt;I am using a library for the typewriter effect called, obviously, &lt;a href="https://github.com/tameemsafi/typewriterjs" rel="noopener noreferrer"&gt;typerwriterjs&lt;/a&gt;. In order to type everything we need out to the "console", we need an empty &lt;code&gt;div&lt;/code&gt; we can target with enough space to type what we need. We can do that with an &lt;code&gt;id&lt;/code&gt; of &lt;code&gt;app&lt;/code&gt;. Then I added a class of &lt;code&gt;container&lt;/code&gt; to center the content and make it responsive once we add content to the &lt;code&gt;div&lt;/code&gt;. Then the footer is just an svg of the GitHub logo and a copyright.&lt;/p&gt;

&lt;h2&gt;
  
  
  The CSS
&lt;/h2&gt;

&lt;p&gt;This is the look that Ian Pringle created with his site. The main pieces are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;170&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;text-decoration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.underline&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;170&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.underline&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.underline&lt;/span&gt;&lt;span class="nd"&gt;::before&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;right&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;170&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;transform-origin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;bottom&lt;/span&gt; &lt;span class="nb"&gt;right&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;scaleX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;transition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;transform&lt;/span&gt; &lt;span class="m"&gt;0.5s&lt;/span&gt; &lt;span class="n"&gt;ease&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.underline&lt;/span&gt;&lt;span class="nd"&gt;:hover::before&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;transform-origin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;bottom&lt;/span&gt; &lt;span class="nb"&gt;left&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;scaleX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.cursor&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;animation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;cursor&lt;/span&gt; &lt;span class="m"&gt;2s&lt;/span&gt; &lt;span class="n"&gt;infinite&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;170&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;inline-block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin-left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.centered&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt; &lt;span class="m"&gt;40px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;@keyframes&lt;/span&gt; &lt;span class="n"&gt;cursor&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="err"&gt;50&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nt"&gt;to&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We want to give the links that 1980s terminal green. We also want to give the body a black-ish background, and use CSS transitions and transforms so that when you hover the links in the nav, you get the &lt;code&gt;ease-in-out&lt;/code&gt; effect:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fszu7m930ot89y2lf3q28.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fszu7m930ot89y2lf3q28.gif" width="451" height="104"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using the &lt;code&gt;transform-origin&lt;/code&gt; property allows us to specify where to start and end the transition, in this case, the bottom right of the link in the nav.&lt;/p&gt;

&lt;p&gt;We give the cursor some love with the &lt;code&gt;animation&lt;/code&gt; property and keyframes to give it a fade in and out look as it is blinking.&lt;/p&gt;

&lt;p&gt;Finally, we make the text container, where our links will be displayed, a display of &lt;code&gt;flex&lt;/code&gt; so it can shrink and expand as needed, and then we can align our links within that container &lt;code&gt;center&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The problem I had was keeping the footer flush to the bottom, regardless of where the content was initiated.&lt;/p&gt;

&lt;p&gt;I added this to the footer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;footer&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;fixed&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;positioning the footer at the bottom with the &lt;code&gt;fixed&lt;/code&gt; property making it static, and giving the &lt;code&gt;bottom&lt;/code&gt; of the footer a length of &lt;code&gt;0&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The JavaScript
&lt;/h2&gt;

&lt;p&gt;Okay this isn't really all that difficult. Just following the docs allows you to get something up and running relatively quickly.&lt;/p&gt;

&lt;p&gt;Insert the unpkg link in the area above the closing body tag, along with the file you're going to initialize the typing effect in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  // Some code
  &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/typewriter-effect@latest/dist/core.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"app.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You initialize the &lt;code&gt;Typewriter&lt;/code&gt; object like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;typewriter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Typewriter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;loop&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;delay&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;75&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;autoStart&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;█&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;strings&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;My name is Tiffany, and I am a frontend dev and wannabe hacker.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We target the DOM node we want the typing to occur, this being the &lt;code&gt;div&lt;/code&gt; with the &lt;code&gt;id&lt;/code&gt; of &lt;code&gt;app&lt;/code&gt;. Then we create a new &lt;code&gt;Typewriter&lt;/code&gt; object, pass in our &lt;code&gt;app&lt;/code&gt; variable, and add a few properties on the &lt;code&gt;Typewriter&lt;/code&gt; object:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;loop: do you want the typing to start over when it is finished?: &lt;code&gt;Boolean&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;How long to delay the start of the typing: &lt;code&gt;Number&lt;/code&gt;, in &lt;code&gt;ms&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Whether or not to start when a user initially loads the site: &lt;code&gt;Boolean&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Type of cursor you want, the default being the &lt;code&gt;pipe&lt;/code&gt;: &lt;code&gt;String&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;And the initial string you want to type out when the user first visits: &lt;code&gt;Array&lt;/code&gt; of strings&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is simple enough.&lt;/p&gt;

&lt;p&gt;To get the typing started, we can do something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;typewriter&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;deleteAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pauseFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;deleteAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;typeString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;I work for &amp;lt;strong&amp;gt;[REDACTED]&amp;lt;/strong&amp;gt; as a frontend dev, and I code, write, and shoot and edit videos on weekends.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pauseFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;deleteAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;typeString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Find me online: &amp;lt;br /&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pauseFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;typeString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;a href="https://tiffanywhite.dev"&amp;gt;Blog&amp;lt;/a&amp;gt; &amp;lt;br /&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;typeString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;a href="https://www.tiffanyrwhite.com"&amp;gt;Portfolio&amp;lt;/a&amp;gt; &amp;lt;br /&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We delete all the initial strings using the &lt;code&gt;deleteAll&lt;/code&gt; method which takes a number in &lt;code&gt;ms&lt;/code&gt; for how long the delete animation should last. Then we can use the &lt;code&gt;pauseFor&lt;/code&gt; method to pause for a specified time in &lt;code&gt;ms&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;typeString&lt;/code&gt; method allows us to type whatever we want. Each method takes one string that can also contain HTML. This means in order to do what I wanted, I needed to create several &lt;code&gt;typeString&lt;/code&gt; methods to create a list of links I wanted to show on different lines. It's an unfortunate limitation but with everything else you get in the library, it is not a deal breaker.&lt;/p&gt;

&lt;p&gt;Check out &lt;a href="https://github.com/tameemsafi/typewriterjs#options" rel="noopener noreferrer"&gt;all the methods&lt;/a&gt; that come with the library to see what you can do with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrap-up
&lt;/h2&gt;

&lt;p&gt;In the end, you get my site, &lt;a href="https://pard0x.dev/" rel="noopener noreferrer"&gt;pard0x&lt;/a&gt;&lt;sup id="fnref3"&gt;3&lt;/sup&gt;.&lt;/p&gt;

&lt;p&gt;It's a simple thing that looks cool and is easy enough to build.&lt;/p&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;His site doesn't have the command line interface anymore which is a shame, really. It was really innovative and made with pure HTML, CSS, and JavaScript. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn2"&gt;
&lt;p&gt;I give Ian S. Pringle, the dev, full credit in the source code. Don't worry. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn3"&gt;
&lt;p&gt;I wanted &lt;code&gt;par@d0x&lt;/code&gt; but you know you can't do that in a domain and I forgot about that. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>The JavaScript Developer's Reading List</title>
      <dc:creator>tiff</dc:creator>
      <pubDate>Fri, 15 Mar 2019 22:22:44 +0000</pubDate>
      <link>https://forem.com/tiffengineer/the-javascript-developers-reading-list-3fmp</link>
      <guid>https://forem.com/tiffengineer/the-javascript-developers-reading-list-3fmp</guid>
      <description>&lt;p&gt;I made a little repo of books and articles for JavaScript devs to read that either I've read or have been recommended to me by other devs.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/twhite96" rel="noopener noreferrer"&gt;
        twhite96
      &lt;/a&gt; / &lt;a href="https://github.com/twhite96/js-dev-reads" rel="noopener noreferrer"&gt;
        js-dev-reads
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A list of books 📚and articles 📝 for the discerning web developer to read.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;
    &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/1c21c4824ac2135115f1db28fbb58b5147c695b8b8c60827b00afb49df7b6318/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f747768697465626c6f672f696d6167652f75706c6f61642f76313535323631383233352f626f6f6b735f6b77727a64312e737667"&gt;&lt;img src="https://camo.githubusercontent.com/1c21c4824ac2135115f1db28fbb58b5147c695b8b8c60827b00afb49df7b6318/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f747768697465626c6f672f696d6167652f75706c6f61642f76313535323631383233352f626f6f6b735f6b77727a64312e737667" alt="JavaScript Dev Reading List"&gt;&lt;/a&gt;
  &lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;The JavaScript Developer's Reading List&lt;/h1&gt;
&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;A list of hand-picked books and articles for JavaScript developers&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="https://forthebadge.com" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/5f2e712891c92c6a76ee1da98150565b5a429f824e1784aa45452caf007ed3e3/68747470733a2f2f666f7274686562616467652e636f6d2f696d616765732f6261646765732f6275696c742d62792d646576656c6f706572732e737667" alt="forthebadge"&gt;&lt;/a&gt; &lt;a href="https://forthebadge.com" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/f51587462f5fc3f41b9c9987475de8988e21113d16baf3e420eee398b49ffb44/68747470733a2f2f666f7274686562616467652e636f6d2f696d616765732f6261646765732f6275696c742d776974682d6c6f76652e737667" alt="forthebadge"&gt;&lt;/a&gt; &lt;a href="https://forthebadge.com" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/2e7cd792a99cb568ec101cd1431d2e9a8319dc9e357fd95922c33570b1017e5a/68747470733a2f2f666f7274686562616467652e636f6d2f696d616765732f6261646765732f63632d302e737667" alt="forthebadge"&gt;&lt;/a&gt; &lt;a href="http://makeapullrequest.com" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/9f7e5545529be47a15e7ce5a8c995e9ff221d14e9f9d194bfc9e3b0e127f30e0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5052732d77656c636f6d652d677265656e3f7374796c653d666f722d7468652d6261646765" alt="PRs Welcome"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/twhite96/js-dev-reads#the-problem-confused" rel="noopener noreferrer"&gt;The problem 😕&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/twhite96/js-dev-reads#solution-sunglasses" rel="noopener noreferrer"&gt;Solution 😎&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/twhite96/js-dev-reads#things-to-think-about-thinking" rel="noopener noreferrer"&gt;Things to think about 🤔&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/twhite96/js-dev-reads#note-exclamation" rel="noopener noreferrer"&gt;Note ❗&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/twhite96/js-dev-reads#books-books" rel="noopener noreferrer"&gt;Books 📚&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/twhite96/js-dev-reads#react--graphql" rel="noopener noreferrer"&gt;React &amp;amp; GraphQL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/twhite96/js-dev-reads#design-patterns-in-javascript" rel="noopener noreferrer"&gt;Design patterns in JavaScript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/twhite96/js-dev-reads#react-native" rel="noopener noreferrer"&gt;React Native&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/twhite96/js-dev-reads#node" rel="noopener noreferrer"&gt;Node&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/twhite96/js-dev-reads#vue" rel="noopener noreferrer"&gt;Vue&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/twhite96/js-dev-reads#core-concepts" rel="noopener noreferrer"&gt;Core concepts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/twhite96/js-dev-reads#software-architecture" rel="noopener noreferrer"&gt;Software architecture&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/twhite96/js-dev-reads#data-structures-and-algorithms" rel="noopener noreferrer"&gt;Data structures and algorithms&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/twhite96/js-dev-reads#miscellaneous" rel="noopener noreferrer"&gt;Miscellaneous&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/twhite96/js-dev-reads#articles-memo" rel="noopener noreferrer"&gt;Articles 📝&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/twhite96/js-dev-reads#react" rel="noopener noreferrer"&gt;React&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/twhite96/js-dev-reads#core-concepts-1" rel="noopener noreferrer"&gt;Core concepts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/twhite96/js-dev-reads#javascript-misc" rel="noopener noreferrer"&gt;JavaScript misc.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/twhite96/js-dev-reads#soft-skills" rel="noopener noreferrer"&gt;Soft skills&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;The problem 😕&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;There are &lt;em&gt;a lot&lt;/em&gt; of web development reading materials out there, from books to videos to blog posts. How can you know what is actually worth reading?&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Solution 😎&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Here I have hand-picked web development/JavaScript books and articles I have personally read or have come highly recommended to me by other developers.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Things to think about 🤔&lt;/h3&gt;

&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;Free books. Who doesn't like free books?! But if you are able, buy the book if it is offered as an option. No worries if you can't. But if it helps the…&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/twhite96/js-dev-reads" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;If you have a suggestion, &lt;a href="https://github.com/twhite96/js-dev-reads/issues" rel="noopener noreferrer"&gt;submit an issue&lt;/a&gt; or &lt;a href="https://github.com/twhite96/js-dev-reads/pulls" rel="noopener noreferrer"&gt;pull request&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Feel free to add your favorites but please keep it to JavaScript and maybe, once I get a feel for who wants what, I'll add other web tech like CSS and HTML. Also, make sure you've either read the book or it came highly recommended to you. I tried to avoid &lt;em&gt;really bad books and articles&lt;/em&gt; from making it on this list so please keep that in mind.&lt;/p&gt;

&lt;p&gt;Let me know what you think! 📚📝&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>beginners</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Independent Contractor Taxes Self-Employment HALP</title>
      <dc:creator>tiff</dc:creator>
      <pubDate>Thu, 21 Feb 2019 00:26:43 +0000</pubDate>
      <link>https://forem.com/tiffengineer/independent-contractor-taxes-self-employment-halp-2chg</link>
      <guid>https://forem.com/tiffengineer/independent-contractor-taxes-self-employment-halp-2chg</guid>
      <description>&lt;p&gt;Looking on taking an internship and this internship pays as an independent contractor. I have no clue how this works, especially with taxes, and I need some help understanding this.&lt;/p&gt;

&lt;p&gt;Can any freelancer or independent contractor break this down for me?&lt;br&gt;
🙏🏾&lt;/p&gt;

</description>
      <category>explainlikeimfive</category>
      <category>discuss</category>
      <category>freelancers</category>
      <category>selfemployment</category>
    </item>
    <item>
      <title>What is the Difference Between a Function and a Method in JavaScript?</title>
      <dc:creator>tiff</dc:creator>
      <pubDate>Tue, 05 Feb 2019 19:00:36 +0000</pubDate>
      <link>https://forem.com/tiffengineer/what-is-the-difference-between-a-function-and-a-method-in-javascript-3mkj</link>
      <guid>https://forem.com/tiffengineer/what-is-the-difference-between-a-function-and-a-method-in-javascript-3mkj</guid>
      <description>&lt;p&gt;This article was originally posted on &lt;a href="https://tiffanywhite.tech/terminology-method-function/" rel="noopener noreferrer"&gt;my blog&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/snopek308" rel="noopener noreferrer"&gt;Abby Snopek&lt;/a&gt; tweeted the following:&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1080650513635569666-246" src="https://platform.twitter.com/embed/Tweet.html?id=1080650513635569666"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1080650513635569666-246');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1080650513635569666&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;In short: a &lt;em&gt;method&lt;/em&gt; is a &lt;strong&gt;function&lt;/strong&gt; that belongs to a class. In JavaScript, however, a &lt;em&gt;method&lt;/em&gt; is a &lt;strong&gt;function&lt;/strong&gt; that belongs to an &lt;strong&gt;&lt;em&gt;object&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Everything in JavaScript is an object; a &lt;strong&gt;function&lt;/strong&gt; is an object; an &lt;em&gt;Array&lt;/em&gt; is an object. This is a quirky design decision, but &lt;em&gt;because&lt;/em&gt; most everything in JavaScript is an object, we can do neat things with  &lt;a href="https://medium.com/javascript-scene/master-the-javascript-interview-what-s-the-difference-between-class-prototypal-inheritance-e4cd0a7562e9" rel="noopener noreferrer"&gt;Prototypal Inheritance&lt;/a&gt;. The nice thing about &lt;em&gt;prototypal inheritance&lt;/em&gt; is that we can manipulate several different properties on the prototype chain &lt;em&gt;at once&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Give that above article a read for more information. Also, check out the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain" rel="noopener noreferrer"&gt;Inheritance and the prototype chain article on MDN&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Update: I wrote this post without coffee and realized I should show some examples. Will rectify this after my java ☕.&lt;/p&gt;




&lt;h3&gt;
  
  
  Sign Up for the Newsletter. No spam. I hate that, too.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://buttondown.email/tiffanywhite" rel="noopener noreferrer"&gt;https://buttondown.email/tiffanywhite&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Bugfix: Spelunking in Someone Else's Code</title>
      <dc:creator>tiff</dc:creator>
      <pubDate>Sat, 05 Jan 2019 06:34:46 +0000</pubDate>
      <link>https://forem.com/tiffengineer/bugfix-spelunking-in-someone-elses-code-495k</link>
      <guid>https://forem.com/tiffengineer/bugfix-spelunking-in-someone-elses-code-495k</guid>
      <description>&lt;p&gt;This article was first published on &lt;a href="https://tiffanywhite.tech/bugfix-spelunking-in-code/" rel="noopener noreferrer"&gt;my blog&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I love &lt;a href="https://codesandbox.io/" rel="noopener noreferrer"&gt;CodeSandbox&lt;/a&gt;. It has pretty much replaced CodePen for me unless I am fiddling around with CSS or freeCodeCamp front-end projects.&lt;/p&gt;

&lt;p&gt;I like going through the sandboxes and picking out different ones to look at, take apart, and figure out how they work.&lt;/p&gt;

&lt;p&gt;While going through &lt;a href="https://egghead.io/courses/the-beginner-s-guide-to-react" rel="noopener noreferrer"&gt;React Tutorial for Beginners&lt;/a&gt; by &lt;a href="https://kentcdodds.com/" rel="noopener noreferrer"&gt;Kent C. Dodds&lt;/a&gt; on &lt;a href="https://egghead.io" rel="noopener noreferrer"&gt;Egghead.io&lt;/a&gt; I decided I would look for sandboxes that correlate with the course as I was using Codesandbox to build out the stopwatch we were building in that course.&lt;/p&gt;

&lt;p&gt;I found a &lt;a href="https://codesandbox.io/s/v1vqomk697" rel="noopener noreferrer"&gt;sandbox&lt;/a&gt; which I forked and found it to be buggy.&lt;/p&gt;

&lt;p&gt;Why didn't the stopwatch work? Glancing at the code for a few seconds, I saw some obvious problems right away.&lt;/p&gt;

&lt;p&gt;Here is an example of the stopwatch being broken:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcl.ly%2F89f29a329f05%2FScreen%25252520Recording%252525202018-12-21%25252520at%2525252002.34%25252520AM.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcl.ly%2F89f29a329f05%2FScreen%25252520Recording%252525202018-12-21%25252520at%2525252002.34%25252520AM.gif" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Bugfix 1
&lt;/h2&gt;

&lt;p&gt;The first thing I noticed was on line 7:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;StopWatch&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Component&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;lapse&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;running&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="nx"&gt;handleRunClick&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;startTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lapse&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;setInterval&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;lapse&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;now&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;startTime&lt;/span&gt;
      &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;running&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Date.now()&lt;/code&gt; needs parentheses. &lt;code&gt;Date&lt;/code&gt; is an an object constructor with &lt;code&gt;.now()&lt;/code&gt; being a method. When we click on the start button, React doesn't know what to do here; we aren't setting the state of &lt;code&gt;lapse&lt;/code&gt; to be a number, which we expect. By adding the parentheses, we get the start button to work. No more &lt;code&gt;NaNms&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But now we have another problem: &lt;em&gt;the timer won't stop&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcl.ly%2F472b7aa2e4d9%2FScreen%25252520Recording%252525202019-01-04%25252520at%2525252001.57%25252520PM.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcl.ly%2F472b7aa2e4d9%2FScreen%25252520Recording%252525202019-01-04%25252520at%2525252001.57%25252520PM.gif" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I also removed the &lt;code&gt;console.log(Math.random());&lt;/code&gt; because I felt it was unneeded.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bugfix 2: Getting the Stopwatch to Stop and Clear
&lt;/h2&gt;

&lt;p&gt;Each time the button is clicked, we set the state to either &lt;code&gt;running&lt;/code&gt; or &lt;code&gt;lapse&lt;/code&gt;. The timer runs when we click &lt;code&gt;start&lt;/code&gt; but clicking &lt;code&gt;stop&lt;/code&gt; or &lt;code&gt;clear&lt;/code&gt; doesn't seem to work. How can we fix this?&lt;/p&gt;

&lt;p&gt;We can create a timer update function that accepts the current state. We can accomplish this by using native DOM APIs such as &lt;code&gt;setInterval()&lt;/code&gt; and &lt;code&gt;clearInterval()&lt;/code&gt;. We can run conditional logic to see if the timer is running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//updater function&lt;/span&gt;
&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;running&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;clearInterval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;startTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lapse&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;timer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;setInterval&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;lapse&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;startTime&lt;/span&gt;
      &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and use &lt;code&gt;Date.now()&lt;/code&gt; to get the timestamp in ms, assign it a &lt;code&gt;startTime&lt;/code&gt; variable to compare the current time to the amount of time that has passed. When we click the start button, it sets the &lt;code&gt;startTime&lt;/code&gt; to the current timestamp. We also need to return a new state as state is &lt;em&gt;not&lt;/em&gt; mutable..&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;StopWatch&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Component&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;lapse&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;running&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="nx"&gt;handleRunClick&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;//updater function&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;running&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;clearInterval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;startTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lapse&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;timer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;setInterval&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="na"&gt;lapse&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;startTime&lt;/span&gt;
          &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="c1"&gt;// returning a new state to not mutate our original state&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;running&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;running&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Okay so this &lt;em&gt;partially&lt;/em&gt; works. But as you can see below, if I click &lt;code&gt;clear&lt;/code&gt; while the stopwatch timer is running, it &lt;em&gt;doesn't&lt;/em&gt; clear the timer, and it also doesn't allow me to &lt;em&gt;stop&lt;/em&gt; the timer, either.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcl.ly%2F64d34da82d2d%2FScreen%25252520Recording%252525202019-01-04%25252520at%2525252004.50%25252520PM.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcl.ly%2F64d34da82d2d%2FScreen%25252520Recording%252525202019-01-04%25252520at%2525252004.50%25252520PM.gif" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How do we fix this particular bug?&lt;/p&gt;

&lt;p&gt;If we look back at the previous code, we can see we are using &lt;code&gt;clearInterval()&lt;/code&gt; to reset the stopwatch timer. In our current iteration, our &lt;code&gt;handleOnClear&lt;/code&gt; method is just &lt;em&gt;setting&lt;/em&gt; the state without &lt;em&gt;clearing&lt;/em&gt; the previous state.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;handleOnClear&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;lapse&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;running&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can fix this by adding &lt;code&gt;clearInterval()&lt;/code&gt; and passing in the timer function to the &lt;code&gt;handleOnClear&lt;/code&gt; method to clear the state.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;handleOnClear&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;clearInterval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;lapse&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;running&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will give us the results we want.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcl.ly%2F77ecb442e8bb%2FScreen%25252520Recording%252525202018-12-21%25252520at%2525252002.35%25252520AM.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcl.ly%2F77ecb442e8bb%2FScreen%25252520Recording%252525202018-12-21%25252520at%2525252002.35%25252520AM.gif" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Potential Problem?
&lt;/h2&gt;

&lt;p&gt;There is a memory leak in this particular iteration. The timer will run until it is &lt;em&gt;explicitly&lt;/em&gt; stopped in the DOM. We can use a &lt;a href="https://reactjs.org/docs/state-and-lifecycle.html#adding-lifecycle-methods-to-a-class" rel="noopener noreferrer"&gt;React lifecycle method&lt;/a&gt; to stop all processes in the DOM when this component is mounted or unmounted.&lt;/p&gt;

&lt;p&gt;For this we can use &lt;code&gt;componentWillUnmount&lt;/code&gt; to tell React to unmount the component once it is done rendering.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;componentWillUnmount&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;clearInterval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Thoughts and Conclusions
&lt;/h2&gt;

&lt;p&gt;I find it much more enjoyable fixing &lt;em&gt;other people's&lt;/em&gt; bugs than my own. This was a fun exercise and I plan on doing it more regularly and blogging about it.&lt;/p&gt;

&lt;p&gt;This stopwatch is a stupid simple component but if you are just scratching the surface of React like me, I am sure digging into something like this stopwatch and figuring out how it works is an excellent exercise and use of one's time.&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/wyz76w95n8"&gt;
&lt;/iframe&gt;
&lt;/p&gt;




&lt;h3&gt;
  
  
  Sign Up for the Newsletter. No spam. I hate that, too.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://buttondown.email/tiffanywhite" rel="noopener noreferrer"&gt;https://buttondown.email/tiffanywhite&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>debugging</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
