<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shannon Crabill</title>
    <description>The latest articles on DEV Community by Shannon Crabill (@scrabill).</description>
    <link>https://dev.to/scrabill</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%2F15567%2F93b40a7b-1493-4995-9487-ff6ba2966e5d.jpg</url>
      <title>DEV Community: Shannon Crabill</title>
      <link>https://dev.to/scrabill</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/scrabill"/>
    <language>en</language>
    <item>
      <title>focused breathing - A CSS animation to help with meditation and focused breathing exercises</title>
      <dc:creator>Shannon Crabill</dc:creator>
      <pubDate>Mon, 11 Jan 2021 02:35:08 +0000</pubDate>
      <link>https://dev.to/scrabill/focused-breathing-a-css-animation-to-help-with-meditation-and-focused-breathing-exercises-dob</link>
      <guid>https://dev.to/scrabill/focused-breathing-a-css-animation-to-help-with-meditation-and-focused-breathing-exercises-dob</guid>
      <description>

&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;My Digital Ocean / DEV hackathon submission is &lt;em&gt;&lt;a href="http://www.shannoncrabill.com/focused-breathing" rel="noopener noreferrer"&gt;focused breathing&lt;/a&gt;&lt;/em&gt; a CSS animation to help with meditation and focused breathing exercises. &lt;/p&gt;

&lt;h2&gt;
  
  
  Category Submission
&lt;/h2&gt;

&lt;p&gt;Program for the People&lt;/p&gt;

&lt;h2&gt;
  
  
  App Link
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://focused-breathing-ogh7t.ondigitalocean.app/" rel="noopener noreferrer"&gt;focused-breathing-ogh7t.ondigitalocean.app/&lt;/a&gt; or &lt;a href="http://www.shannoncrabill.com/focused-breathing" rel="noopener noreferrer"&gt;shannoncrabill.com/focused-breathing&lt;/a&gt; which redirects to the app hosted on Digital Ocean.&lt;/p&gt;

&lt;h2&gt;
  
  
  Screenshots
&lt;/h2&gt;

&lt;p&gt;Screenshot of &lt;em&gt;focused breathing&lt;/em&gt; in its default state.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F58lh7qq52nv5258y9st2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F58lh7qq52nv5258y9st2.png" alt="https://dev-to-uploads.s3.amazonaws.com/i/58lh7qq52nv5258y9st2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The timing of the animation (expanding, holding, and contracting) is set to 8 seconds by default. The timing can be changed using the input field.&lt;/p&gt;

&lt;p&gt;Here's a gif of the app in action.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3qy903gwz9cfkz9siett.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3qy903gwz9cfkz9siett.gif" alt="https://dev-to-uploads.s3.amazonaws.com/i/3qy903gwz9cfkz9siett.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Description
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;focused breathing&lt;/strong&gt; includes a circle div that expands for 2 seconds, holds it's shape for 2 seconds, then contracts to its original size for 4 seconds. The breathing exercise involves inhaling through the nose as the circle expands. Holding the breath. Then exhaling through the mouth as the circle contracts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Link to Source Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/scrabill" rel="noopener noreferrer"&gt;
        scrabill
      &lt;/a&gt; / &lt;a href="https://github.com/scrabill/focused-breathing" rel="noopener noreferrer"&gt;
        focused-breathing
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A CSS Animation to help with focused breathing exercises 
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Permissive License
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://choosealicense.com/licenses/mit/" rel="noopener noreferrer"&gt;MIT&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;I recently learned about focused breathing exercises as part of a meditation or calming routine. I kept forgetting the timing of how long to inhale, hold long do I hold, etc. So, I decided to make a little app to help me with the pacing. &lt;/p&gt;

&lt;p&gt;I've been having fun experimenting with CSS animations and thought this would be an excellent opportunity to learn about the &lt;code&gt;animation&lt;/code&gt; property, transitions, and &lt;code&gt;@keyframes&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How I built it
&lt;/h3&gt;

&lt;p&gt;I built &lt;code&gt;*focused breathing*&lt;/code&gt; in two parts. The first version was an experiment with CSS animations and &lt;code&gt;@keyframes&lt;/code&gt;. I wanted to see if I could achieve the transitions and cadence I wanted with only HTML and CSS. It was possible! No Javascript was needed for the original version, which can be found on CodePen. &lt;/p&gt;

&lt;p&gt;For the second part, I wanted to see if I change the duration of the animation (which is in the CSS file) based on input from the user. I know I could get input values from the HTML file with Javascript, but could I pass those updated variables back to the CSS and render it to the page. It turns out this was possible too!&lt;/p&gt;

&lt;p&gt;Here's how I approached building parts one and two and what I learned along the way. &lt;/p&gt;

&lt;h3&gt;
  
  
  Part One - HTML &amp;amp; CSS
&lt;/h3&gt;

&lt;p&gt;Before I started coding, I was helpful for me to write down high-level steps of the focused breathing technique I had been taught. &lt;/p&gt;

&lt;p&gt;It goes like this. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Inhale through the nose&lt;/li&gt;
&lt;li&gt;Hold the breath&lt;/li&gt;
&lt;li&gt;Exhale through the mouth for 4 seconds&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The amount of time to inhale of hold the breath may not matter, but to make it easier from a coding perspective, 2 seconds to inhale and 2 seconds to hold a breath seemed reasonable.&lt;/p&gt;

&lt;p&gt;Visually, there would be a small to medium-sized circle that would expand, cueing you inhale and contract when it was time to exhale.&lt;/p&gt;

&lt;h4&gt;
  
  
  Visualizing the Animation
&lt;/h4&gt;

&lt;p&gt;Using &lt;code&gt;@keyframes&lt;/code&gt; was the best want to handle the expanding and contracting of the circle so that I control the timing and pacing of each step. With &lt;code&gt;@keyframes&lt;/code&gt; the stops or offsets range between 0% and 100%. The beginning or start of the animation would be 0% stop and the end would be 100%. Or, any number in between.&lt;/p&gt;

&lt;p&gt;I've worked with &lt;code&gt;@keyframes&lt;/code&gt; on other projects and had a difficult time visualizing what code I needed to write to achieve what I visualized in my mind. &lt;/p&gt;

&lt;p&gt;It makes sense to map out what I wanted to happen like a timeline. A line segment with two endpoints could represent the timeline of the animation. The left endpoint would be the beginning of the animation cycle and the right, the end.&lt;/p&gt;

&lt;p&gt;Some quick labels, notes and visuals and I have a timeline that looks like this. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://i1.wp.com/shannoncrabill.com/blog/wp-content/uploads/2020/12/step3.png?resize=640%2C86&amp;amp;ssl=1" rel="noopener noreferrer"&gt;&lt;code&gt;https://i1.wp.com/shannoncrabill.com/blog/wp-content/uploads/2020/12/step3.png?resize=640%2C86&amp;amp;ssl=1&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Translating the Timeline to &lt;code&gt;@keyframes&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;Looking at the timeline above, it may look like we need 8 or 4 steps in the animation, but this is not the case. Each offset point in a &lt;code&gt;@keyframe&lt;/code&gt; animation is a point where properties can be changed &lt;em&gt;from their original values.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The circle starts small, &lt;em&gt;then&lt;/em&gt; it’s changed to be larger than it was originally, &lt;em&gt;then&lt;/em&gt; it holds that size, &lt;em&gt;then&lt;/em&gt; it shrinks down to the size it was originally and the animation starts over. The &lt;code&gt;@keyframe&lt;/code&gt; only needs 2 offset points (at the &lt;code&gt;25%&lt;/code&gt; and &lt;code&gt;50%&lt;/code&gt; marks) and the original styling of the circle handles the starting (and ending) visuals.&lt;/p&gt;

&lt;p&gt;Similar to grouping other CSS attributes, multiple properties and offsets can be set at one time within the &lt;code&gt;@keyframe&lt;/code&gt; declaration. &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;

&lt;span class="k"&gt;@keyframes&lt;/span&gt; &lt;span class="n"&gt;breath&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="err"&gt;25&lt;/span&gt;&lt;span class="o"&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;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;lightpink&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;200px&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;200px&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;100px&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, to make it a bit easier on ourselves, let’s divide the line into 8 even parts (1 part for each second of the animation).&lt;/p&gt;

&lt;p&gt;The timing of the changes and width and height of the circle meant that I couldn't &lt;/p&gt;

&lt;p&gt;The expanding and contracting of the circle can be handled with &lt;code&gt;@keyframes&lt;/code&gt;. &lt;/p&gt;

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

&lt;h3&gt;
  
  
  Part 2 - Javascript
&lt;/h3&gt;

&lt;p&gt;For the second part of this project, I wanted to add some customization. To start, I wanted to see if I could change the duration of the animation—which was 8s to start—to another value. Building an input field was straight forward, but how could that value get updated in the &lt;code&gt;animation&lt;/code&gt; property?&lt;/p&gt;

&lt;p&gt;In doing some Googling, I was reminded that CSS variables &lt;em&gt;could&lt;/em&gt; be accessed &lt;em&gt;and&lt;/em&gt; updated with Javascript using &lt;code&gt;getComputedStyle&lt;/code&gt; and &lt;code&gt;getPropertyValue&lt;/code&gt;. I was already using CSS variables for colors and sizes, so created a new one for &lt;code&gt;timing&lt;/code&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;--timing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;8s&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 updated my &lt;code&gt;animation&lt;/code&gt; property to include that variable (&lt;code&gt;var(--timing)&lt;/code&gt;) instead of the hardcoded value (8s)&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;div&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;breath&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--timing&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ease&lt;/span&gt; &lt;span class="n"&gt;infinite&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt; &lt;span class="n"&gt;running&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Visually, nothing changed, which meant it worked! I could double-check the value of &lt;code&gt;--timing&lt;/code&gt; by running the following in the Console.&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;getComputedStyle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;documentElement&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;getPropertyValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;--timing&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// 8s&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And I could change it with the following and see the animation speed up dramatically.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;documentElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;--timing&lt;/span&gt;&lt;span class="dl"&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;1s&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;Then, by adding an input field onto the page, I could grab the value of that input, pass it into &lt;code&gt;.setProperty&lt;/code&gt; and update the CSS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrap Up
&lt;/h2&gt;

&lt;p&gt;Overall, I learned &lt;em&gt;a lot&lt;/em&gt; about &lt;code&gt;@keyframes&lt;/code&gt; with this project! Drawing out what I had in mind made coding go smoother with less trial and error.&lt;/p&gt;

&lt;p&gt;Looking back at this project, I tried for the first time, or became more comfortable with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CSS Grid (centering things, amiright?)&lt;/li&gt;
&lt;li&gt;CSS Animations (the &lt;code&gt;animation&lt;/code&gt; and &lt;code&gt;@keyframes&lt;/code&gt; property)&lt;/li&gt;
&lt;li&gt;Manipulating CSS variables with Javascript ( &lt;code&gt;getComputedStyle&lt;/code&gt; and &lt;code&gt;getPropertyValue&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Continuous deployment (yikes to manually copy and pasting files like I usually do)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For future enhancements, some thoughts are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The ability to change other variables (hold time is longer, shorter, etc)&lt;/li&gt;
&lt;li&gt;The ability to start and stop (or, incorporate a timer for 5 mins of focused breathing, etc)&lt;/li&gt;
&lt;li&gt;Sounds or music so accompany to indicate when you breathe in, breath out, etc.&lt;/li&gt;
&lt;li&gt;A detailed tutorial on how to build your own focused breathing animation/app from scratch&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Additional Resources/Info
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ggia.berkeley.edu/practice/mindful_breathing" rel="noopener noreferrer"&gt;https://ggia.berkeley.edu/practice/mindful_breathing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.tckpublishing.com/reduce-stress-with-focused-breathing/" rel="noopener noreferrer"&gt;https://www.tckpublishing.com/reduce-stress-with-focused-breathing/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Animations/Using_CSS_animations" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Animations/Using_CSS_animations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://davidwalsh.name/css-variables-javascript" rel="noopener noreferrer"&gt;https://davidwalsh.name/css-variables-javascript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://css-tricks.com/updating-a-css-variable-with-javascript/" rel="noopener noreferrer"&gt;https://css-tricks.com/updating-a-css-variable-with-javascript/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>dohackathon</category>
      <category>css</category>
      <category>html</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Automatically Open the Current Directory in VS Code From Terminal</title>
      <dc:creator>Shannon Crabill</dc:creator>
      <pubDate>Mon, 28 Dec 2020 21:45:48 +0000</pubDate>
      <link>https://dev.to/scrabill/automatically-open-the-current-directory-in-vs-code-from-terminal-232d</link>
      <guid>https://dev.to/scrabill/automatically-open-the-current-directory-in-vs-code-from-terminal-232d</guid>
      <description>&lt;p&gt;Last year, I was blown away by some Terminal commands that I learned. My favorite one is &lt;code&gt;open .&lt;/code&gt; to open a Finder window for whichever directory you are currently in.&lt;/p&gt;

&lt;p&gt;At one point I had a similar command to instantly open a folder in VS Code (Visual Studio Code), but deleted it after I switched from VS Code to Atom. I’ve since switched &lt;em&gt;back&lt;/em&gt; to VS Code and after begrudgingly dragging folders into VS Code to open them, I decided to figure out how to enable that command.&lt;/p&gt;

&lt;p&gt;Luckily, it takes a few steps to activate.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;With VS Code running, enter &lt;code&gt;Command + Shift + P&lt;/code&gt; to open the Command Palette (or View &amp;gt; Command Palette from the menu bar)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgi21h7phvpo7d1n3cycw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgi21h7phvpo7d1n3cycw.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A search bar will open up. Search for “Shell” or “Shell Command” and you should see one named &lt;code&gt;Shell Command: install "code" command in PATH&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F27vded8s7wbv7b1urle7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F27vded8s7wbv7b1urle7.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select it and a confirmation &lt;code&gt;Shell command "code" successfully installed in PATH.&lt;/code&gt; should pop up (for me the pop up appeared in the lower, righthand corner).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl9oo0s5iwb4m7fxqyape.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl9oo0s5iwb4m7fxqyape.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If you already have a Terminal session running, quit or restart it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When you are in the directory with the files you want to open in VS Code, type &lt;code&gt;code .&lt;/code&gt; (that is the word “code” followed by a space, then a period) and the folder will automatically open in VS Code.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8pgw4nsysudj477aesme.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8pgw4nsysudj477aesme.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://shannoncrabill.com/blog/shell-command-open-directory-in-vscode/" rel="noopener noreferrer"&gt;Automatically Open the Current Directory in VS Code From Terminal&lt;/a&gt; appeared first on &lt;a href="https://shannoncrabill.com/blog" rel="noopener noreferrer"&gt;Shannon Crabill — Front End Software Engineer&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>todayilearned</category>
      <category>productivity</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Orphan Branches in Git</title>
      <dc:creator>Shannon Crabill</dc:creator>
      <pubDate>Mon, 14 Dec 2020 03:34:04 +0000</pubDate>
      <link>https://dev.to/scrabill/orphan-branches-in-git-1l12</link>
      <guid>https://dev.to/scrabill/orphan-branches-in-git-1l12</guid>
      <description>&lt;p&gt;You may run into a situation where a branch of a project doesn’t &lt;em&gt;need&lt;/em&gt; to share history with the main branch. I had this happen when I wanted to create a temporary landing page for a project I was working on deploying. The landing page would be a “coming soon” page with a short blurb, hosted on the domain the project will eventually live on. I had been working on this project for months, including building React for the frontend and Ruby on Rails for the backend. That’s a &lt;em&gt;lot&lt;/em&gt; of files and git history for a &lt;em&gt;temporary&lt;/em&gt;, static landing page.&lt;/p&gt;

&lt;p&gt;I did some Googling and learned that git supports &lt;code&gt;orphan&lt;/code&gt; branches. &lt;em&gt;An orphan branch, not surprisingly, has no parents (meaning, git history) when it is created&lt;/em&gt;. The history of the orphan branch is separate from other branches in the repository, including the main or root branch it was created from.&lt;/p&gt;

&lt;p&gt;Here’s a quick example of how to create an orphan branch and use cases.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating an Orphan Branch
&lt;/h2&gt;

&lt;p&gt;In your project repository, an orphan branch can be created with the following Terminal command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout &lt;span class="nt"&gt;--orphan&lt;/span&gt; BRANCH-NAME
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In my case, I want my new branch to be named &lt;code&gt;landing-page&lt;/code&gt;. With the &lt;code&gt;git checkout --orphan landing-page&lt;/code&gt; command, a &lt;code&gt;landing-page&lt;/code&gt; branch is created and checked out.&lt;/p&gt;

&lt;p&gt;Your terminal will print out something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;On branch main
nothing to commit, working tree clean
&lt;span class="o"&gt;(&lt;/span&gt;base&lt;span class="o"&gt;)&lt;/span&gt; mycomputer:orphan-branches myname&lt;span class="nv"&gt;$ &lt;/span&gt;git checkout &lt;span class="nt"&gt;--orphan&lt;/span&gt; landing-page
Switched to a new branch &lt;span class="s1"&gt;'landing-page'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At first, nothing will look different than if we created a branch without the &lt;code&gt;--orphan&lt;/code&gt; flag.&lt;/p&gt;

&lt;p&gt;While on your orphan branch, running &lt;code&gt;git log&lt;/code&gt; will return &lt;code&gt;your current branch 'landing-page' does not have any commits yet&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;base&lt;span class="o"&gt;)&lt;/span&gt; mycomputer:orphan-branches myname&lt;span class="nv"&gt;$ &lt;/span&gt;git log
fatal: your current branch &lt;span class="s1"&gt;'landing-page'&lt;/span&gt; does not have any commits yet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whereas &lt;code&gt;git log&lt;/code&gt; on your main brain will return a list of all previous commits and commit messages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;base&lt;span class="o"&gt;)&lt;/span&gt; mycomputer:orphan-branches myname&lt;span class="nv"&gt;$ &lt;/span&gt;git checkout main
Switched to branch &lt;span class="s1"&gt;'main'&lt;/span&gt;
&lt;span class="o"&gt;(&lt;/span&gt;base&lt;span class="o"&gt;)&lt;/span&gt; mycomputer:orphan-branches myname&lt;span class="nv"&gt;$ &lt;/span&gt;git log
commit 123.........................abc &lt;span class="o"&gt;(&lt;/span&gt;HEAD -&amp;gt; main&lt;span class="o"&gt;)&lt;/span&gt;
Author: myname &amp;lt;myname@email.com&amp;gt;
Date:   Mon Dec 28 16:08:50 2020

    initial commit of files to git repo
&lt;span class="o"&gt;(&lt;/span&gt;base&lt;span class="o"&gt;)&lt;/span&gt; mycomputer:orphan-branches myname&lt;span class="nv"&gt;$ &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In a use case like mine where your orphan branch does not need the files from the previous branch, type &lt;code&gt;git rm -rf .&lt;/code&gt; to remove &lt;em&gt;all&lt;/em&gt; content from that branch. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note that this will also delete your &lt;code&gt;.gitignore&lt;/code&gt; file so you’ll to have create a new one, if it’s needed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can then commit that change (removing all previous files) and start working in your empty, orphan branch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Cases
&lt;/h2&gt;

&lt;p&gt;What I liked about creating an orphan branch for the landing page, was that it made for one less repository or set of files to keep track of. I can still commit changes on the &lt;code&gt;landing-page&lt;/code&gt; branch and push them to a remote server just like my main or primary branch.&lt;/p&gt;

&lt;p&gt;Another plus is that apps like continuous deployment solutions like Digital Ocean or Netlify allow you to select which branch in your git repository it should deploy. Later, when I’ve finished my app on the &lt;code&gt;main&lt;/code&gt; branch, I can make &lt;em&gt;that&lt;/em&gt; the branch it listens to without having to do any additional configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://git-scm.com/docs/git-checkout"&gt;https://git-scm.com/docs/git-checkout&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The post &lt;a href="https://shannoncrabill.com/blog/git-orphan-branches/"&gt;Orphan Branches in Git&lt;/a&gt; appeared first on &lt;a href="https://shannoncrabill.com/blog"&gt;Shannon Crabill — Front End Software Engineer&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>git</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Doing the `.split()` with Javascript</title>
      <dc:creator>Shannon Crabill</dc:creator>
      <pubDate>Sat, 05 Dec 2020 23:57:45 +0000</pubDate>
      <link>https://dev.to/scrabill/doing-the-split-with-javascript-4aco</link>
      <guid>https://dev.to/scrabill/doing-the-split-with-javascript-4aco</guid>
      <description>&lt;p&gt;I recently learned that the &lt;code&gt;.split()&lt;/code&gt; method in Javascript can take in an &lt;em&gt;optional second argument that is the number of times it’ll split a given string&lt;/em&gt;. It’ll ignore everything &lt;em&gt;after&lt;/em&gt; the string has been split that number of times, even if there are additional matches.&lt;/p&gt;

&lt;p&gt;In this post, I will explain how &lt;code&gt;split()&lt;/code&gt; works, the arguments it takes in, and some example use cases.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding &lt;code&gt;.split()&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;If you are unfamiliar with &lt;code&gt;.split()&lt;/code&gt; in Javascript, it is a built-in method for breaking up a string into multiple parts, based on the character(s) that you define. This is the format for &lt;code&gt;.split()&lt;/code&gt; is as follows:&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;string to split&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;character[s]_to_split_by&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;numTimesToSplit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The parts that make up a valid &lt;code&gt;.split()&lt;/code&gt; method are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The string, or variable that references a string to be split. &lt;strong&gt;Required&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;A character or string to use as the point of reference on where to split the string. &lt;strong&gt;Required&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;A positive integer of the number of splits to make, after which &lt;code&gt;.split()&lt;/code&gt; will stop evaluating the string. &lt;strong&gt;Optional&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using the format above, if I wanted to split the string &lt;code&gt;"I love tacos!"&lt;/code&gt; so that each word is its own string, I can do the following.&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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I love tacos!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;split&lt;/span&gt;&lt;span class="p"&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="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which would return &lt;code&gt;['I', 'love', 'tacos!']&lt;/code&gt;. The original string is split on each empty space &lt;code&gt;" "&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Assigning &lt;code&gt;"I love tacos!"&lt;/code&gt; to a variable &lt;code&gt;string&lt;/code&gt;, returns the same result.&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;let&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I love tacos!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;split&lt;/span&gt;&lt;span class="p"&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="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Using the Optional &lt;code&gt;limit&lt;/code&gt; Argument
&lt;/h2&gt;

&lt;p&gt;Where I found using the optional &lt;em&gt;limit&lt;/em&gt; argument helpful was if I wanted to split a string into separate variables, but didn’t need all of the string I was calling the function on.&lt;/p&gt;

&lt;p&gt;Let’s say I had copy and pasted some &lt;a href="https://htmlcolorcodes.com/color-names/"&gt;HTML colors names&lt;/a&gt;, to use in an app I’m building. Each row contains the named color, it’s hex and rgb values. Picking a few samples, and putting each row as it’s own array item, we have something that looks 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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Gold #FFD700 rgb(255, 215, 0)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Indigo #4B0082 rgb(75, 0, 130)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Chartreuse #7FFF00 rgb(127, 255, 0)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;WhiteSmoke #F5F5F5 rgb(245, 245, 245)&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;Splitting each array item on each word break (&lt;code&gt;" "&lt;/code&gt;), returns 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="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Gold&lt;/span&gt;&lt;span class="dl"&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;#FFD700&lt;/span&gt;&lt;span class="dl"&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;rgb(255,&lt;/span&gt;&lt;span class="dl"&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;215,&lt;/span&gt;&lt;span class="dl"&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;0)&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Indigo&lt;/span&gt;&lt;span class="dl"&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;#4B0082&lt;/span&gt;&lt;span class="dl"&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;rgb(75,&lt;/span&gt;&lt;span class="dl"&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;0,&lt;/span&gt;&lt;span class="dl"&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;130)&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Chartreuse&lt;/span&gt;&lt;span class="dl"&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;#7FFF00&lt;/span&gt;&lt;span class="dl"&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;rgb(127,&lt;/span&gt;&lt;span class="dl"&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;255,&lt;/span&gt;&lt;span class="dl"&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;0)&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;WhiteSmoke&lt;/span&gt;&lt;span class="dl"&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;#F5F5F5&lt;/span&gt;&lt;span class="dl"&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;rgb(245,&lt;/span&gt;&lt;span class="dl"&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;245,&lt;/span&gt;&lt;span class="dl"&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;245)&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;This works. But it’s a little messy if we don’t care about the RGB values.&lt;/p&gt;

&lt;p&gt;If we pass in &lt;code&gt;2&lt;/code&gt; as the second argument &lt;code&gt;.split()&lt;/code&gt; will ignore everything after it’s made two split groups. If we call &lt;code&gt;.split(" ", 2)&lt;/code&gt; on each array item, the return looks like this instead.&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="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Gold&lt;/span&gt;&lt;span class="dl"&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;#FFD700&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Indigo&lt;/span&gt;&lt;span class="dl"&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;#4B0082&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Chartreuse&lt;/span&gt;&lt;span class="dl"&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;#7FFF00&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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;WhiteSmoke&lt;/span&gt;&lt;span class="dl"&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;#F5F5F5&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;h2&gt;
  
  
  Use Cases
&lt;/h2&gt;

&lt;p&gt;Here’s another example where using the &lt;em&gt;limit&lt;/em&gt; argument with &lt;code&gt;.split()&lt;/code&gt; is useful.&lt;/p&gt;

&lt;p&gt;Let’s say we have a bunch of phone numbers as strings and we want to assign the area code to its own variable. If our phone numbers are formatted like &lt;code&gt;"555-867-5309"&lt;/code&gt;, we can split on each hyphen.&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;let&lt;/span&gt; &lt;span class="nx"&gt;phone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;555-867-5309&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;areaCode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;phone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;split&lt;/span&gt;&lt;span class="p"&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="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It works, but now &lt;code&gt;areaCode&lt;/code&gt; returns &lt;code&gt;['555', '867', '5309']&lt;/code&gt;. With one small change to the above code, we can cleanly assign the area code to it’s own variable and ignore the rest of the phone number.&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;let&lt;/span&gt; &lt;span class="nx"&gt;phone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;555-867-5309&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;areaCode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;phone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;split&lt;/span&gt;&lt;span class="p"&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="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After we’ve made &lt;code&gt;1&lt;/code&gt; split on the first hyphen, the &lt;code&gt;.split()&lt;/code&gt; operation stops. &lt;code&gt;areaCode&lt;/code&gt; now returns &lt;code&gt;['555']&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional Information
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;.split()&lt;/code&gt; can break strings into smaller parts, but here are some additional things to keep in mind.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can split by more than one character&lt;/li&gt;
&lt;li&gt;The character[s] to split by are case sensitive&lt;/li&gt;
&lt;li&gt;Using &lt;code&gt;.split()&lt;/code&gt; does not modify the original string&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.split()&lt;/code&gt; can be used together with other built-in methods like &lt;code&gt;.join()&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split"&gt;String.prototype.split()&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.quora.com/What-is-a-real-world-use-case-for-splitting-a-string-in-JavaScript"&gt;What is a real world use case for splitting a string in JavaScript?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join"&gt;Array.prototype.join()&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The post &lt;a href="https://shannoncrabill.com/blog/split-javascript-method/"&gt;Doing the &lt;code&gt;.split()&lt;/code&gt; with Javascript&lt;/a&gt; appeared first on &lt;a href="https://shannoncrabill.com/blog"&gt;Shannon Crabill — Front End Software Engineer&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>todayilearned</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to Base64 Encode a String in Terminal</title>
      <dc:creator>Shannon Crabill</dc:creator>
      <pubDate>Sat, 28 Nov 2020 05:09:15 +0000</pubDate>
      <link>https://dev.to/scrabill/how-to-base64-encode-a-string-in-terminal-327b</link>
      <guid>https://dev.to/scrabill/how-to-base64-encode-a-string-in-terminal-327b</guid>
      <description>&lt;p&gt;While browsing some API documentation, I saw references to &lt;em&gt;Base64&lt;/em&gt; for passing credentials to the API. I had seen Base64 referenced a few times, but had no idea how to convert text into Base64.&lt;/p&gt;

&lt;p&gt;So, I did some digging.&lt;/p&gt;

&lt;p&gt;This post will outline how to encode (and decode) text into Base64 using the MacOS Terminal.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Base64?
&lt;/h2&gt;

&lt;p&gt;I should share a little bit about what Base64 is. The MDN documentation explains the overarching concept of Base64 as.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can think of Base64 is another way to represent binary or text data.&lt;/p&gt;

&lt;p&gt;The conversion process is somewhat detailed, and I encourage you to check out the resources at the bottom of this article if you are curious about the benefits and technical details of Base64.&lt;/p&gt;

&lt;h2&gt;
  
  
  Converting Text into Base64
&lt;/h2&gt;

&lt;p&gt;While reading those API docs, I had no idea how to create a Base64 string.&lt;/p&gt;

&lt;p&gt;There are converters a few Google searches away. But, did you know there’s a Base64 command built into the MacOS?&lt;/p&gt;

&lt;p&gt;To turn a string into Base64, open a new Terminal window, and use this format.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;base64 &amp;lt;&amp;lt;&amp;lt; string
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That would be &lt;code&gt;base64&lt;/code&gt; followed by a space, three less-than signs (&lt;code&gt;&amp;lt;&lt;/code&gt;), another space, then whatever &lt;code&gt;string&lt;/code&gt; you want to encode in Base64.&lt;/p&gt;

&lt;h3&gt;
  
  
  Here’s an example:
&lt;/h3&gt;

&lt;p&gt;If I wanted to convert the string &lt;code&gt;I love cheeseburgers&lt;/code&gt; into Base64, I would enter this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;base64 &amp;lt;&amp;lt;&amp;lt; "I love cheeseburgers"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which would print out &lt;code&gt;SSBsb3ZlIGNoZWVzZWJ1cmdlcnMK&lt;/code&gt; as a result.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: You only need quote marks around the string you would like to convert if it has space it in.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The following does not need quote marks, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;base64 &amp;lt;&amp;lt;&amp;lt; ilovecheeseburgers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're curious, &lt;code&gt;base64 &amp;lt;&amp;lt;&amp;lt; ilovecheeseburgers&lt;/code&gt; returns &lt;code&gt;aWxvdmVjaGVlc2VidXJnZXJzCg==&lt;/code&gt; which is very different from what &lt;code&gt;base64 &amp;lt;&amp;lt;&amp;lt; "I love cheeseburgers"&lt;/code&gt; returns.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decoding Base64
&lt;/h2&gt;

&lt;p&gt;With a similar command, you can decode Base64 back into human, readable text.&lt;/p&gt;

&lt;p&gt;Let’s say a friend of ours sent us the following code:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SSBsb3ZlIHlvdSBtb3JlCg==&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To decode Base64, we add a &lt;code&gt;-D&lt;/code&gt; flag before the three arrows and after &lt;code&gt;base64&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;base64 -D &amp;lt;&amp;lt;&amp;lt; SSBsb3ZlIHlvdSBtb3JlCg==
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which returns &lt;code&gt;I love you more&lt;/code&gt;. How sweet!&lt;/p&gt;

&lt;h2&gt;
  
  
  Base64 is Not Unique
&lt;/h2&gt;

&lt;p&gt;While a Base64 string like &lt;code&gt;SSBsb3ZlIGNoZWVzZWJ1cmdlcnMk&lt;/code&gt; looks random, &lt;strong&gt;it is not.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Each time I run &lt;code&gt;base64 &amp;lt;&amp;lt;&amp;lt; "I love cheeseburgers"&lt;/code&gt; it’ll return the same result. If you run the same code, you’ll get the same result. And since a Base64 string can be decoded, it’s not appropriate for hashing passwords, storing API keys, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://base64.guru/learn/what-is-base64"&gt;What is Base64?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Base64"&gt;Base64 on WikiPedia&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Glossary/Base64"&gt;Base64 on MDN&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The post &lt;a href="https://shannoncrabill.com/blog/base64-encoding-mac-terminal/"&gt;Base64 Encoding&lt;/a&gt; appeared first on &lt;a href="https://shannoncrabill.com/blog"&gt;Shannon Crabill — Front End Software Engineer&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>todayilearned</category>
      <category>coding</category>
    </item>
    <item>
      <title>Open Graph for Personal Projects</title>
      <dc:creator>Shannon Crabill</dc:creator>
      <pubDate>Sun, 08 Nov 2020 23:47:24 +0000</pubDate>
      <link>https://dev.to/scrabill/open-graph-for-personal-projects-3pdb</link>
      <guid>https://dev.to/scrabill/open-graph-for-personal-projects-3pdb</guid>
      <description>&lt;p&gt;A way to make your posts stand out on social media is to include images. According to Buffer, &lt;a href="https://buffer.com/resources/the-power-of-twitters-new-expanded-images-and-how-to-make-the-most-of-it/" rel="noopener noreferrer"&gt;Tweets with images can get up to 150% more retweets&lt;/a&gt;. So it makes sense to include some kind of visual element instead of dropping a link and calling it a day.&lt;/p&gt;

&lt;p&gt;For a long time, I wondered how some links I would share would automatically get nicely formatted images, headlines and links. Was it possible to implement something like that on my projects so that I automate and improve the link-sharing experience?&lt;/p&gt;

&lt;p&gt;Yes!&lt;/p&gt;

&lt;p&gt;This functionality can be implemented using &lt;a href="https://ogp.me/" rel="noopener noreferrer"&gt;The Open Graph protocol&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I’ll walk through how I step it up on one of my projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Implementing Open Graph&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The introduction says it well. In describing the Open Graph protocol, it says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Open Graph protocol enables any web page to become a rich object in a social graph.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The graph it refers to is an object that is created by including basic metadata tags in your webpage.&lt;/p&gt;

&lt;p&gt;Your website probably has metadata tags like &lt;code&gt;&amp;lt;meta charset="UTF-8"&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The Open Graph tags use the same, self-closing &lt;code&gt;&amp;lt;meta /&amp;gt;&lt;/code&gt; tag structure with some additions. Each Open Graph meta tag has &lt;code&gt;property&lt;/code&gt; and &lt;code&gt;content&lt;/code&gt; attributes. The &lt;code&gt;property&lt;/code&gt; attribute, describes or categorizes the value in the &lt;code&gt;content&lt;/code&gt; attribute.&lt;/p&gt;

&lt;p&gt;For Open Graph to work, there are 4 required properties for each webpage.&lt;/p&gt;

&lt;p&gt;Those properties are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;og:title&lt;/li&gt;
&lt;li&gt;og:type&lt;/li&gt;
&lt;li&gt;og:image&lt;/li&gt;
&lt;li&gt;og:url&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Detailed descriptions of these tags can be found in the &lt;a href="https://ogp.me/#metadata" rel="noopener noreferrer"&gt;Basic Metadata&lt;/a&gt; section of the documentation. But, they make up the core elements of those media-rich posts that we see on our Twitter and Facebook feeds.&lt;br&gt;&lt;br&gt;
Using my &lt;a href="https://halloweenti.me/" rel="noopener noreferrer"&gt;Halloweenti.me&lt;/a&gt; project as an example, my 4 meta tags look something like this.&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;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:title"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"How Many Days Until Halloween?"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:type"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"website"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:url"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"https://halloweenti.me/"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;property=&lt;/span&gt;&lt;span class="s"&gt;"og:image"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"https://halloweenti.me/my-image.jpg"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once my HTML file is pushed live, sharing the link to halloweenti.me automatically renders the image that I specified along with a title and URL to the website.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Looking Nice&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Prior to adding Open Graph, sharing the &lt;code&gt;https://halloweenti.me/&lt;/code&gt; link in Discord looked like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fshannoncrabill.com%2Fblog%2Fwp-content%2Fuploads%2F2020%2F11%2Fbefore.png%3Fresize%3D493%252C67%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fshannoncrabill.com%2Fblog%2Fwp-content%2Fuploads%2F2020%2F11%2Fbefore.png%3Fresize%3D493%252C67%26ssl%3D1"&gt;&lt;/a&gt;An example of what the URL looks like without The Open Graph protocols&lt;/p&gt;

&lt;p&gt;I mean, I think this site it awesome, but it’s probably not grabbing anyone else’s attention.&lt;/p&gt;

&lt;p&gt;This is how it looks now.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fshannoncrabill.com%2Fblog%2Fwp-content%2Fuploads%2F2020%2F11%2Fafter.png%3Fresize%3D428%252C383%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi0.wp.com%2Fshannoncrabill.com%2Fblog%2Fwp-content%2Fuploads%2F2020%2F11%2Fafter.png%3Fresize%3D428%252C383%26ssl%3D1"&gt;&lt;/a&gt;How the URL looks after including an image that I specified, title and description.&lt;/p&gt;

&lt;p&gt;Wow! That is easier to see and gives more context to a user who is just scrolling by. You can also see how the 4 required properties show up in the social media preview.&lt;/p&gt;

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

&lt;p&gt;What I like about The Open Graph Protocol is that it’s relatively easy to implement and there are additional meta tags that can be added for richer content examples. I included a description for my project, but there are tags that are relevent for dated content like blog posts are articles.&lt;/p&gt;

&lt;p&gt;I reccomend giving The Open Graph protocol a try so that your projects can better stand out on social media.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://blog.hubspot.com/marketing/visual-content-marketing-strategy" rel="noopener noreferrer"&gt;50 Visual Content Marketing Statistics You Should Know in 2020&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://buffer.com/resources/the-power-of-twitters-new-expanded-images-and-how-to-make-the-most-of-it/" rel="noopener noreferrer"&gt;How Twitter’s Expanded Images Increase Clicks, Retweets and Favorites [New Data]&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.opengraph.xyz/" rel="noopener noreferrer"&gt;Preview and Generate Open Graph Meta Tags&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ogp.me/" rel="noopener noreferrer"&gt;The Open Graph protocol&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/scrabill/social-media-preview-images-for-your-github-projects-4m04-temp-slug-6717962"&gt;Social Media Preview Images for Your GitHub Projects&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The post &lt;a href="https://shannoncrabill.com/blog/open-graph/" rel="noopener noreferrer"&gt;Open Graph for Personal Projects&lt;/a&gt; appeared first on &lt;a href="https://shannoncrabill.com/blog" rel="noopener noreferrer"&gt;Shannon Crabill — Front End Software Engineer&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>html</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>A Beginner’s Guide to Managing React State with Hooks</title>
      <dc:creator>Shannon Crabill</dc:creator>
      <pubDate>Sun, 25 Oct 2020 20:39:13 +0000</pubDate>
      <link>https://dev.to/scrabill/a-beginner-s-guide-to-managing-react-state-with-hooks-pe1</link>
      <guid>https://dev.to/scrabill/a-beginner-s-guide-to-managing-react-state-with-hooks-pe1</guid>
      <description>&lt;p&gt;Managing &lt;code&gt;state&lt;/code&gt; can be one of the more complex aspects of working with React as beginner.&lt;/p&gt;

&lt;p&gt;What data should be managed by &lt;code&gt;state&lt;/code&gt; versus &lt;code&gt;props&lt;/code&gt;, which components need to access &lt;code&gt;state&lt;/code&gt; and where &lt;code&gt;state&lt;/code&gt; should live are all questions I ask myself when planning a new &lt;code&gt;React&lt;/code&gt; project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://redux.js.org/"&gt;Redux&lt;/a&gt; is an alternative for managing &lt;code&gt;state&lt;/code&gt; it may be a lot to add for a small or simple project.&lt;/p&gt;

&lt;p&gt;While building an app that queries the Spotify API for an artist, based on the user input, it made since to store that input in &lt;code&gt;state&lt;/code&gt;. That input value could be passed to the API, referenced in the UI (“Showing results for: adele”) or elsewhere in the app.&lt;/p&gt;

&lt;p&gt;I learned to set up state as an object (&lt;code&gt;state = { key: value}&lt;/code&gt;) but did not know this only works in class components! And mine were set up as functional.&lt;/p&gt;

&lt;p&gt;Yikes.&lt;/p&gt;

&lt;p&gt;I did not want to make the conversion right away, so I did a quick Google search for an alternative. I landed on the &lt;code&gt;useState&lt;/code&gt; React Hook and had to give it a try.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Implementation&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Hooks are a somewhat mysterious aspect of React. I had not used one until now. Similar to other features in React like &lt;code&gt;componentDidMount&lt;/code&gt;, Hooks are built-in, modular functions of React. That’s it!&lt;/p&gt;

&lt;p&gt;To get started using the &lt;code&gt;useState&lt;/code&gt; Hook, it needs to be imported into your React file.&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="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&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;h2&gt;
  
  
  &lt;strong&gt;Define State&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Once &lt;code&gt;useState&lt;/code&gt; had been imported into your file, you can create and set state values. For my app, I want to store the input from a text field in state.&lt;/p&gt;

&lt;p&gt;Here’s what setting that up looks like:&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="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&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;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setInput&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What &lt;code&gt;useState&lt;/code&gt; does is it sets up a state variable &lt;em&gt;and&lt;/em&gt; a function that will update that variable. In my case, the variable is named &lt;code&gt;input&lt;/code&gt; and the function that updates &lt;code&gt;input&lt;/code&gt; is called &lt;code&gt;setInput&lt;/code&gt;. The empty string ("") within &lt;code&gt;useState&lt;/code&gt; is the default value for &lt;code&gt;input&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;From my understanding of the &lt;a href="https://reactjs.org/docs/hooks-state.html"&gt;Using the State Hook&lt;/a&gt; docs, the &lt;code&gt;state&lt;/code&gt; variable and it’s update function can be named anything. But, it makes sense to name them what they are/what they do, especially if there are multiple state variables.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, we’re ready to access and manipulate &lt;code&gt;state&lt;/code&gt; within our app!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Reference State&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Since state has been set up outside of a class, we do not need &lt;code&gt;this.state&lt;/code&gt; to reference within our app. In the &lt;code&gt;return()&lt;/code&gt; statement for &lt;code&gt;App()&lt;/code&gt;, input is referenced as &lt;code&gt;{input}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Given the following example:&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="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&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;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setInput&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="c1"&gt;// TODO: Write handleOnChange function&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;App&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Search&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nx"&gt;an&lt;/span&gt; &lt;span class="nx"&gt;artist&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;input&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;input&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;onChange&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;handleOnChange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/form&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h2&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Showing&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;{input}&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h2&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/main&lt;/span&gt;&lt;span class="err"&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;If the current value of the &lt;code&gt;input&lt;/code&gt; was “adele”, the &lt;code&gt;h2&lt;/code&gt; tag would render &lt;code&gt;Showing results for: "adele"&lt;/code&gt; to the page.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Update State&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To update the &lt;code&gt;input&lt;/code&gt; variable in &lt;code&gt;state&lt;/code&gt;, we’ll use the &lt;code&gt;setState&lt;/code&gt; variable we set up earlier.&lt;/p&gt;

&lt;p&gt;In the code sample above, you see that the text input field has an &lt;code&gt;onChange&lt;/code&gt; event. Each time the value of the text field changes (the user types in the field) a &lt;code&gt;handleOnChange&lt;/code&gt; function is fired. This function will house the update function.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;setInput&lt;/code&gt; could be used inline, but in my case it made more since to separate it into a &lt;code&gt;handleOnChange&lt;/code&gt; function, since that function would perform additional operations.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To update state, we call &lt;code&gt;setInput()&lt;/code&gt; and &lt;strong&gt;pass in the new value that will replace the current state&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here’s what &lt;code&gt;handleOnChange&lt;/code&gt; looks like in my example:&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;function&lt;/span&gt; &lt;span class="nx"&gt;handleOnChange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;setInput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;// TODO: Perform other operations&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it. The value of &lt;code&gt;input&lt;/code&gt; has been updated.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Recap&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To recap everything we’ve done:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We imported &lt;code&gt;useState&lt;/code&gt; into our functional component.&lt;/li&gt;
&lt;li&gt;Declared &lt;code&gt;state&lt;/code&gt; variables &lt;em&gt;and&lt;/em&gt; a function to update that variable with &lt;code&gt;useState&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Referenced the value of our &lt;code&gt;state&lt;/code&gt; variable &lt;code&gt;input&lt;/code&gt; in our and rendered on to the page. &lt;/li&gt;
&lt;li&gt;Updated &lt;code&gt;input&lt;/code&gt; using our &lt;code&gt;setInput&lt;/code&gt; function with the new value as the argument&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And here’s what our &lt;code&gt;App.js&lt;/code&gt; file looks like now:&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="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&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;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setInput&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;handleOnChange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;setInput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;// TODO: Query the Spotify API with the value of "input"&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;App&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Search&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nx"&gt;an&lt;/span&gt; &lt;span class="nx"&gt;artist&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;input&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;input&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;onChange&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;handleOnChange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/form&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h2&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Showing&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;{input}&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h2&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
        &lt;span class="c1"&gt;// TODO: Render results of API call to the page&lt;/span&gt;

    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/main&lt;/span&gt;&lt;span class="err"&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;This is the very beginning of what React Hooks can do. There are some limitations, &lt;a href="https://reactjs.org/docs/hooks-rules.html"&gt;rules&lt;/a&gt; and take some getting used to. I highly reccomend reading through their docs on &lt;a href="https://reactjs.org/docs/hooks-state.html"&gt;Using the State Hook&lt;/a&gt; to see how &lt;code&gt;useState&lt;/code&gt; compares to setting state in a class component.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Resources&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://reactjs.org/docs/hooks-state.html"&gt;Using the State Hook&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/aspittel/a-complete-beginner-s-guide-to-react-hooks-edition-1bi0"&gt;A Complete Beginner’s Guide to React: Hooks Edition&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The post &lt;a href="https://shannoncrabill.com/blog/beginners-guide-manage-state-react-hook/"&gt;A Beginner’s Guide to Managing React State with Hooks&lt;/a&gt; appeared first on &lt;a href="https://shannoncrabill.com/blog"&gt;Shannon Crabill — Front End Software Engineer&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>You Don’t Have to Participate in Hacktoberfest</title>
      <dc:creator>Shannon Crabill</dc:creator>
      <pubDate>Thu, 01 Oct 2020 17:48:57 +0000</pubDate>
      <link>https://dev.to/scrabill/you-don-t-have-to-participate-in-hacktoberfest-4hm8</link>
      <guid>https://dev.to/scrabill/you-don-t-have-to-participate-in-hacktoberfest-4hm8</guid>
      <description>&lt;p&gt;The first of October. The &lt;em&gt;official&lt;/em&gt; start of spooky season. And, if you follow the tech community, the beginning of &lt;a href="https://hacktoberfest.digitalocean.com/"&gt;Hacktoberfest&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Hacktoberfest is an annual event that encourages participation and contribution to open source projects. &lt;a href="https://hacktoberfest.digitalocean.com/register"&gt;Sign up&lt;/a&gt; during the month of October, make at least 4 &lt;em&gt;valid&lt;/em&gt; pull requests in public repos on Github and you can receive stickers and limited edition t-shirt.&lt;/p&gt;

&lt;p&gt;I’ve participated in Hacktoberfest for the past 3 years and it can be a lot of fun.&lt;/p&gt;

&lt;p&gt;It can also be a lot of work.&lt;/p&gt;

&lt;p&gt;This is especially true if you maintain a project. Tag issues with &lt;code&gt;hacktoberfest&lt;/code&gt; for visibility and your project will gain traffic and pull requests. &lt;a href="https://blog.domenic.me/hacktoberfest/"&gt;Most of them may be considered “spammy”&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Each year, in September (or &lt;em&gt;Preptember&lt;/em&gt;) the “get ready for Hacktoberfest”, “who’s looking for contributors” and “101 open source projects for beginners” posts go live, the emails to sign up come in. And it can all be a little overwhelming.&lt;/p&gt;

&lt;p&gt;Especially with everything going on in the world right now.&lt;/p&gt;

&lt;p&gt;This is why I’ll step in as your internet friend by telling you it is  &lt;strong&gt;ok not to participate in Hacktoberfest&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here are two reasons why.&lt;/p&gt;

&lt;h2&gt;
  
  
  Spare Time is a Luxury
&lt;/h2&gt;

&lt;p&gt;I have a lot of feelings about personal projects and coding outside of work. On one hand, personal projects are good for learning a new skill, or as a side hustle. Any reason that you want to code outside of your 9-5 is valid.&lt;/p&gt;

&lt;p&gt;But. Not everyone has the &lt;em&gt;privilege&lt;/em&gt; of spare time.&lt;/p&gt;

&lt;p&gt;Family commitments, second jobs, whatever. Extra time at a computer isn’t realistic for everyone. And that is &lt;em&gt;ok&lt;/em&gt;. There can be pressure, even if it’s from ourselves, to try and do all-of-the-things. But it’s not always possible.&lt;/p&gt;

&lt;p&gt;Please be realistic about what is important to you, your career, your family, etc. Be realistic about how much time exists in a day, week, month, etc and what time you can commit to.&lt;/p&gt;

&lt;p&gt;Which brings me to my next point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Self-care &amp;gt; Coding
&lt;/h2&gt;

&lt;p&gt;Coding is a big part of my life. I love it. I do it as part of my job. I code in my spare time and yet…I find myself &lt;em&gt;needing and wanting&lt;/em&gt; to spend more time away from the computer.&lt;/p&gt;

&lt;p&gt;Perhaps you feel the same way.&lt;/p&gt;

&lt;p&gt;As the days get shorter and the &lt;em&gt;longest year of our lives&lt;/em&gt; comes to an end…reflect on how you are feeling. If you feel as tired and exhausted as I do. It may be time to focus on self-care, recharging, and coming back refreshed.&lt;/p&gt;

&lt;p&gt;Self-care is whatever you need to do to recharge. As developers, I feel like there’s pressure to always be working on something, work/life balance tends to slip and, if you aren’t careful, burnout will set in.&lt;/p&gt;

&lt;p&gt;Trust me, time away from a computer will allow you to come back with fresh eyes, a fresh perspective, and ready to pick up where you left off.&lt;/p&gt;

&lt;h2&gt;
  
  
  Please Take Care of Yourself
&lt;/h2&gt;

&lt;p&gt;The main point I am trying to make here is that you do not have to participate in Hacktoberfest. You are no less of a developer if you sit out this year (or next year, or never participate). Do what you feels right to you and you will not be disappointed.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Photo by &lt;a href="https://unsplash.com/@cadop?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Mathew Schwartz&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/halloween?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://shannoncrabill.com/blog/you-dont-have-to-participate-in-hacktoberfest/"&gt;You Don’t Have to Participate in Hacktoberfest&lt;/a&gt; appeared first on &lt;a href="https://shannoncrabill.com/blog"&gt;Shannon Crabill — Front End Software Engineer&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
    </item>
    <item>
      <title>Queer Eye Text Effect in HTML &amp; CSS</title>
      <dc:creator>Shannon Crabill</dc:creator>
      <pubDate>Sun, 20 Sep 2020 01:32:28 +0000</pubDate>
      <link>https://dev.to/scrabill/queer-eye-text-effect-in-html-css-53d3</link>
      <guid>https://dev.to/scrabill/queer-eye-text-effect-in-html-css-53d3</guid>
      <description>&lt;p&gt;There’s never enough episodes of Queer Eye.&lt;/p&gt;

&lt;p&gt;😭&lt;/p&gt;

&lt;p&gt;To hold me over until the next season airs, I wanted to revisit the logo and see if I could recreate it in HTML and CSS.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Logo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xNX675Kq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/shannoncrabill.com/blog/wp-content/uploads/2020/09/Queereyelogo2.jpg%3Fresize%3D316%252C316%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xNX675Kq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i2.wp.com/shannoncrabill.com/blog/wp-content/uploads/2020/09/Queereyelogo2.jpg%3Fresize%3D316%252C316%26ssl%3D1" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The logo effect has a couple of different elements that I need to figure out.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Matching the font&lt;/li&gt;
&lt;li&gt;Picking the colors&lt;/li&gt;
&lt;li&gt;Offsetting the colors&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Fonts
&lt;/h2&gt;

&lt;p&gt;The font used is likely, a custom, sans-serif font. What makes it interesting is that the &lt;code&gt;e&lt;/code&gt; is stylistically a lowercase &lt;code&gt;e&lt;/code&gt; and the &lt;code&gt;Q&lt;/code&gt; is uppercase. Yet, visually have the same weight, stroke thickness, etc. Finding a free font that matches that may be difficult, so for now, I’ll focus on finding a typeface that has the same vibe.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://fonts.google.com/specimen/Kumbh+Sans"&gt;Kumbh Sans&lt;/a&gt; in Google Fonts has the modern look that I’m going for, so we’ll roll with it and fix the &lt;code&gt;e&lt;/code&gt; later if I can. With our “QE” in an &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; tag, our CSS will look 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="p"&gt;{&lt;/span&gt;
     &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;'Kumbh Sans'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
     &lt;span class="nl"&gt;font-weight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;300&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;Which renders something like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1t8k52Jh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/shannoncrabill.com/blog/wp-content/uploads/2020/09/Screen-Shot-2020-09-19-at-8.47.49-PM.png%3Fresize%3D517%252C373%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1t8k52Jh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/shannoncrabill.com/blog/wp-content/uploads/2020/09/Screen-Shot-2020-09-19-at-8.47.49-PM.png%3Fresize%3D517%252C373%26ssl%3D1" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Colors
&lt;/h2&gt;

&lt;p&gt;Looking at the logo above, it seems to be made of blue, pink, yellow and black, with the yellow and blue having some transparency to make a bright green.&lt;/p&gt;

&lt;p&gt;Let’s set up our colors as CSS variables.&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;--blue&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;191&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="py"&gt;--pink&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;255&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;147&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
     &lt;span class="py"&gt;--yellow&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;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="py"&gt;--black&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;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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With color variables, we can reference them like this &lt;code&gt;color: --var(yellow)&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Offsetting The Colors
&lt;/h2&gt;

&lt;p&gt;The fun part!&lt;/p&gt;

&lt;p&gt;Each of the colors is offset a little from the main text, but only to the left and right. We can get this effect by using a &lt;code&gt;text-shadow&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Let’s do the first color.&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="p"&gt;{&lt;/span&gt;
     &lt;span class="err"&gt;...&lt;/span&gt;
     &lt;span class="nl"&gt;text-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5vw&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--pink&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://res.cloudinary.com/practicaldev/image/fetch/s--3iuUlF-v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/shannoncrabill.com/blog/wp-content/uploads/2020/09/Screen-Shot-2020-09-19-at-9.00.23-PM.png%3Fresize%3D557%252C379%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3iuUlF-v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i1.wp.com/shannoncrabill.com/blog/wp-content/uploads/2020/09/Screen-Shot-2020-09-19-at-9.00.23-PM.png%3Fresize%3D557%252C379%26ssl%3D1" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, for the other colors.&lt;/p&gt;

&lt;p&gt;You can specify multiple &lt;code&gt;text-shadow&lt;/code&gt; effects at once, by separating them with a comma.&lt;/p&gt;

&lt;p&gt;Let’s add the rest of our colors and see how it looks.&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="p"&gt;{&lt;/span&gt;
     &lt;span class="err"&gt;...&lt;/span&gt;
     &lt;span class="nl"&gt;text-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
          &lt;span class="m"&gt;5vw&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--pink&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; 
          &lt;span class="m"&gt;10vw&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--blue&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; 
          &lt;span class="m"&gt;15vw&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--yellow&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://res.cloudinary.com/practicaldev/image/fetch/s--pcTBgbI4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/shannoncrabill.com/blog/wp-content/uploads/2020/09/Screen-Shot-2020-09-19-at-9.03.46-PM.png%3Fresize%3D626%252C382%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pcTBgbI4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/shannoncrabill.com/blog/wp-content/uploads/2020/09/Screen-Shot-2020-09-19-at-9.03.46-PM.png%3Fresize%3D626%252C382%26ssl%3D1" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Trippy.&lt;/p&gt;

&lt;p&gt;Not quite the effect we are going for, but it’s getting close. I’ll make some adjustments to the &lt;code&gt;text-shadow&lt;/code&gt; arguments, so that they shift to the left and right of the black text, without straying &lt;em&gt;so&lt;/em&gt; far away.&lt;/p&gt;

&lt;p&gt;By default, the first value, the X-coordinate, denotes how far to the right the &lt;code&gt;text-shadow&lt;/code&gt; starts. A negative value can be used so that the shadow starts to the left.&lt;/p&gt;

&lt;p&gt;And since most of our colors overlap, rearranging the order of the &lt;code&gt;text-shadow&lt;/code&gt; properties, allows all the colors to be seen.&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="p"&gt;{&lt;/span&gt;
     &lt;span class="err"&gt;...&lt;/span&gt;
     &lt;span class="nl"&gt;text-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; 
          &lt;span class="m"&gt;2vw&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--pink&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
          &lt;span class="m"&gt;-2vw&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--blue&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
          &lt;span class="m"&gt;-5vw&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--yellow&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://res.cloudinary.com/practicaldev/image/fetch/s--TojCfzMz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/shannoncrabill.com/blog/wp-content/uploads/2020/09/Screen-Shot-2020-09-19-at-9.09.35-PM.png%3Fresize%3D588%252C395%26ssl%3D1" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TojCfzMz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i0.wp.com/shannoncrabill.com/blog/wp-content/uploads/2020/09/Screen-Shot-2020-09-19-at-9.09.35-PM.png%3Fresize%3D588%252C395%26ssl%3D1" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nice!&lt;/p&gt;

&lt;p&gt;At this point, we’re only missing some green, created by a semi-transparent blue and yellow blending together. The opacity may take some tweaking, so I’ll add that as another CSS variable that I can then reference in the &lt;code&gt;--blue&lt;/code&gt; variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:root {
    --opacity: .75;
    --blue: rgb(0, 191, 255, var(--opacity));
    --pink: rgb(255, 20, 147);
    --yellow: rgb(255, 255, 0);
    --black: rgb(0,0,0);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Putting it all Together
&lt;/h2&gt;

&lt;p&gt;And our end result looks like this.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/scrabill/embed/yLORGEv?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;br&gt;
default-tab&lt;/p&gt;

&lt;p&gt;Yasss!&lt;/p&gt;

&lt;p&gt;Antoni, Tan, Karamo, Bobby, and Johathan would be proud.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://htmlcolorcodes.com/color-names/"&gt;https://htmlcolorcodes.com/color-names/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/14492695/css-color-names-alpha-transparency"&gt;https://stackoverflow.com/questions/14492695/css-color-names-alpha-transparency&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://css-tricks.com/snippets/css/css-text-shadow/"&gt;https://css-tricks.com/snippets/css/css-text-shadow/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The post &lt;a href="https://shannoncrabill.com/blog/queer-eye-text-effect-html-css/"&gt;Queer Eye Text Effect in HTML &amp;amp; CSS&lt;/a&gt; appeared first on &lt;a href="https://shannoncrabill.com/blog"&gt;Shannon Crabill — Front End Software Engineer&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>css</category>
      <category>html</category>
      <category>showdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Drab to Fab: Makeover Your Project README In 3 Steps</title>
      <dc:creator>Shannon Crabill</dc:creator>
      <pubDate>Sat, 29 Aug 2020 21:44:39 +0000</pubDate>
      <link>https://dev.to/scrabill/drab-to-fab-makeover-your-project-readme-in-3-steps-5djk</link>
      <guid>https://dev.to/scrabill/drab-to-fab-makeover-your-project-readme-in-3-steps-5djk</guid>
      <description>&lt;p&gt;Oh yeah! We’re giving your README a makeover!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/RN7sS7I1mp4JHknwDF/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/RN7sS7I1mp4JHknwDF/giphy.gif" alt="The cast of Queer Eye dancing"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The README will be one of the first things someone sees when they view your project. Think of it as the subject line to your email, or the elevator pitch to your presentation. The README is the opportunity to get someone interested in your open source project, or to convince them that you’re an awesome developer or simply to show off the cool project you’ve been working on in your spare time.&lt;/p&gt;

&lt;p&gt;Yet, sometimes the README is forgotten. I get it, the code just needs to work sometimes. But, I highly encourage you to take a look at your project’s READMEs and iterate on them.&lt;/p&gt;

&lt;p&gt;Here are 3 areas to focus on when updating or creating your project READMEs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Describe Your Project
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/YSpimUlx11gkWBbYWy/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/YSpimUlx11gkWBbYWy/giphy.gif" alt='Bobby Berk saying "You write your own destiny"'&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I know, this probably sounds obvious, but you would be surprised. Dig deep enough into my Github profile and you’ll find a few repos with the default, outdated content, or—gasp—no READMEs at all. Writing about your work is a whole, big topic I’ll go into detail on another time. But, for your README, it can be straightforward.&lt;/p&gt;

&lt;p&gt;Some questions to ask yourself when writing your project description include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What technologies does this project use?&lt;/li&gt;
&lt;li&gt;How can someone else use it?&lt;/li&gt;
&lt;li&gt;Why was it created? Or, what problem does it solve?&lt;/li&gt;
&lt;li&gt;Is this repo part of a bigger project or does it exist on its own?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Overall, a few lines explaining what your project is, what you used to build, and why, may be all you need to include. Think of the description as a concise, one-paragraph summary to your project to entice someone to know more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation Instructions
&lt;/h2&gt;

&lt;p&gt;Raise your hand if you’ve come across a README that had vague installation instructions!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/uTrNlrijcGHwiuteSW/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/uTrNlrijcGHwiuteSW/giphy.gif" alt='Jonathan Van Ness raising their hands and saying "Yes. Yes"'&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To help save someone else from experiencing this, with my projects, I like to take a literal step by step approach to getting it up and running locally. I’ll start by doing a fresh clone of my repo on my Desktop or anywhere other than where I usually work on the project locally.&lt;/p&gt;

&lt;p&gt;Then, write down exactly the next step is to getting it up and running. Include if there are any packages to include or API keys to fill in or if a certain command needs to be run in a specific directory. I like including the exact terminal commands in tick marks, for example &lt;code&gt;git clone https://github.com/scrabill/cactus-buddy&lt;/code&gt;, for easy copy and pasting from the README.&lt;/p&gt;

&lt;h2&gt;
  
  
  Link To a Live Version
&lt;/h2&gt;

&lt;p&gt;This may not apply to all projects, but it’s something to think about. If the goal of creating personal projects is to have something to show potential employers, you cannot always expect someone to be able to—or have the time to—clone it to their machine, get it up and running and &lt;em&gt;then&lt;/em&gt; navigate the codebase.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/PiWYXOAWS1ti9m2k1r/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/PiWYXOAWS1ti9m2k1r/giphy.gif" alt="Tan France saying &amp;quot;That's impressive&amp;quot; and giving a high five"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In my bootcamp experience, a stretch task was to have the portfolio project built deployed online so that they can be used/viewed in the browser. Not only does this make a project easier to look at, experience, evaluate by others, but it also shows additional skills at being able to use cloud applications like Netlify, Heroku or Amazon Web Services.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/MdjWjDq9e0gPBS1sDX/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/MdjWjDq9e0gPBS1sDX/giphy.gif" alt="Antoni Porowski excitedly saying &amp;quot;On that note...let's go!&amp;quot;"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you can, I encourage you to take a critical eye at your own READMEs and do an audit. Put yourself in the shoes of someone who is coming across your project for the first time, with no context on what it’s about.&lt;/p&gt;

&lt;p&gt;Some things to think about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does your README accurately explain what your project is?&lt;/li&gt;
&lt;li&gt;What about how you built it? &lt;/li&gt;
&lt;li&gt;If the project is open to contributions, does the README clearly state that?&lt;/li&gt;
&lt;li&gt;Are the installation instructions missing any gaps or not work as expected? &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Consider getting a friend, technical or non-technical, to take a look at your README and offer their initial thoughts. Other developers will likely be seeing your project, but so may potential hiring managers and recruiters. They may only have a few seconds to look at your project’s README to evaluate if you have the technical and communication skills they are looking for in an individual contributor.&lt;/p&gt;

&lt;p&gt;What updates will you make to your README today?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/d5JGrmuuuEVIWgsnkz/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/d5JGrmuuuEVIWgsnkz/giphy.gif" alt='Karamo Brown saying "You got this, boo" in encouragement'&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cover image by me!&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://shannoncrabill.com/blog/improve-your-project-readme/"&gt;Drab to Fab: Makeover Your Project README In 3 Steps&lt;/a&gt; appeared first on &lt;a href="https://shannoncrabill.com/blog"&gt;Shannon Crabill — Front End Software Engineer&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>bestpractices</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Amending Git Commits</title>
      <dc:creator>Shannon Crabill</dc:creator>
      <pubDate>Sat, 15 Aug 2020 05:31:57 +0000</pubDate>
      <link>https://dev.to/scrabill/amending-git-commits-1ae8</link>
      <guid>https://dev.to/scrabill/amending-git-commits-1ae8</guid>
      <description>&lt;p&gt;A best practice when using version control like git, is that commits should be small and relate to one aspect of your codebase. For example, a commit should include a correction for one function, in one part of your app, and not and update to a function, a new fetch request, and documentation changes. Think about it this way. If you had to revert or correct a change in a commit that touched many files or many aspects of a project, it would take more work and increase the likelihood of errors.&lt;/p&gt;

&lt;p&gt;Similar to writing functions with a single responsibility, your commits and commit messages should equally concise.&lt;/p&gt;

&lt;p&gt;While making some updates to a project of mine, I made the mistake of lumping two groups of code changes into one commit. Since this is a personal project, that likely I will only work on, it’s not the end of the world. However, I try to follow best practices whenever I can. Previously, if I lumped to much code into one commit. I’d make a new commit, reverting the changes (or, what changes I could remember 😬). Then, make a new commit, with part one of the changes I made the first time. Then &lt;em&gt;another&lt;/em&gt; commit with part two of the changes.&lt;/p&gt;

&lt;p&gt;This is messy and again, creates room for error.&lt;/p&gt;

&lt;p&gt;Fortunately, there is an easier way.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;git commit –amend&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;With the command &lt;code&gt;git commit –amend&lt;/code&gt; you can do two things.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Update the &lt;em&gt;message&lt;/em&gt; associated with the most recent commit&lt;/li&gt;
&lt;li&gt;Update the &lt;em&gt;content&lt;/em&gt; associated with the most recent commit&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I’ll walk through how to do the latter, although the steps are similar.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note.&lt;/strong&gt; Your terminal set up or exact commands &lt;em&gt;may&lt;/em&gt; looks different, depending on your computer set up. I use a Mac OS, Bash Terminal and either Atom or Visual Studio Code for editing files.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Oops! Too much code.
&lt;/h2&gt;

&lt;p&gt;In my scenario, I was making some updates to the CSS of my personal website. I replaced any hardcoded hex values with CSS variables and adding some smooth scrolling behavior. Here’s a simplified version of my “oops” commit with too many code changes.&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;root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="py"&gt;--primary-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#981ceb&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
     &lt;span class="py"&gt;--secondary-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#111111&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;

&lt;span class="nt"&gt;html&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
     &lt;span class="py"&gt;scroll-behavior&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;smooth&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:visited&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:active&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
     &lt;span class="nl"&gt;border-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--primary-color&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="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--primary-color&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="o"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That &lt;code&gt;scroll-behavior&lt;/code&gt; attribute shouldn’t be there! But it’s ok, we can &lt;code&gt;amend&lt;/code&gt; this commit, get rid of that extra code and keep our commit history nice and clean.&lt;/p&gt;

&lt;h2&gt;
  
  
  Updating the Commit
&lt;/h2&gt;

&lt;p&gt;First, in the same branch as the “oops” commit, make your changes. In my case, I’ll remove the &lt;code&gt;scroll-behavior&lt;/code&gt; line. My CSS file now looks 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;root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="py"&gt;--primary-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#981ceb&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
     &lt;span class="py"&gt;--secondary-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#111111&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;

&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:visited&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:active&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
     &lt;span class="nl"&gt;border-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--primary-color&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="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--primary-color&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="o"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note.&lt;/strong&gt; At this step, you can also &lt;em&gt;add&lt;/em&gt; code (or files) that you forgot to add to the previous commit.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Next, in your terminal, run &lt;code&gt;git commit --amend&lt;/code&gt; which will drop you into the commit editor. If you haven’t seen it before, there can be a lot going on. Mine looked something like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;Oops - This commit has too much code in it. 

&lt;span class="gh"&gt;# Please enter the commit message for your changes. Lines starting&lt;/span&gt;
&lt;span class="gh"&gt;# with '#' will be ignored, and an empty message aborts the commit.&lt;/span&gt;
&lt;span class="gh"&gt;#&lt;/span&gt;
&lt;span class="gh"&gt;# Date: Sat Aug 15 00:02:16 2020 -0400&lt;/span&gt;
&lt;span class="gh"&gt;#&lt;/span&gt;
&lt;span class="gh"&gt;# On branch master&lt;/span&gt;
&lt;span class="gh"&gt;# Changes to be committed:&lt;/span&gt;
&lt;span class="gh"&gt;# modified: styles.css#&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to keep the commit message the same, hit &lt;code&gt;esc&lt;/code&gt; then type &lt;code&gt;:wq&lt;/code&gt; to exit the editor and go back to your terminal.&lt;/p&gt;

&lt;p&gt;That’s it!&lt;/p&gt;

&lt;p&gt;If you type &lt;code&gt;git log&lt;/code&gt; you will see your commits, with the most recent one—the one you just corrected—on top.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;No One Gets Time Travel Right&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This is the very top of the iceberg of what rewriting history in git can look like. Always proceed with caution, especially in a larger project that other developers may be working on, forking, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History"&gt;7.6 Git Tools – Rewriting History&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.atlassian.com/git/tutorials/rewriting-history"&gt;Rewriting History&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The post &lt;a href="https://shannoncrabill.com/blog/amending-git-commits/"&gt;Amending Git Commits&lt;/a&gt; appeared first on &lt;a href="https://shannoncrabill.com/blog"&gt;Shannon Crabill — Front End Software Engineer&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>todayilearned</category>
      <category>git</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Approaching Problems like a Software Engineer</title>
      <dc:creator>Shannon Crabill</dc:creator>
      <pubDate>Sat, 08 Aug 2020 23:15:28 +0000</pubDate>
      <link>https://dev.to/scrabill/approaching-problems-like-a-software-engineer-2ejf</link>
      <guid>https://dev.to/scrabill/approaching-problems-like-a-software-engineer-2ejf</guid>
      <description>&lt;p&gt;During a recent, mock technical interview, I was given the following problem to solve.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Write a function that takes in two inputs, an array, and a number. Remove the first item in the array. Then, move it to the last place in the array. Repeat this the number of times as given in the second argument and return the array.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For example, if the given array is &lt;code&gt;[1,2,3]&lt;/code&gt;, and the number of times it should shuffle is 1, the function should return &lt;code&gt;[2,3,1]&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Break Down the Problem
&lt;/h2&gt;

&lt;p&gt;Given the problem, I thought about the main components (or problems) I would need to make things work.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remove the first item in the area (the item at place &lt;code&gt;array[0]&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Take the removed item and place is at the end of the array (it becomes the item at place &lt;code&gt;array[array.length -1]&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Repeat the above for each time the second argument specified&lt;/li&gt;
&lt;li&gt;Return the shuffled array&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Knowing that the act of removing an item and placing it into the array would have to happen x numbers of times, a &lt;code&gt;for&lt;/code&gt; loop seemed like a good place to start. Within that loop I could remove the first item in the array with &lt;code&gt;.shift()&lt;/code&gt; then add it back onto the end of the array with &lt;code&gt;.push()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Putting that together into a function, our solution could look 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="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;moveToEnd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;itemToMove&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shift&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;itemToMove&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;array&lt;/span&gt;    
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Given the following inputs:&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;moveToEnd&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="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&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="nx"&gt;moveToEnd&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="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;moveToEnd&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="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We get the following outputs:&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="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&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="mi"&gt;3&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="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&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="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It works!&lt;/p&gt;

&lt;p&gt;While this solution does work, it may not be the &lt;em&gt;best&lt;/em&gt; way to approach the problem. Let’s think about some possible edge cases that we have not accounted for.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run Time
&lt;/h2&gt;

&lt;p&gt;In the sample code, I have three simple examples of what the inputs and outputs could look like. The array is relatively small, so have been the number of times the &lt;code&gt;for&lt;/code&gt; loop needs to run.&lt;/p&gt;

&lt;p&gt;In Javascript, an array can be any size. Shuffling through an array of 1000 items would take longer than shuffling through an array of 3 items. An array of 1,000,000 items would take even longer. Alternatively, if a 3 item array needed to be shuffled 1,000,000 times, it would take longer than removing an item from the front and placing it on the end 3 times.&lt;/p&gt;

&lt;p&gt;Time complexity, runtime, and Big O notation are some of the concepts in computer science surrounding the idea of how fast, slow, or performant a program or function is. These concepts are too complex to cover in this blog post, however, we can keep the idea of runtime in mind as we refactor the &lt;code&gt;moveToEnd&lt;/code&gt; function.&lt;/p&gt;

&lt;h2&gt;
  
  
  Noticing Patterns
&lt;/h2&gt;

&lt;p&gt;Focusing on one aspect of the function, the user inputs, we can improve our solution a little bit.&lt;/p&gt;

&lt;p&gt;Going back to our earlier examples, let’s shuffle the &lt;code&gt;[1,2,3]&lt;/code&gt; array a few more times.&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;moveToEnd&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="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&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="c1"&gt;// expected return [2,3,1]&lt;/span&gt;
&lt;span class="nx"&gt;moveToEnd&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="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// expected return [3,1,2]&lt;/span&gt;
&lt;span class="nx"&gt;moveToEnd&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="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// expected return [1,2,3]&lt;/span&gt;
&lt;span class="nx"&gt;moveToEnd&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="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// expected return [2,3,1]&lt;/span&gt;
&lt;span class="nx"&gt;moveToEnd&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="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// expected return [3,1,2]&lt;/span&gt;
&lt;span class="nx"&gt;moveToEnd&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="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// expected return [1,2,3]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You may see a pattern here.&lt;/p&gt;

&lt;p&gt;If the array is shuffled 1 time or 4 times, the resulting array (&lt;code&gt;[2,3,1]&lt;/code&gt;) is the same. Each time &lt;code&gt;number&lt;/code&gt; is incremented by 1, the resulting array is the same as every 3rd instance. Another interesting thing is that when the array is shuffled 3 times (or a multiple of 3 with 0 as a remainder) the resulting array is the same as the original array.&lt;/p&gt;

&lt;p&gt;This is interesting to think about.&lt;/p&gt;

&lt;p&gt;If the return of a function is the same when we shuffle the array 1 time, 3 times or 6,000,000 times, do we really need our &lt;code&gt;for&lt;/code&gt; loop to run 6,000,000 times?&lt;/p&gt;

&lt;p&gt;No.&lt;/p&gt;

&lt;p&gt;We can make our code a little more performant by simplifying our &lt;code&gt;number&lt;/code&gt; to be as small as possible in comparison to the &lt;code&gt;array&lt;/code&gt; then running the &lt;code&gt;for&lt;/code&gt; loop that many times.&lt;/p&gt;

&lt;p&gt;Here are some scenarios to think about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If number is less than then the length of the &lt;code&gt;array&lt;/code&gt; run the for loop&lt;/li&gt;
&lt;li&gt;If number is greater than length of the &lt;code&gt;array&lt;/code&gt;, divide it by the length of the &lt;code&gt;array&lt;/code&gt;, then use the remainder to run the for loop&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are a few ways to tackle this, but for the purpose of this example, I’ll use an if statement to evaluate the value of the number argument.&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="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;number&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;   
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the second line, we use the &lt;em&gt;modulus&lt;/em&gt; operator to return the remainder and assign it to the &lt;code&gt;number&lt;/code&gt; variable, that is then used in the &lt;code&gt;for&lt;/code&gt; loop.&lt;/p&gt;

&lt;p&gt;Our updated function now looks 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="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;moveToEnd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&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;number&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;   

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;itemToMove&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shift&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;itemToMove&lt;/span&gt;&lt;span class="p"&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="nx"&gt;array&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;With this addition, our &lt;code&gt;for&lt;/code&gt; loop will run a relatively small number of times compared to what the &lt;code&gt;number&lt;/code&gt; argument could be.&lt;/p&gt;

&lt;h2&gt;
  
  
  What else?
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;moveToEnd&lt;/code&gt; problem is relatively easy to solve on purpose. Solving problems as an engineer is part of getting to a solution that works. And part getting to a solution that &lt;em&gt;scales&lt;/em&gt;, accounts for edge cases or has minimal trade-offs or side effects.&lt;/p&gt;

&lt;p&gt;In technical interviews, you may not have all the answers to what inputs could look like, what outputs should be, or other factors to consider. But, that’s on purpose. It’s on you, as the developer, to ask clarifying questions to help guide you to an optimal solution.&lt;/p&gt;

&lt;p&gt;For example, when I was posed with this problem, I asked if it was ok to mutate the original array, or if I should return a new, shuffled array, leaving the original intact. If I was approaching this problem now, I may think about if my solution works with a nested array. Or, to account for if the &lt;code&gt;number&lt;/code&gt; argument is not an integer or less is less than 0. Going a little deeper, I may revisit the for loop to see if there is a better option.&lt;/p&gt;

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

&lt;p&gt;Again, moving items in an array may not be a scenario you will encounter in the real world. But, thinking about making your code efficient is something you will encounter. Challenge yourself to revisit code you have written and refactor it to account for less-than-ideal user inputs, time complexity any other edge cases you can think of.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Edge_case"&gt;https://en.wikipedia.org/wiki/Edge_case&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/30135113/shifting-a-javascript-array-one-spot-to-the-left-without-using-the-shift-met"&gt;https://stackoverflow.com/questions/30135113/shifting-a-javascript-array-one-spot-to-the-left-without-using-the-shift-met&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://codepen.io/scrabill/pen/dyMoovm?editors=0011"&gt;https://codepen.io/scrabill/pen/dyMoovm?editors=0011&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;bigocheatsheet.com&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.freecodecamp.org/news/time-complexity-of-algorithms/"&gt;https://www.freecodecamp.org/news/time-complexity-of-algorithms/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.lavieencode.net/podcast/029-7-steps-to-solving-code-challenges/"&gt;https://www.lavieencode.net/podcast/029-7-steps-to-solving-code-challenges/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Photo by &lt;a href="https://unsplash.com/photos/4Ennrbj1svk"&gt;Olav Ahrens Røtne&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The post &lt;a href="https://shannoncrabill.com/blog/approaching-problems-like-a-software-engineer/"&gt;Approaching Problems like a Software Engineer&lt;/a&gt; appeared first on &lt;a href="https://shannoncrabill.com/blog"&gt;Shannon Crabill — Software Engineer &amp;amp;&amp;amp; Email Developer&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>career</category>
      <category>algorithms</category>
      <category>codenewbie</category>
    </item>
  </channel>
</rss>
