<?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: Salim MAHBOUBI</title>
    <description>The latest articles on DEV Community by Salim MAHBOUBI (@ztickm).</description>
    <link>https://dev.to/ztickm</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%2F3264%2Fd82ffc5f-ac8f-43b8-b92e-0c3b2eff0113.jpg</url>
      <title>DEV Community: Salim MAHBOUBI</title>
      <link>https://dev.to/ztickm</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ztickm"/>
    <language>en</language>
    <item>
      <title>Intro to Git hooks</title>
      <dc:creator>Salim MAHBOUBI</dc:creator>
      <pubDate>Wed, 18 Dec 2019 14:31:34 +0000</pubDate>
      <link>https://dev.to/ztickm/intro-to-git-hooks-10pp</link>
      <guid>https://dev.to/ztickm/intro-to-git-hooks-10pp</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Where there is repetition, there shall be automation&lt;br&gt;
—King Sisyphus of Ephyra&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;These words maybe were not said by Sisyphus, but they are not without wisdom; follow them.&lt;br&gt;
While programming, one of the most repetitive actions is typing the same set of characters every time you write a git commit, whether they be issue numbers, branch names, signatures, or something else. Those repetitive tasks might be due to a lot of reasons like company standardization or just plain open source commit guidelines. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Disclaimer:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;please do not try git hooks on important repositories unless you fully understand what the commands you are invoking do. Try new things on a new empty repository that you can delete if things don't work out the way they were supposed to&lt;/em&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  What are hooks? Git hooks?
&lt;/h1&gt;

&lt;p&gt;In programming, hooks are —generally speaking— bits of custom code that the base code allows to intervene at certain places. &lt;/p&gt;

&lt;p&gt;In git, we're allowed to do that; we write a script, configure it, and it gets executed before or after git events/actions such as a commit, a merge, or a rebase.&lt;/p&gt;
&lt;h1&gt;
  
  
  Our use case
&lt;/h1&gt;

&lt;p&gt;In my job, I find myself writing basically the same word in the start of each commit message. So I thought of finding a way to automatically append that same word to every git commit message.&lt;/p&gt;
&lt;h3&gt;
  
  
  Where to put our script?
&lt;/h3&gt;

&lt;p&gt;First, you need to be able to see hidden files, then you simply go to the &lt;code&gt;/.git/hooks&lt;/code&gt; directory in your local repository. That's where hooks are stored for each repository. You can find a bunch of sample scripts in this directory. Either edit the &lt;code&gt;prepare-commit-msg.sample&lt;/code&gt; and save it as &lt;code&gt;prepare-commit-msg&lt;/code&gt; (with no extension), or just create a new file with &lt;code&gt;prepare-commit-msg&lt;/code&gt; as a name&lt;/p&gt;
&lt;h3&gt;
  
  
  What to put in our script?
&lt;/h3&gt;

&lt;p&gt;You can virtually write your script in any script language like bash, php, JS, python, ruby, and many others. For our purposes, we will write our script using bash and a unix utility called sed.&lt;/p&gt;

&lt;p&gt;Before diving in the code, you should know that a prepare-commit-msg hook gives you access 3 parameters, in order: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The file that containts commit message itself (We will only use this one)&lt;/li&gt;
&lt;li&gt;The source of the commit message &lt;/li&gt;
&lt;li&gt;The SHA-1 of the commit if we're editing it &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These parameters are accessible through bash positional parameters that follow the aforementioned order, so the commit message file is in the variable &lt;code&gt;$1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Our script looks 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;&lt;span class="c"&gt;#!/bin/sh&lt;/span&gt;

&lt;span class="nv"&gt;COMMIT_MSG_FILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;

&lt;span class="nv"&gt;MY_MSG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"I LOVE MOM"&lt;/span&gt;

&lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt;.old &lt;span class="s2"&gt;"1s/^/ &lt;/span&gt;&lt;span class="nv"&gt;$MY_MSG&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt; /"&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$COMMIT_MSG_FILE&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;What it does is pretty straightforward.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We put the commit message in a variable with a better name &lt;em&gt;i.e.&lt;/em&gt; COMMIT_MSG_FILE&lt;/li&gt;
&lt;li&gt;We put the word we want to be appended to each commit message in another variable for easy access and editing &lt;/li&gt;
&lt;li&gt;We execute a &lt;code&gt;sed&lt;/code&gt; command that adds the content of our &lt;code&gt;$MY_MSG&lt;/code&gt; variable to the top of the commit message file&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  The sed command
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;sed&lt;/code&gt; is a powerful utility that parses through and edits text. It is out of the scope of this tutorial, so we will just understand the used command.&lt;/p&gt;

&lt;p&gt;Besides the options, the sed utility takes two parameters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The input file (&lt;code&gt;$COMMIT_MSG_FILE&lt;/code&gt; in our case) &lt;/li&gt;
&lt;li&gt;The script, where we tell it how to manipulate text from the input (in our case it is this: &lt;code&gt;1s/^/ $MY_MSG \n /&lt;/code&gt; )&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In our command we specify the &lt;code&gt;-i.old&lt;/code&gt; option which tells &lt;code&gt;sed&lt;/code&gt; to edit the file in place &lt;em&gt;i.e.&lt;/em&gt; overwrite it and create a backup file with the same name plus the &lt;strong&gt;.old&lt;/strong&gt; extension. You can use any extension you want, &lt;strong&gt;.back&lt;/strong&gt; and &lt;strong&gt;.bak&lt;/strong&gt; are widely used.&lt;/p&gt;

&lt;p&gt;Now we decipher the script.&lt;br&gt;
&lt;code&gt;sed&lt;/code&gt; substitution scripts are usually &lt;br&gt;
divided by forward slashes in 3 parts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The type of operation we are doing (substitution, deletion, ...) and which lines/part of the text we are affecting&lt;/li&gt;
&lt;li&gt;A regular expression to search for the part that is getting substituted&lt;/li&gt;
&lt;li&gt;A replacement string&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In our case:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; The &lt;code&gt;1&lt;/code&gt; in the beginning means "only the first line"&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;s&lt;/code&gt; means this is a substitute operation &lt;/li&gt;
&lt;li&gt;The &lt;code&gt;^&lt;/code&gt; caret means the start of the buffer, so this isn't really a substitution but an addition &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$MY_MSG \n&lt;/code&gt; is the replacement string, so the contents of $MY_MSG plus a carriage return&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Test the script
&lt;/h3&gt;

&lt;p&gt;After saving the script and making it executable (&lt;code&gt;chmod +x prepare-commit-msg&lt;/code&gt; in *nix systems), we just need to commit something.&lt;/p&gt;

&lt;p&gt;Edit a file, stage it, and upon executing &lt;code&gt;git commit&lt;/code&gt; a text editor pops open with the commit message file loaded, and sure enough the first line proudly says "I LOVE MOM"&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_gZUKWaH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ot8ia11dqi3x14kp9a0w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_gZUKWaH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ot8ia11dqi3x14kp9a0w.png" alt="A console screenshot of a git commit message" width="576" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you specify the message through the &lt;code&gt;-m&lt;/code&gt; option or through your text editor/IDE, the message will be appended by "I LOVE MOM" automatically. Try it and use &lt;code&gt;git log&lt;/code&gt; to see your beautiful commits.&lt;/p&gt;

&lt;h1&gt;
  
  
  What's next?
&lt;/h1&gt;

&lt;p&gt;This is a rather simple use case, you can try make the message dynamic or maybe try another hook. I can't recommend you enough to read more about git hooks and utilities like sed. I am sure you will find at least a way to automate some tasks and become more productive.&lt;/p&gt;

&lt;h2&gt;
  
  
  Further reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://git-scm.com/docs/githooks"&gt;Git Hooks Docs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks"&gt;Customizing Git Hooks&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.grymoire.com/Unix/Sed.html#uh-1"&gt;Sed - An Introduction and Tutorial by Bruce Barnett&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>git</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Make Animated Buttons With Colored Bottom Edges</title>
      <dc:creator>Salim MAHBOUBI</dc:creator>
      <pubDate>Sun, 25 Nov 2018 16:20:14 +0000</pubDate>
      <link>https://dev.to/ztickm/make-animated-buttons-with-colored-bottom-edges-1cip</link>
      <guid>https://dev.to/ztickm/make-animated-buttons-with-colored-bottom-edges-1cip</guid>
      <description>&lt;p&gt;This is an entry level post explaining line by line how to make simple good looking animated buttons using only CSS and HTML.&lt;/p&gt;

&lt;p&gt;First, check what we're going to do before diving in the code:&lt;br&gt;
&lt;iframe height="600" src="https://codepen.io/ztickm/embed/GxzQKx?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  The HTML
&lt;/h3&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;button&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"shadow-btn"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  Button
&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"border-btn"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  Button
&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Basically, the code is telling the browser to display two buttons, and to assign each one to a distinct class to be styled by CSS.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;: Why not use the &lt;code&gt;&amp;lt;input type="submit"&amp;gt;&lt;/code&gt; tag instead of &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt;?&lt;br&gt;
&lt;strong&gt;A&lt;/strong&gt;: For my case, I just like the conciseness of &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt;, it defaults its &lt;code&gt;type&lt;/code&gt; to &lt;code&gt;submit&lt;/code&gt;; also it's easier to get when reading a long form full of other &lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt; tags.&lt;br&gt;
Read a StackOverflow &lt;a href="https://stackoverflow.com/questions/25436145/input-type-button-vs-button" rel="noopener noreferrer"&gt;Discussion&lt;/a&gt; about the matter.&lt;/p&gt;

&lt;h3&gt;
  
  
  The CSS
&lt;/h3&gt;

&lt;p&gt;We'll explore the sheet, selector by selector.&lt;/p&gt;

&lt;h4&gt;
  
  
  -1 :root
&lt;/h4&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;--main-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#16a085&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--transition-time&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.5s&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;The &lt;code&gt;:root&lt;/code&gt; selector is a CSS pseudo-class. While using HTML, it matches the &lt;code&gt;html&lt;/code&gt; selector, except it has a higher specificity.&lt;br&gt;
&lt;code&gt;--main-color&lt;/code&gt; and &lt;code&gt;--transition-time&lt;/code&gt; are &lt;a href="https://www.w3.org/TR/css-variables/" rel="noopener noreferrer"&gt;CSS custom properties&lt;/a&gt; we can name them ourselves. In this case we're using them as variables (Yes, CSS custom properties are not equivalent to variables, I'll write a post about this later). Since we're using these values multiple times, this helps us later if we want to change them, we'll change them only once, no need to Ctrl+F the CSS to change all occurrences.&lt;/p&gt;

&lt;h4&gt;
  
  
  -2 button
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="c"&gt;/* We're selecting every &amp;lt;button&amp;gt; in the document */&lt;/span&gt;

  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/* We're telling CSS to give 1 pixel of "room" in all directions*/&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;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/* We want our buttons to have sharp 90 degrees corners*/&lt;/span&gt;

  &lt;span class="nl"&gt;border&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="c"&gt;/* We want our buttons to have no border, more on this later*/&lt;/span&gt;

  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt; &lt;span class="m"&gt;30px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/* We want our text to have some space inside the button*/&lt;/span&gt; 

  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#414141&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/* All buttons are to have this dark background*/&lt;/span&gt;

  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/* Our text will be white*/&lt;/span&gt;

 &lt;span class="c"&gt;/* Explanation of the remaining 3 lines is just outside of this code block*/&lt;/span&gt;
  &lt;span class="nl"&gt;-webkit-transition-duration&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;--transition-time&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nl"&gt;-moz-transition-duration&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;--transition-time&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nl"&gt;transition-duration&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;--transition-time&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;So three last lines of this selector code do the same thing, it's just that not all browsers understand &lt;code&gt;transition-duration&lt;/code&gt; yet, so we use vendor/browser specific prefixes to have the same functionality cross-browsers and cross-versions.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;transition-duration&lt;/code&gt; and its sisters tell the browser to take some time to transit between the current state of the element and the future states. The future state in our case is &lt;code&gt;:hover&lt;/code&gt;, which is a pseudo-class CSS uses when the user hovers over an element.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;var(--transition-time)&lt;/code&gt; we're using the &lt;code&gt;var()&lt;/code&gt; function to reference the afore-declared &lt;code&gt;--transition-time&lt;/code&gt; custom property. The preceding rule is equivalent to writing &lt;code&gt;transition-duration: 0.5s;&lt;/code&gt;. &lt;/p&gt;

&lt;h4&gt;
  
  
  -3 button:hover
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="c"&gt;/* We're telling the browser to apply the following rules to any button that gets hovered over by the user*/&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;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--main-color&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c"&gt;/* We're setting the background color to our afore-declared custom property*/&lt;/span&gt;

  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;black&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c"&gt;/* We're setting the text color to black*/&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;The difference between the two styles of buttons lays in the two remaining selectors&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  -4 .border-btn
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.border-btn&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="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--main-color&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="m"&gt;5px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We're selecting the elements that have border-btn in their class, and giving them a bottom border of our &lt;code&gt;--main-color&lt;/code&gt;, with a 5 pixel width and a solid continuous style. Remember when we gave all our buttons a &lt;code&gt;border&lt;/code&gt; of zero? We're overriding that now, thanks to &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity" rel="noopener noreferrer"&gt;CSS specifity&lt;/a&gt;. We're only overriding the bottom border, the rest stay zeroed.&lt;/p&gt;

&lt;h4&gt;
  
  
  -5 .shadow-btn
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.shadow-btn&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="nb"&gt;inset&lt;/span&gt; &lt;span class="m"&gt;0px&lt;/span&gt; &lt;span class="m"&gt;-5px&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;--main-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;Here, we're making the same thing as before but using the box-shadow property.&lt;br&gt;
We're adding an inset (inside) shadow of 0 pixels in horizontal offset; -5 vertical offset, it's negative so the shadow would be in the bottom; and colored with our &lt;code&gt;--main-color&lt;/code&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  -Difference between .shadow-btn and .border-btn
&lt;/h4&gt;

&lt;p&gt;If you look closely at the result, the main resulting difference is the height, the &lt;code&gt;.border-btn&lt;/code&gt; is 5px bigger. It's because the border edge thing is located outside the box.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; So the shadow is smaller because the shadow edge thing is located inside, why not use the default outer shadow?&lt;br&gt;
&lt;strong&gt;A:&lt;/strong&gt; We can use &lt;code&gt;box-shadow&lt;/code&gt; without &lt;code&gt;inset&lt;/code&gt;, the &lt;code&gt;.shadow-btn&lt;/code&gt; would look exactly the same as the &lt;code&gt;.border-btn&lt;/code&gt;, but it will not behave the same way. If you hover over an outer shadow, the browser won't interpret it as hovering the element, it feels awkward. Go and try it on the CodePen!&lt;/p&gt;

</description>
      <category>css</category>
      <category>buttons</category>
    </item>
    <item>
      <title>How to attribute another author when you're committing on git?</title>
      <dc:creator>Salim MAHBOUBI</dc:creator>
      <pubDate>Mon, 07 May 2018 16:38:52 +0000</pubDate>
      <link>https://dev.to/ztickm/how-to-attribute-another-author-when-youre-committing-on-git-1cob</link>
      <guid>https://dev.to/ztickm/how-to-attribute-another-author-when-youre-committing-on-git-1cob</guid>
      <description>&lt;h1&gt;
  
  
  Why?
&lt;/h1&gt;

&lt;p&gt;You might find yourself in a situation where you have to commit some code that has been authored by someone else. They might not have access to the repo, or they might be accustomed to Bazaar/SVN/Mercurial but not git, or maybe they're just on a 3 years vacation.&lt;br&gt;
If you commit with the default &lt;a href="https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup" rel="noopener noreferrer"&gt;global or project config&lt;/a&gt;, git will present you as the author.&lt;br&gt;
You should not want that to happen for two reasons: &lt;br&gt;
1- You might take credit for someone else's work and that's unethical.&lt;br&gt;
2- You might take blame for their shitty code and that's bad.&lt;/p&gt;
&lt;h1&gt;
  
  
  How?
&lt;/h1&gt;

&lt;p&gt;For a new commit attributing another person, use this 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 commit &lt;span class="nt"&gt;--author&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Ms. Jane Codeldoe &amp;lt;Jane@Codeldoe.com&amp;gt;"&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Jane wrote this I'm just committing"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;How it looks on GitHub:&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%2Fdop2i6rf2ikrmoh8nuod.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdop2i6rf2ikrmoh8nuod.png" alt="Screenshot showing that a commit on Github"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For older commits, it's a bit more complicated, you want to avoid being in this kind of situations.&lt;br&gt;
But, there are solutions, you just need to do some good old googling (or Binging, or Duckduckgoing, whatever suits you).&lt;br&gt;
Solutions might vary depending on whether the commit is pushed to remote or not.&lt;br&gt;
Solutions also vary depending on the git hosting service you're using, I've seen GitHub specific solutions that might not work elsewhere.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;P.S&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;If you're stuck with this kind of problem, or any other problem you think I might be able to help solve, please contact me at  &lt;code&gt;msalim [at] boun.cr&lt;/code&gt; . I'll be glad to help with my humble know-how.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>versioncontrol</category>
    </item>
    <item>
      <title>Critique my JS solution to this CodeWars Kata</title>
      <dc:creator>Salim MAHBOUBI</dc:creator>
      <pubDate>Wed, 07 Mar 2018 20:45:57 +0000</pubDate>
      <link>https://dev.to/ztickm/critique-my-js-solution-to-this-codewars-kata--3icl</link>
      <guid>https://dev.to/ztickm/critique-my-js-solution-to-this-codewars-kata--3icl</guid>
      <description>&lt;h2&gt;
  
  
  The Kata
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://www.codewars.com/kata/554e4a2f232cdd87d9000038/train/javascript"&gt;exercice&lt;/a&gt; basically asks to convert any 'T' to 'A' any 'C' to 'G' and vice versa for any given string.&lt;/p&gt;

&lt;h2&gt;
  
  
  My solution
&lt;/h2&gt;

&lt;p&gt;I know it might not be the exemplary solution but it was the first thing that popped in my head.&lt;br&gt;
I wrote it first 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;DNAStrand&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dna&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;map&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;prototype&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&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;reversedDna&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dna&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="nx"&gt;x&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;y&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;switch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;A&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;T&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;T&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;A&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;G&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;C&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;C&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;G&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;break&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;y&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;reversedDna&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;join&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;then I thought to myself: "I can remove that y variable." So I did:&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;DNAStrand&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dna&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;map&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;prototype&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&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;reversedDna&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dna&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="nx"&gt;x&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;y&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;switch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;A&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;T&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;T&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;A&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;G&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;C&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;C&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;G&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;reversedDna&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;join&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;Then I thought: "I can get rid of the break lines since the return statements are already breaking, can't I?"&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;DNAStrand&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dna&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;map&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;prototype&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&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;reversedDna&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dna&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="nx"&gt;x&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;y&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;switch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;A&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;T&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;T&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;A&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;G&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;C&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;C&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;G&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="p"&gt;});&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;reversedDna&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;join&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;Is there any way to improve my solution? Do you have another way of doing that? Leave your remarks in the comments  &lt;/p&gt;

</description>
      <category>help</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Why I refused a high-paying job while being unemployed</title>
      <dc:creator>Salim MAHBOUBI</dc:creator>
      <pubDate>Tue, 27 Feb 2018 19:38:37 +0000</pubDate>
      <link>https://dev.to/ztickm/why-i-refused-a-high-paying-job-while-being-unemployed--1fj9</link>
      <guid>https://dev.to/ztickm/why-i-refused-a-high-paying-job-while-being-unemployed--1fj9</guid>
      <description>&lt;p&gt;&lt;em&gt;This was originally posted on my &lt;a href="https://ztickm.github.io/Why-I-refused-700-euros-job/"&gt;blog&lt;/a&gt;&lt;/em&gt;&lt;br&gt;&lt;br&gt;
I had to let go an opportunity that could have paid 700 Euros per month, which is way above the average pay in Algeria.&lt;/p&gt;

&lt;h2&gt;
  
  
  The offer
&lt;/h2&gt;

&lt;p&gt;The job discription stated that the employees were to teach and help computer science students in their last year of their master's degree.&lt;br&gt;
The teaching sessions were to be held via video calls for an hour or more. &lt;/p&gt;

&lt;p&gt;In addition to the salary, the company would pay for a relatively high-speed internet (8Mbps); for a high quality camera; and they would pay the salary for two to three months, in which the employee will have to study on their own some educative material the company would provide, 8 hours a day, 5 days a week.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I refused the offer
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Reason 1: The incompatibility of the candidates
&lt;/h3&gt;

&lt;p&gt;The company had gathered a dozen candidates, and scheduled a video call meeting regrouping all of us. I noticed that all candidates, including myself, were not fit for the job. Some candidates didn't even have education or experience related to computer science or computer engineering.&lt;br&gt;&lt;br&gt;
I began questioning that their mission was really about teaching and not bullshitting students into paying someone who would read course material for them.&lt;br&gt;&lt;br&gt;
The company was only looking for people who could communicate easily.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reason 2: Punctuality and time management
&lt;/h3&gt;

&lt;p&gt;I was told that I would have my first interview at 9am, but it was the aforementioned video call meeting. Which was followed by one to one interviews with all candidates, I ended up being interviewed at 12pm.&lt;br&gt;&lt;br&gt;
After which, we were told to stay on the group call until 2pm, for no reason. And we were asked to reconnect again at 3 to hear from the boss.&lt;br&gt;&lt;br&gt;
The whole thing was badly managed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reason 3: The contract
&lt;/h3&gt;

&lt;p&gt;Since it was a foreign company not implemented in Algeria, the employment terms stated that we would work as freelancers, with a minimum commitment of one year, with no leaves and no vacations.&lt;br&gt;
If a candidate was to change jobs or just stop, they would have had to repay the two/three months salary spent on the self-driven training.  &lt;/p&gt;

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

&lt;p&gt;In the past, I wouldn't have ever imagined letting go a job that paid this much, but I came to the realization that not every well paying job is worth the headaches and certainly not the ethics.&lt;/p&gt;

</description>
      <category>career</category>
      <category>ethics</category>
    </item>
    <item>
      <title>Explain PostgreSQL Like I'm Five</title>
      <dc:creator>Salim MAHBOUBI</dc:creator>
      <pubDate>Sat, 27 Jan 2018 14:09:47 +0000</pubDate>
      <link>https://dev.to/ztickm/explain-postgresql-like-im-five-h5c</link>
      <guid>https://dev.to/ztickm/explain-postgresql-like-im-five-h5c</guid>
      <description>&lt;p&gt;What differentiates Postgres from other SQL DBs?&lt;br&gt;
Can you include simple examples?&lt;/p&gt;

</description>
      <category>explainlikeimfive</category>
      <category>postgres</category>
    </item>
    <item>
      <title>As a senior dev, how can a recruiter convince you to move to another company?</title>
      <dc:creator>Salim MAHBOUBI</dc:creator>
      <pubDate>Sun, 22 Oct 2017 11:27:46 +0000</pubDate>
      <link>https://dev.to/ztickm/as-a-senior-dev-how-can-a-recruiter-convince-you-to-move-to-another-company-63h</link>
      <guid>https://dev.to/ztickm/as-a-senior-dev-how-can-a-recruiter-convince-you-to-move-to-another-company-63h</guid>
      <description></description>
      <category>discuss</category>
    </item>
    <item>
      <title>Will a Jack Of All Trades, Master Of None developer get hired these days?</title>
      <dc:creator>Salim MAHBOUBI</dc:creator>
      <pubDate>Mon, 09 Oct 2017 10:36:25 +0000</pubDate>
      <link>https://dev.to/ztickm/will-a-jack-of-all-trades-master-of-none-developer-get-hired-these-days-725</link>
      <guid>https://dev.to/ztickm/will-a-jack-of-all-trades-master-of-none-developer-get-hired-these-days-725</guid>
      <description>&lt;p&gt;I know how to start a product with a wide spectrum of languages/frameworks/tools, but I don't excel in any. I can make a good native android app with medium functionality, but I don't master the design and layouts. I can make a minimal Ruby on Rails app, but nothing more. I can make a small game in Unity 3D. I'm learning Elm, JS, and ReactJS, but I can't really build anything with them right now.&lt;br&gt;
I usually learn technologies when I need them.&lt;/p&gt;

&lt;p&gt;I'm trying to get hired overseas or work on a remote position, but it seems like a bit hard.&lt;br&gt;
Should I just quit applying and focus on learning a narrow set of skills, or do companies hire learners like me? &lt;/p&gt;

</description>
      <category>discuss</category>
      <category>career</category>
      <category>junior</category>
    </item>
  </channel>
</rss>
