<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: ann lin</title>
    <description>The latest articles on Forem by ann lin (@annlin).</description>
    <link>https://forem.com/annlin</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%2F75183%2F6d4f4d6c-7d7c-4156-b72a-4821fb7e6d62.jpg</url>
      <title>Forem: ann lin</title>
      <link>https://forem.com/annlin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/annlin"/>
    <language>en</language>
    <item>
      <title>Console.log with CSS Style</title>
      <dc:creator>ann lin</dc:creator>
      <pubDate>Mon, 25 Mar 2019 17:34:25 +0000</pubDate>
      <link>https://forem.com/annlin/consolelog-with-css-style-1mmp</link>
      <guid>https://forem.com/annlin/consolelog-with-css-style-1mmp</guid>
      <description>&lt;p&gt;I remember when I was young and naive, I accidentally right clicked on Facebook browser and saw this HUGE ASS WARNING. I thought it was cute. Guess who has the same warning. (Something that ends with plus)&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%2Fuploads%2Farticles%2F7hnlcowtyi304imv3brt.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%2Fuploads%2Farticles%2F7hnlcowtyi304imv3brt.png" alt="Facebook's warning log"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Spoiler alert, it's still there.&lt;/p&gt;

&lt;p&gt;Most modern browsers support styling for &lt;code&gt;console.log()&lt;/code&gt;, except for Safari. (Whut) Add &lt;code&gt;%c&lt;/code&gt; before the text in the first parameter and CSS style in the next parameter.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
 js
      console.log(
        "%cStop!",
        "color:red;font-family:system-ui;font-size:4rem;-webkit-text-stroke: 1px black;font-weight:bold"
      );


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

&lt;/div&gt;

&lt;p&gt;&lt;b&gt;Tip&lt;/b&gt;: Right click on this page and click on inspect. Paste the above code in the console now.&lt;br&gt;
&lt;b&gt;Another tip&lt;/b&gt;: This tutorial is meant to impress noob. If you already know this, move on with your life.&lt;/p&gt;

&lt;p&gt;You can have multiple CSS styles in a &lt;code&gt;console.log()&lt;/code&gt; by using the format below.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
 js
console.log('%cb %cb ', 'color:blue;border:1px solid black', 'color:black;border:1px solid black');


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

&lt;/div&gt;
&lt;p&gt;You may be able to use CSS style with other methods in &lt;code&gt;Console&lt;/code&gt;. While I still enjoy misusing the good old &lt;code&gt;console.log&lt;/code&gt; in my code, the right approach would be to use a debug module like &lt;code&gt;https://www.npmjs.com/package/debug&lt;/code&gt; that allows you to show and hide the log easily.&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo,
&lt;/h2&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/linxea/embed/OdgGqP?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;br&gt;
Right click in this page to see the console.log().&lt;/p&gt;
&lt;h2&gt;
  
  
  Question,
&lt;/h2&gt;

&lt;p&gt;What does the &lt;code&gt;c&lt;/code&gt; in &lt;code&gt;%c&lt;/code&gt; stand for? &lt;br&gt;
a. CSS&lt;br&gt;
b. Custom&lt;br&gt;
c. Character&lt;br&gt;
d. None of the above&lt;/p&gt;

&lt;p&gt;Reference:&lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/console" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/API/console&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  New day new cringey video,
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/FU7aRSfrR_M"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>browserfeature</category>
      <category>consolelog</category>
      <category>css</category>
    </item>
    <item>
      <title>Drawing Pixelated Image with CSS box-shadow</title>
      <dc:creator>ann lin</dc:creator>
      <pubDate>Mon, 04 Feb 2019 15:54:39 +0000</pubDate>
      <link>https://forem.com/annlin/drawing-pixelated-image-with-css-box-shadow-j2b</link>
      <guid>https://forem.com/annlin/drawing-pixelated-image-with-css-box-shadow-j2b</guid>
      <description>&lt;p&gt;Do you know that you can draw with CSS &lt;code&gt;box-shadow&lt;/code&gt;? Neither did I until I came across a pretty dope pixelated Ralph by Jason Delia. Check out that &lt;a href="https://dev.to/linxea/wreck-it-ralph-2-virus-popup-58gm"&gt;Wreck a Ralph demo&lt;/a&gt; and my ugly &lt;a href="https://dev.to/linxea/star-wars-hyperjump-1mf0"&gt;Millennium Falcon drawing&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let's get started!&lt;/p&gt;

&lt;h3&gt;
  
  
  First, create a block using &lt;code&gt;div&lt;/code&gt;.
&lt;/h3&gt;

&lt;p&gt;The box shadow will follow the &lt;code&gt;div&lt;/code&gt;'s &lt;code&gt;width&lt;/code&gt; and &lt;code&gt;height&lt;/code&gt;. You can apply multiple shadows to a &lt;code&gt;box-shadow&lt;/code&gt; by separating the attributes of a shadow &lt;code&gt;position-x position-y blur-radius color&lt;/code&gt; with commas. &lt;/p&gt;

&lt;p&gt;Basic building block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;.block {
    width: 10px;
    height: 10px;
    box-shadow: 0 0 0 black, 10px 0 0 black;
}

&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"block"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Second, plan your image using coordinates.
&lt;/h3&gt;

&lt;p&gt;I patiently drew out the coordinates &lt;code&gt;(x,y)&lt;/code&gt; of my perfect heart for your reference. You're welcome. The &lt;code&gt;div&lt;/code&gt; starts at the top left box with coordinate &lt;code&gt;(0,0)&lt;/code&gt;. Each box shadow has the same height &lt;code&gt;(20px)&lt;/code&gt; and width &lt;code&gt;(20px)&lt;/code&gt; as the &lt;code&gt;div&lt;/code&gt;.&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%2Fuploads%2Farticles%2F3lvi9s1dmvanebv1u2j7.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%2Fuploads%2Farticles%2F3lvi9s1dmvanebv1u2j7.png" alt="Coordinates of box shadow"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice I added &lt;code&gt;margin-bottom&lt;/code&gt; in &lt;code&gt;.heart-shadow&lt;/code&gt;. As obvious as the name sounds, &lt;code&gt;box-shadow&lt;/code&gt; is a shadow that does not increase the size of &lt;code&gt;div&lt;/code&gt;. You may want to set margin to prevent covering other DOM elements.&lt;/p&gt;

&lt;p&gt;Code snippet in HTML and CSS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.heart&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;20px&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;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="nl"&gt;margin-bottom&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="nl"&gt;box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;#60748c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;40px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;#60748c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;60px&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;#60748c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="m"&gt;80px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;#60748c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;100px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;#60748c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;120px&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;#60748c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;#60748c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;60px&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;#60748c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;120px&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;#60748c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;40px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;#60748c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;120px&lt;/span&gt; &lt;span class="m"&gt;40px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;#60748c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt; &lt;span class="m"&gt;60px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;#60748c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="m"&gt;100px&lt;/span&gt; &lt;span class="m"&gt;60px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;#60748c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;40px&lt;/span&gt; &lt;span class="m"&gt;80px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;#60748c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;80px&lt;/span&gt; &lt;span class="m"&gt;80px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;#60748c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="m"&gt;60px&lt;/span&gt; &lt;span class="m"&gt;100px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;#60748c&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="nt"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"heart"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We hardcode everything in this tutorial because I am lazy. However in real life, we try not to hardcode anything at all. &lt;a class="mentioned-user" href="https://dev.to/vyvit"&gt;@vyvit&lt;/a&gt; gave a good suggestion to use CSS var(). For repeated values such as the colour code, you can assign it as a CSS variable using the prefix &lt;code&gt;--&lt;/code&gt; and then add it in the &lt;code&gt;:root&lt;/code&gt; element. Now you can use it everywhere since the variable is set in the global scope.&lt;/p&gt;

&lt;p&gt;Using CSS var():&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;--pink-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#d87385&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.heart-shadow-with-color-variable&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;20px&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;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;margin-bottom&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="nl"&gt;box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt; &lt;span class="m"&gt;0&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-color&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="m"&gt;40px&lt;/span&gt; &lt;span class="m"&gt;0&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-color&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="m"&gt;60px&lt;/span&gt; &lt;span class="m"&gt;20px&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-color&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="m"&gt;80px&lt;/span&gt; &lt;span class="m"&gt;0&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-color&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="m"&gt;100px&lt;/span&gt; &lt;span class="m"&gt;0&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-color&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="m"&gt;120px&lt;/span&gt; &lt;span class="m"&gt;20px&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-color&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;20px&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-color&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="m"&gt;60px&lt;/span&gt; &lt;span class="m"&gt;20px&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-color&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="m"&gt;120px&lt;/span&gt; &lt;span class="m"&gt;20px&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-color&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;40px&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-color&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="m"&gt;120px&lt;/span&gt; &lt;span class="m"&gt;40px&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-color&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt; &lt;span class="m"&gt;60px&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-color&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="m"&gt;100px&lt;/span&gt; &lt;span class="m"&gt;60px&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-color&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="m"&gt;40px&lt;/span&gt; &lt;span class="m"&gt;80px&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-color&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="m"&gt;80px&lt;/span&gt; &lt;span class="m"&gt;80px&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-color&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="m"&gt;60px&lt;/span&gt; &lt;span class="m"&gt;100px&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-color&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;More detailed explanation over here:&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/twhite96/embed/JxJzLR?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;There're many pixel box-shadow generators available online to help you calculate the coordinates of your drawing. I drew the offline dinosaur with the most beautiful generator I could find online, the &lt;a href="http://elrumordelaluz.github.io/Pixelator/" rel="noopener noreferrer"&gt;Pixelator&lt;/a&gt;. Good to have features for Pixelator would be a history of previous drawings (undo, redo) and the ability to drag and color the pixels. I wanted to animate the dinosaur but I kept forgetting the coordinates. We shall see.&lt;/p&gt;

&lt;p&gt;Check out my dino &lt;a href="https://linxea.github.io/offline.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;. My dinosaur blinks. 😂&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/twhite96/embed/OdgGqP?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;(&lt;a class="mentioned-user" href="https://dev.to/vms20591"&gt;@vms20591&lt;/a&gt; hope you are seeing this, this is for you! Sorry it took freaking long.)&lt;/p&gt;

&lt;p&gt;P/S: Anyway,&lt;br&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%2Fuploads%2Farticles%2Fwyacs65l5hchxhyt8ml1.jpg" 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%2Fuploads%2Farticles%2Fwyacs65l5hchxhyt8ml1.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>boxshadow</category>
      <category>pixelated</category>
    </item>
    <item>
      <title>New Year Resolution: Becoming a Youtuber</title>
      <dc:creator>ann lin</dc:creator>
      <pubDate>Tue, 01 Jan 2019 16:59:54 +0000</pubDate>
      <link>https://forem.com/annlin/new-year-resolution-becoming-a-youtuber-2dk3</link>
      <guid>https://forem.com/annlin/new-year-resolution-becoming-a-youtuber-2dk3</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/ASmi0IYsu0Q"&gt;
&lt;/iframe&gt;
&lt;br&gt;
HELLO WORLD 2019, I AM STARTING A YOUTUBE VLOG AND PULLING ALL MY NON TECH/TECH FRIENDS INTO THE TECH SCENE AND THE YOUTUBE WORLD. IT WILL BE FUN AND CHAOTIC. :)&lt;/p&gt;

&lt;p&gt;Amazing video and sound quality brought to you by IPhone. Still saving up for my camera and microphone. &lt;/p&gt;

</description>
      <category>challenge</category>
      <category>youtube</category>
      <category>vlog</category>
    </item>
    <item>
      <title>Automate folder creation with specified name using Bash Script</title>
      <dc:creator>ann lin</dc:creator>
      <pubDate>Sat, 22 Dec 2018 12:29:15 +0000</pubDate>
      <link>https://forem.com/annlin/automate-folder-creation-with-specified-name-using-bash-script-144a</link>
      <guid>https://forem.com/annlin/automate-folder-creation-with-specified-name-using-bash-script-144a</guid>
      <description>&lt;p&gt;I've been creating new folder with a specific naming pattern in the Terminal.&lt;br&gt;
A folder named &lt;code&gt;/dayX-title&lt;/code&gt; that contains a &lt;code&gt;README.md&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;E.g: &lt;code&gt;/codingclub/challenge/dayX-title/README.md&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;linxea at tmo &lt;span class="k"&gt;in&lt;/span&gt; ~/codingclub/challenge
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls
&lt;/span&gt;day0-the-beginning-of-the-coding-club
day1-may-the-odds-be-in-your-favour
day2-so-far-so-good
day3-oh-man
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This is how I create a new file in a new folder. I manually look through the list of folders to get the next count. Then type the title-with-dash-and-dash-and-dash.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ touch day4-time-to-automate/README.md
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I'm getting lazy so we'll write a bash script to do that. &lt;/p&gt;

&lt;p&gt;I'm looking to write a commmand &lt;code&gt;./new time to automate&lt;/code&gt; to create &lt;code&gt;/day4-time-to-automate&lt;/code&gt; with a README.md in it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Iterate through all the folders&lt;/li&gt;
&lt;li&gt;Find the largest number of day&lt;/li&gt;
&lt;li&gt;Create a new folder with a README.md file with the given input filename
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash

# Take in all arguments in one variable
input="$*"
folderTitle=$input

# Check if there is input, otherwise exit script
if [[ -z "${folderTitle// }" ]]; then
  echo "Where is your awesome title yo?"
  exit 1
fi

# Replace space to -
folderTitle=${folderTitle// /-}

# Loop through the list of directories and find the biggest number
biggestNumber=-1
for dir in $(ls)
do
  number=`sed 's/[^0-9]//g' &amp;lt;&amp;lt;&amp;lt; $dir`
  if (( number &amp;gt; biggestNumber )); then
    biggestNumber=$number
  fi
done

# Increment the biggest number by 1
((biggestNumber=biggestNumber+1))

# Create a new folder and README.md file
newName=day$biggestNumber-$folderTitle
mkdir -p $newName
echo -e "TITLE: Day $biggestNumber $input\n" &amp;gt; $newName/README.md

# Print success message to make me feel good
echo Created $newName yo 🦄
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Tada, now you just have to make the script executable by running &lt;code&gt;chmod -x&lt;/code&gt; and run the command &lt;code&gt;./new.sh&lt;/code&gt; with title after that.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ chmod -x new.sh # make the script executable
$ ./new.sh as usual this task takes longer than i expected
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Uploaded my script to Repl.it, check it out at &lt;a href="https://repl.it/@linxea/Create-New-Folder-and-File"&gt;https://repl.it/@linxea/Create-New-Folder-and-File&lt;/a&gt; . You may need to login to play with it.&lt;/p&gt;

&lt;h3&gt;
  
  
  DOES IT WORTH THE TIME TO PICK UP BASH TO AUTOMATE SUCH A TINY MATTER?
&lt;/h3&gt;

&lt;p&gt;a tiny yes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Another Problem Another Day to Solve,
&lt;/h3&gt;

&lt;p&gt;I wanted to extract the number &lt;code&gt;123&lt;/code&gt; between &lt;code&gt;day123-title-that-may-contain-123&lt;/code&gt; using &lt;code&gt;sed&lt;/code&gt; but regex is messing with my mind. 🤯 How do I do that? How to I write a regex that only returns number between &lt;code&gt;day&lt;/code&gt; and &lt;code&gt;-everything-else-after-dash&lt;/code&gt;? Explain regex like I'm 5 please.&lt;/p&gt;

&lt;h3&gt;
  
  
  End
&lt;/h3&gt;

</description>
      <category>bashscript</category>
      <category>terminal</category>
    </item>
    <item>
      <title>Star Wars Hyperjump</title>
      <dc:creator>ann lin</dc:creator>
      <pubDate>Thu, 20 Dec 2018 17:28:15 +0000</pubDate>
      <link>https://forem.com/annlin/star-wars-hyperjump-1mf0</link>
      <guid>https://forem.com/annlin/star-wars-hyperjump-1mf0</guid>
      <description>&lt;p&gt;Recreating the hyperjump effect from Star Wars using &lt;code&gt;translateX&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;hyperjump&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;translateX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="err"&gt;1&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;translateX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-50px&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="err"&gt;100&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;translateX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-100vw&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;iframe height="600" src="https://codepen.io/toomuchome/embed/jXVowY?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;P/S: Can anyone find a video clip for the hyperjump effect? I can't seem to find it on youtube or anywhere else. &lt;br&gt;
P/P/S: To leaky and jiji, I didn't do this during working hours. I work hard at work. 🌝&lt;/p&gt;

&lt;p&gt;Credits:&lt;br&gt;
Stars from &lt;a href="http://pluspng.com/png-141250.html"&gt;http://pluspng.com/png-141250.html&lt;/a&gt;&lt;br&gt;
I drew the millennium falcon from &lt;a href="http://elrumordelaluz.github.io/Pixelator/"&gt;http://elrumordelaluz.github.io/Pixelator/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
    </item>
    <item>
      <title>Wreck it Ralph 2 Virus Popup</title>
      <dc:creator>ann lin</dc:creator>
      <pubDate>Mon, 17 Dec 2018 17:58:58 +0000</pubDate>
      <link>https://forem.com/annlin/wreck-it-ralph-2-virus-popup-58gm</link>
      <guid>https://forem.com/annlin/wreck-it-ralph-2-virus-popup-58gm</guid>
      <description>&lt;h2&gt;
  
  
  I just watched Ralph Breaks the Internet 😍
&lt;/h2&gt;

&lt;p&gt;and I absolutely love the scene where Ralph is popping everywhere on the screen.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ralph in CSS
&lt;/h2&gt;

&lt;p&gt;Because it's late and we need Ralph in CSS so I stole the amazing CSS pixel art by &lt;a href="https://codepen.io/jasonadelia"&gt;Jason Delia&lt;/a&gt; using box-shadow. We need to play with box-shadow again.&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://linxea.github.io/wreck-it-ralph"&gt;WRECK-IT-RALPH DEMO&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Simple Popup Animation
&lt;/h2&gt;

&lt;p&gt;Hide the original Ralph so the first Ralph is always at random position.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"ralph"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Duplicate Ralph using &lt;code&gt;cloneNode&lt;/code&gt; and put it in &lt;code&gt;body&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementsByTagName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;body&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ralph&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ralph&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;duplicateRalphAtRandomPosition&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="nx"&gt;ralphClone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ralph&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cloneNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;ralphClone&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="nx"&gt;display&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;block&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;ralphClone&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="nx"&gt;top&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getRandomPercentage&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;ralphClone&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="nx"&gt;left&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;getRandomPercentage&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;ralphClone&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="nx"&gt;transform&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`scale(&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;getRandomSize&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;&lt;span class="s2"&gt;)`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ralphClone&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;Place cloned Ralph in random position with random size.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Return 0% to 100%&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;getRandomPercentage&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="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;101&lt;/span&gt; &lt;span class="o"&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="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Return 0.3 - 1&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;getRandomSize&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="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.8&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.3&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;Keep doing it every second until the Internet breaks using &lt;code&gt;setInterval&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Duplicate Ralph every second yo&lt;/span&gt;
&lt;span class="nx"&gt;setInterval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;duplicateRalphAtRandomPosition&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>animation</category>
      <category>css</category>
    </item>
    <item>
      <title>Git Github Gitflow</title>
      <dc:creator>ann lin</dc:creator>
      <pubDate>Wed, 12 Dec 2018 17:29:48 +0000</pubDate>
      <link>https://forem.com/annlin/git-github-gitflow-4c6n</link>
      <guid>https://forem.com/annlin/git-github-gitflow-4c6n</guid>
      <description>&lt;h2&gt;
  
  
  What is Git
&lt;/h2&gt;

&lt;p&gt;Git is a distributed version control system created by Linus Torvalds in 2005. The same guy who created linux. Genius.&lt;/p&gt;

&lt;h3&gt;
  
  
  Centralized vs Distributed
&lt;/h3&gt;

&lt;p&gt;Before Git, Apache Subversion (SVN) was one of the popular version control systems. SVN is a centralized version control system which stores all the files in 1 central server. If two developers are working on the same file, they will have to resolve conflicts all the time. The developers cannot commit the changes if they are offline unlike Git.&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F9bjayivv1qh3fnpbh4ce.jpg" 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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F9bjayivv1qh3fnpbh4ce.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the other hand,&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fbtuq6stx62g369i09riu.jpg" 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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fbtuq6stx62g369i09riu.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Git commands
&lt;/h3&gt;

&lt;p&gt;Below is a list of basic commands to save your changes as commits and push them up to the server (Github) using Terminal. I'm a terminal person. No GUI. I know that VSCode has built-in user interface for git. There are existing &lt;a href="https://git-scm.com/download/gui/windows" rel="noopener noreferrer"&gt;Git Clients&lt;/a&gt; too.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout develop # Go to develop branch
git add . # add all the files you have edited
git commit -m "Add changes to the files" # add commit message to the files you've added
git push origin master # Push the commits to master branch in the server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf" rel="noopener noreferrer"&gt;Check out this git cheatsheet&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Github
&lt;/h2&gt;

&lt;p&gt;A hosting service that works with Git. There are alternative hosting services that work with Git as well. For example, Bitbucket and Gitlab. However, I like Github the best because the UX is smooth af. FYI, Microsoft acquired Github and I find this tweet hilarious.&lt;/p&gt;

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

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



&lt;/p&gt;

&lt;h2&gt;
  
  
  Gitflow
&lt;/h2&gt;

&lt;p&gt;A popular branching strategy created by Vincent Driessen. My team at HOOQ is using it. We use it together with &lt;a href="https://datasift.github.io/gitflow/" rel="noopener noreferrer"&gt;Git Hubflow&lt;/a&gt; and we are puking rainbow. There's no right or wrong branching strategy, you just have to find the most suitable model that suits your team.&lt;/p&gt;

&lt;h3&gt;
  
  
  Trunk-Based Development Workflow
&lt;/h3&gt;

&lt;p&gt;Everyone works on master branch only. This is useful to avoid long lived branches which result in accumulating merge conflicts.&lt;/p&gt;

&lt;h4&gt;
  
  
  Branches
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Master branch&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Pros
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Force developers to do small commits and changes frequently&lt;/li&gt;
&lt;li&gt;Easy to understand&lt;/li&gt;
&lt;li&gt;Iterate quickly, ship faster&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Incomplete features may be released if no feature flag is used&lt;/li&gt;
&lt;li&gt;Introduce bugs easily&lt;/li&gt;
&lt;li&gt;Frequent merge conflicts if developers work on the same files&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Gitflow Workflow
&lt;/h3&gt;

&lt;p&gt;Master branch is the stable branch. Nobody touches it. Everyone works on their own feature branch then opens a pull request to merge feature branch into develop branch. A release branch is branched out from develop branch and then merged back to master and develop branches. This encourages continuous delivery. &lt;/p&gt;

&lt;h4&gt;
  
  
  Branches
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Master branch&lt;/li&gt;
&lt;li&gt;Develop branch&lt;/li&gt;
&lt;li&gt;Feature branch&lt;/li&gt;
&lt;li&gt;Release branch&lt;/li&gt;
&lt;li&gt;Hotfix branch&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Pro
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Easy to work in parallel&lt;/li&gt;
&lt;li&gt;Release branch is useful to track releasable features&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;A little complicated for first time user&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://nvie.com/posts/a-successful-git-branching-model/" rel="noopener noreferrer"&gt;I will direct you to an authentic Gitflow explanation over here by the creator himself.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Git Hubflow
&lt;/h2&gt;

&lt;p&gt;One-line commands for using Gitflow with Github. This amazing tool is created by &lt;a href="https://datasift.github.io/gitflow/TheHubFlowTools.html" rel="noopener noreferrer"&gt;DataSift&lt;/a&gt; You guys are da MVP. &lt;/p&gt;

&lt;h3&gt;
  
  
  Normal Git commands
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout develop
git pull origin develop
git checkout -b release/production-1.0.0
git add .
git commit -m "Add new release"
git push origin release/production-1.0.0
git checkout master
git pull origin master
git merge release/production-1.0.0
git tag production-1.0.0
git push --tags origin production-1.0.0
git checkout develop
git pull origin develop
git merge master
git push --delete release/production-1.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Amazing Git Hubflow Commands
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git hf release start production-1.0.0
git add .
git commit -m "Add new release"
git hf release finish production-1.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What is the best workflow?
&lt;/h3&gt;

&lt;p&gt;There are numerous factors to consider when deciding what is the best branching strategy for your team. Does your team require continuous delivery? How comfortable are your team members adopting an entire new workflow versus tweaking existing workflow to suit their needs? &lt;/p&gt;

&lt;p&gt;Personally, I like gitflow because of the separation of concerns for different features and the ease of creating a release with releasable features. But I do believe there is no single best workflow. &lt;/p&gt;

&lt;p&gt;There are more articles over &lt;a href="https://www.endoflineblog.com/oneflow-a-git-branching-model-and-workflow" rel="noopener noreferrer"&gt;here&lt;/a&gt; and &lt;a href="https://docs.microsoft.com/en-us/azure/devops/repos/git/git-branching-guidance?view=vsts" rel="noopener noreferrer"&gt;here&lt;/a&gt; that compare different workflows and their benefits.&lt;/p&gt;

&lt;h3&gt;
  
  
  Disclaimer
&lt;/h3&gt;

&lt;p&gt;I have not tried SVN. Not entirely true, I tried playing with SVN but it was too complicated for my liking. I am spoiled by git. There may be parts in the illustration that are inaccurate, please correct me! &lt;/p&gt;

&lt;p&gt;Also talk to me at &lt;a href="https://twitter.com/linxea_" rel="noopener noreferrer"&gt;Twitter @linxea_&lt;/a&gt;. I'm bored over there.&lt;/p&gt;

&lt;p&gt;Also, I made a slide for my workshop tomorrow at &lt;a href="https://linxea.github.io/git-github-gitflow" rel="noopener noreferrer"&gt;https://linxea.github.io/git-github-gitflow&lt;/a&gt;. Feeling fancy with reveal.js. &lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://docs.microsoft.com/en-us/azure/devops/repos/git/git-branching-guidance?view=vsts" rel="noopener noreferrer"&gt;https://docs.microsoft.com/en-us/azure/devops/repos/git/git-branching-guidance?view=vsts&lt;/a&gt;&lt;br&gt;
&lt;a href="https://datasift.github.io/gitflow/IntroducingGitFlow.html" rel="noopener noreferrer"&gt;https://datasift.github.io/gitflow/IntroducingGitFlow.html&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.endoflineblog.com/oneflow-a-git-branching-model-and-workflow" rel="noopener noreferrer"&gt;https://www.endoflineblog.com/oneflow-a-git-branching-model-and-workflow&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>gitflow</category>
      <category>illustration</category>
    </item>
    <item>
      <title>What happens when you enter URL in a browser [Part 1: URI]</title>
      <dc:creator>ann lin</dc:creator>
      <pubDate>Thu, 22 Nov 2018 17:35:13 +0000</pubDate>
      <link>https://forem.com/annlin/what-happens-when-you-enter-url-in-a-browser-part-1-uri-35hg</link>
      <guid>https://forem.com/annlin/what-happens-when-you-enter-url-in-a-browser-part-1-uri-35hg</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/gtY88BlO7d4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  What really happens,
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Enter a website link in the browser, &lt;code&gt;www.example.com&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Browser knows it's a website and adds &lt;code&gt;https://&lt;/code&gt; in front of it.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;https://&lt;/code&gt; is one of the many URI Schemes
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fphgqalh1jlqijetqsfc6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fphgqalh1jlqijetqsfc6.png" width="790" height="556"&gt;&lt;/a&gt;&lt;br&gt;
URI = Universal Resource Identifier&lt;br&gt;
URL = Uniform Resource Locator&lt;br&gt;
URN (not that urn 🌝) = Uniform Resource Name&lt;/p&gt;

&lt;p&gt;URN and URL are subsets of URI. URN is just a name or a reference, there may not be a way to locate that thingy. URL knows exactly where the resource is located and returns that thingy.&lt;/p&gt;

&lt;h3&gt;
  
  
  URL Example (paste on your browser):
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Hello, World!&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;code&gt;tel:+6598765432&lt;/code&gt; 

&lt;ul&gt;
&lt;li&gt;Open facetime in computer, call number in mobile device&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;code&gt;&lt;a href="https://example.com" rel="noopener noreferrer"&gt;https://example.com&lt;/a&gt;&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Open a website, meh&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;code&gt;file://path&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Open a file in your local machine&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;code&gt;mailto:&lt;a href="mailto:test@gmail.com"&gt;test@gmail.com&lt;/a&gt;&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Open email&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;code&gt;telnet://0.0.0.0&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Open terminal to log into remote computer&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;and &lt;a href="https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml" rel="noopener noreferrer"&gt;more over here&lt;/a&gt;
&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  URN Example:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;urn:isan:0000-0000-9E59-0000-O-0000-0000-2&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;The URN for "Spider-Man (film)", identified by its audiovisual number&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;This concludes part 1 of "What happens when you enter URL in a browser".&lt;/p&gt;

&lt;p&gt;P/S: Current browsers are already using Internationalized Resource Identifiers (IRI), a new protocol which is an extension of URI, which allows unicode character encoding. E.g. &lt;a href="https://en.wiktionary.org/wiki/%E5%8E%89%E5%AE%B3" rel="noopener noreferrer"&gt;https://en.wiktionary.org/wiki/厉害&lt;/a&gt;  (Thanks @jxerome for pointing that out)&lt;/p&gt;

&lt;p&gt;References:&lt;br&gt;
&lt;a href="https://www.immagic.com/eLibrary/ARCHIVES/GENERAL/WIKIPEDI/W110302U.pdf" rel="noopener noreferrer"&gt;https://www.immagic.com/eLibrary/ARCHIVES/GENERAL/WIKIPEDI/W110302U.pdf&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml" rel="noopener noreferrer"&gt;https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Talk to me at &lt;a href="https://twitter.com/linxea_" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🤦: Thanks for pointing out the mistakes in the post! &lt;a class="mentioned-user" href="https://dev.to/joeflateau"&gt;@joeflateau&lt;/a&gt;, @dangtu_work&lt;/p&gt;

</description>
      <category>uri</category>
      <category>browser</category>
      <category>web</category>
      <category>video</category>
    </item>
    <item>
      <title>Holographic Effect on Web</title>
      <dc:creator>ann lin</dc:creator>
      <pubDate>Wed, 14 Nov 2018 18:59:19 +0000</pubDate>
      <link>https://forem.com/annlin/holographic-effect-on-web-39bc</link>
      <guid>https://forem.com/annlin/holographic-effect-on-web-39bc</guid>
      <description>&lt;h1&gt;
  
  
  &lt;a href="https://linxea.github.io/holographic-effect/"&gt;Demo&lt;/a&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  HOLOGRAPHIC EFFECT IS AWESOME,
&lt;/h2&gt;

&lt;p&gt;so I'm going to make my own version of holographic effect today.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Ep6tvUKQ9MQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Demo Code below, open in &lt;a href="https://linxea.github.io/holographic-effect/"&gt;mobile browser&lt;/a&gt; to see my little achievement.&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/toomuchome/embed/VVpOOB?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  css
&lt;/h2&gt;

&lt;p&gt;Google and colour-pick a random holographic picture to get the lovely colours for our &lt;code&gt;linear-gradient&lt;/code&gt;. Set &lt;code&gt;background-size&lt;/code&gt; to &lt;code&gt;200%&lt;/code&gt; so we can move the colours around later on.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nf"&gt;#holographic&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;100vh&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;100vw&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;background-image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;linear-gradient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="nb"&gt;right&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;194&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;182&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;163&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;182&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;221&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;169&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="nb"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;162&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;209&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="p"&gt;);&lt;/span&gt;
    &lt;span class="nl"&gt;background-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;200%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Detecting_device_orientation"&gt;Detecting Device Orientation&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;I use &lt;code&gt;alpha&lt;/code&gt; and set the maximum &lt;code&gt;background-position&lt;/code&gt; to be &lt;code&gt;100%&lt;/code&gt; so that the &lt;code&gt;linear-gradient&lt;/code&gt; will not repeat from the start. Everyone should play with device orientation events, they're freaking fun.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;deviceorientation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;handleOrientation&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;handleOrientation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&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="nx"&gt;z&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;alpha&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// rotation degrees from 0 to 360&lt;/span&gt;

        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;holographicElement&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;holographic&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;holographicElement&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="nx"&gt;backgroundPosition&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
          &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Feedback
&lt;/h2&gt;

&lt;p&gt;It kinnnndda works, I think we can find better calculation to make it smoother and less buggy. But for now, within the time limit I set for myself, I'm prettty satisfied with the slight holographic effect achieved by rigorously rotating or moving my phone. :&amp;gt; &lt;/p&gt;

&lt;p&gt;YES I MADE A VIDEO WITHIN 2 FREAKING HOURS. GIVE ME A CLAP.&lt;br&gt;
&lt;a href="https://twitter.com/linxea_"&gt;FOLLOW ME&lt;/a&gt; AND SUBSCRIBE TO MY &lt;a href="https://www.youtube.com/channel/UCA6sSSOlSJiQY2o10QF5KQw?view_as=subscriber"&gt;YOUTUBE CHANNEL&lt;/a&gt;. &lt;br&gt;
CLICK HERE AND CLICK THERE AND CLICK EVERYWHERE.&lt;/p&gt;

</description>
      <category>deviceorientation</category>
      <category>holographiceffect</category>
      <category>css</category>
    </item>
    <item>
      <title>Build a frontend to backend web application (Windows 95 style)</title>
      <dc:creator>ann lin</dc:creator>
      <pubDate>Wed, 14 Nov 2018 02:19:14 +0000</pubDate>
      <link>https://forem.com/annlin/build-a-frontend-to-backend-web-application-windows-95-style-41gb</link>
      <guid>https://forem.com/annlin/build-a-frontend-to-backend-web-application-windows-95-style-41gb</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/IDYRlkEoK4s"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Look ma, I'm fullstack.
&lt;/h1&gt;

&lt;p&gt;Today I start to play with database. I found a gem at &lt;a href="https://dev.to/aspittel/objection--knex--painless-postgresql-in-your-node-app--6n6"&gt;https://dev.to/aspittel/objection--knex--painless-postgresql-in-your-node-app--6n6&lt;/a&gt;. @AliSpittel, you are dah MVP.You should first head over to the &lt;a href="https://dev.to/aspittel/objection--knex--painless-postgresql-in-your-node-app--6n6"&gt;tutorial&lt;/a&gt; which covers objection.js + knex pretty well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Objection.js + Express = Web App
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Disclaimer
&lt;/h3&gt;

&lt;p&gt;This is a beginner's attempt to begin fullstack. I wanted to keep it freaking simple. No webpack no babel no nothing. As vanilla as possible.&lt;/p&gt;

&lt;p&gt;I have selected &lt;code&gt;Postgres/Knex/Objection&lt;/code&gt; for my database and &lt;code&gt;Express&lt;/code&gt; for backend and just vanilla &lt;code&gt;HTML&lt;/code&gt;, &lt;code&gt;CSS&lt;/code&gt; and &lt;code&gt;JavaScript&lt;/code&gt; for frontend. I'm a simple girl.&lt;/p&gt;

&lt;p&gt;This project is like a random doodling process. Expect chaos in the code.&lt;/p&gt;

&lt;h1&gt;
  
  
  Before we start,
&lt;/h1&gt;

&lt;p&gt;Here's the &lt;a href="https://live-a-life-you-will-remember.herokuapp.com/"&gt;Demo&lt;/a&gt; and &lt;a href="https://github.com/linxea/life"&gt;Code&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  User Requirement
&lt;/h2&gt;

&lt;p&gt;As a human being, I need a place to jot down what I do everyday to remind myself how much time I have been wasting doing nothing but sleeping.&lt;/p&gt;

&lt;p&gt;[Oh shit, I enjoy writing nonsense too much.]&lt;/p&gt;

&lt;h1&gt;
  
  
  1. Design
&lt;/h1&gt;

&lt;p&gt;I don't want to care about frontend this time. I am looking for a MVP, a minimal viable product.&lt;/p&gt;

&lt;p&gt;But we need to design the database schema. Since we want to document each day as an entity, we will create a model named &lt;code&gt;Day&lt;/code&gt; with the fields below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "id": 1,
    "exercise": false,
    "achievement": "I started dev.to 🤗.",
    "demo_link": "http://dev.to/linxea",
    "mood": "Good vibes",
    "woke_up_at": null,
    "slept_at": null,
    "created_at": "2018-05-28T16:00:00.000Z"
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  2. Develop
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Setup
&lt;/h3&gt;

&lt;p&gt;Download the &lt;a href="https://github.com/linxea/life"&gt;example code here.&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Install these in the terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install psql
brew install knex
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Database
&lt;/h3&gt;

&lt;p&gt;Create a database called &lt;code&gt;life&lt;/code&gt; locally by running the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;createdb life

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



&lt;p&gt;Create .env in folder by running the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run create:env
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;.env&lt;/code&gt; file and update &lt;code&gt;DATABASE_URL&lt;/code&gt; variable with your own username/password/database_name. It should look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PORT=8000
APP_ENV=local
DATABASE_URL=postgres://username:password@localhost:5432/life-database

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



&lt;p&gt;Scheme is defined in the knex generated file in migration folder, which is created by the command &lt;code&gt;knex migrate:make create_days&lt;/code&gt;. I've already created one named TIMESTAMP_create_days in &lt;code&gt;/deploy/db/migrations&lt;/code&gt;. Migrate whatever inside the migrations folder by running the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;knex migrate:latest
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;To feed the database with default information from &lt;code&gt;/deploy/db/seeds&lt;/code&gt;, running the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;knex seed:run
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Server / Client
&lt;/h3&gt;

&lt;p&gt;Install the dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Run the freaking app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run start
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Yes I copied the content from my &lt;a href="https://github.com/linxea/life"&gt;README file&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Optional
&lt;/h2&gt;

&lt;p&gt;If your database screws up or if you want to reset the database content, you can delete the database and do everything again by running the commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dropdb life
createdb new-life
// Remember to update the `database_name` in .env file
knex seed:run
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h1&gt;
  
  
  3. Deploy
&lt;/h1&gt;

&lt;p&gt;You need to run server for this web app. &lt;a href="https://dashboard.heroku.com/"&gt;Heroku&lt;/a&gt; provides a free and easy way to host node app. (I wish firebase hosting could do it too. T.T) However, free account means that the server will fall asleep after 30mins of non-activity. So the first load time for the lucky first person will always take reaaaaaaaaaaaaaaally long. It's not my app having really bad performance okay.&lt;/p&gt;

&lt;p&gt;You can create a free AWS account to create a database over at &lt;a href="https://aws.amazon.com/rds/"&gt;RDS&lt;/a&gt;. ( I actually missed this part out in my video, README, everything. opps) I'm pretty new to RDS, the response time to connect to the database takes a while. Sometime I can't access the database as well due to long response time. :&amp;lt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Deploy to Heroku
&lt;/h3&gt;

&lt;p&gt;You can also deploy to Heroku easily using these commands (Heroku is awesome!):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install heroku
heroku login
heroku create you-can-name-anything-you-want-here
git push heroku origin
heroku open
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Follow me at &lt;a href="https://twitter.com/linxea_"&gt;https://twitter.com/linxea_&lt;/a&gt;&lt;br&gt;
I intend to make a video a day like Casey Neistat and Nas Daily but I spent way too long on one video, waaaaaaaay too long. T_T&lt;/p&gt;

</description>
      <category>noob</category>
      <category>database</category>
      <category>elim5</category>
      <category>backend</category>
    </item>
    <item>
      <title>Quick Sort</title>
      <dc:creator>ann lin</dc:creator>
      <pubDate>Tue, 06 Nov 2018 14:22:48 +0000</pubDate>
      <link>https://forem.com/annlin/quick-sort-3fh7</link>
      <guid>https://forem.com/annlin/quick-sort-3fh7</guid>
      <description>&lt;p&gt;Hey Chenge, this is for you.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/stWj4rowLAc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Here's my take at Quick Sort. I realised I didn't have the best example half way through the animation. It was too late. All the drawing and animating while on the train to work... Put it as a lesson learned.&lt;/p&gt;

&lt;p&gt;Here's the code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight python"&gt;&lt;code&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;quicksort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;pivot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;partition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;quicksort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pivot&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;quicksort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pivot&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;partition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;actualPivotPosition&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;
    &lt;span class="n"&gt;pivotValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;pivotValue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;actualPivotPosition&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;actualPivotPosition&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
            &lt;span class="n"&gt;actualPivotPosition&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

    &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;actualPivotPosition&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;actualPivotPosition&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;actualPivotPosition&lt;/span&gt;

&lt;span class="n"&gt;array&lt;/span&gt; &lt;span class="o"&gt;=&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="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;8&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;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="mi"&gt;4&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="n"&gt;quicksort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Array:"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# Array: [1, 2, 3, 4, 5, 6, 7, 8]
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Given an array, set the last position to be a pivot&lt;/li&gt;
&lt;li&gt;Move the pivot to the actual sorted position in the array&lt;/li&gt;
&lt;li&gt;Continue to sort the subarray before and after the pivot with Step 1&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The worst case is when the pivot is always the smallest or biggest. To prevent that from happening, you can choose a random position, swap the random position with the last head, then continue with the same sorting thingy. &lt;/p&gt;

&lt;p&gt;Check out a better tutorial at &lt;a href="https://www.geeksforgeeks.org/quick-sort/"&gt;https://www.geeksforgeeks.org/quick-sort/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>algorithms</category>
    </item>
    <item>
      <title>Build A Cool Thing (Street Fighter Website)</title>
      <dc:creator>ann lin</dc:creator>
      <pubDate>Mon, 29 Oct 2018 19:29:03 +0000</pubDate>
      <link>https://forem.com/annlin/build-a-cool-thing-street-fighter-website-16j</link>
      <guid>https://forem.com/annlin/build-a-cool-thing-street-fighter-website-16j</guid>
      <description>&lt;p&gt;&lt;a href="https://linxea.github.io" rel="noopener noreferrer"&gt;DEMO (You can see it live here.) &lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Today nostalgia hit me hard,
&lt;/h2&gt;

&lt;p&gt;so I did a video on my first cool thing. Googled for a Street Fighter splash screen. Entire ideation is recorded in the video below. Give me some love. &amp;lt;3&lt;/p&gt;

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

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/hDIJ9xGjH1Q"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Loading Animation
&lt;/h2&gt;

&lt;p&gt;Check out the first load animation which is an attempt to simulate a boot up effect from the screen of an arcade game. So we do a blur of 2px and hue-rotate the color to a number that looks good. Do it for 800ms then 500ms in the opposite direction. (I didn't know we can do backwards. I know nothing.)&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="c"&gt;/* Stole this idea from twilioquest, it's freaking sick. */&lt;/span&gt;
&lt;span class="nc"&gt;.load&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;load&lt;/span&gt; &lt;span class="m"&gt;800ms&lt;/span&gt; &lt;span class="m"&gt;500ms&lt;/span&gt; &lt;span class="n"&gt;backwards&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;@keyframes&lt;/span&gt; &lt;span class="n"&gt;load&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="err"&gt;0&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;blur&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;2px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;hue-rotate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-150deg&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;h2&gt;
  
  
  Arcade Retro Screen Overlay
&lt;/h2&gt;

&lt;p&gt;Who would have known a single line image would trigger nostalgia and make a good screen overlay. We literally paste a translucent background image on the screen, and disable any click effect on it using &lt;code&gt;pointer-events: none&lt;/code&gt; so it will not block any interaction of other buttons (not that there is any at the moment). &lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/matthieupetel"&gt;Matthieu Pétel&lt;/a&gt; gave a really good suggestion to use &lt;code&gt;repeating-linear-gradient&lt;/code&gt; instead of svg for the retro overlay effect. (I've updated the code with slight tweak to the colors)&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="c"&gt;/* Stole this from twilioquest too. ^^ */&lt;/span&gt;
&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="nd"&gt;:before&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;right&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;repeating-linear-gradient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;#0D122B&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;#0D122B&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;#565B73&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;#565B73&lt;/span&gt; &lt;span class="m"&gt;4px&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;z-index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;pointer-events&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Retro Text
&lt;/h2&gt;

&lt;p&gt;Google font is our best friend here. I choose the font &lt;code&gt;Permanent Marker&lt;/code&gt; which is the closest I can find to replicate the &lt;code&gt;Street Fighter&lt;/code&gt; text and also the font &lt;code&gt;Press Start 2P&lt;/code&gt; which is used in most retro games.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;SOFTWARE ENGINEER&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Use a little &lt;code&gt;skew&lt;/code&gt; and &lt;code&gt;rotate&lt;/code&gt; and &lt;code&gt;translate&lt;/code&gt; to tilt the text &lt;code&gt;Software&lt;/code&gt; and &lt;code&gt;Engineer&lt;/code&gt;. I give them separate class name because we want to adjust them a little differently.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.title-top&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;skew&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-10deg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;rotate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-10deg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;translateX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-2rem&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.title-bottom&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;skew&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-10deg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;rotate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-10deg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;translateX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1rem&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;Clipping the background turns out cool and works well on Safari, Chrome, Firefox, Opera browser. I am amazed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.title h1 {
  background: -webkit-linear-gradient(rgb(255, 18, 18) 30%, rgb(255, 215, 38));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And I use &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt; to set some of the letters to be slighly bigger. So it looks more like the splash screen earlier.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;PUSH START BUTTON&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The retro text (&lt;code&gt;"PLAYER 1 OR PLAYER 2"&lt;/code&gt; etc) is done using text-shadow. One text-shadow (move it a little on the right and bottom behind the text) is enough to replicate the arcade style text in my opinion. I have two text-shadows for the credit © to make it "pop".&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.grey-with-red&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;192&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;192&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;192&lt;/span&gt;&lt;span class="p"&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;2px&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="m"&gt;0&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;192&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;11&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.purple-with-blue&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;147&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;154&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="nl"&gt;text-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="m"&gt;0&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;47&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;61&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="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.yellow-with-darkyellow&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;rgb&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;226&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;179&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;24&lt;/span&gt;&lt;span class="p"&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;0&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="m"&gt;0&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;107&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;77&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;11&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&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;151&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;109&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;19&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="m"&gt;2px&lt;/span&gt; &lt;span class="m"&gt;0&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;151&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;109&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;19&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;Source code over here:&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/toomuchome/embed/QZPYqm?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;I will add more interactions in the next one. I got to sleep now. Bye.&lt;/p&gt;

&lt;p&gt;Follow me at &lt;a href="https://twitter.com/linxea_" rel="noopener noreferrer"&gt;https://twitter.com/linxea_&lt;/a&gt;&lt;/p&gt;

</description>
      <category>website</category>
      <category>easy</category>
      <category>css</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
