<?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: jimenezfede</title>
    <description>The latest articles on DEV Community by jimenezfede (@jimenezfede).</description>
    <link>https://dev.to/jimenezfede</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%2F848696%2Ffcf64d9e-f7f4-41b8-bd61-9c1d1f493bf6.png</url>
      <title>DEV Community: jimenezfede</title>
      <link>https://dev.to/jimenezfede</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jimenezfede"/>
    <language>en</language>
    <item>
      <title>Typescript with React</title>
      <dc:creator>jimenezfede</dc:creator>
      <pubDate>Mon, 24 Oct 2022 20:29:10 +0000</pubDate>
      <link>https://dev.to/jimenezfede/typescript-with-react-2m7f</link>
      <guid>https://dev.to/jimenezfede/typescript-with-react-2m7f</guid>
      <description>&lt;p&gt;I didn't think typescript with JavaScript was too bad. But when I tried it with React, I had a really hard time getting used to it. From passing down props, to setting up state, and then returning HTML, I really struggled. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Props&lt;/strong&gt;&lt;br&gt;
Whenever passing props into a component, the type of props has to be identified. This is more lines of code to write, but it is worth it, so you don't have to try to remember which properties were in the props. Or having to flip back and forth between the file passing the props and the file receiving them. The props can be identified by types or interfaces.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;BlogProps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Blog&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="nx"&gt;BlogProps&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nx"&gt;JSX&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Element&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;State&lt;/strong&gt;&lt;br&gt;
Before typescript, setting up state was simply done inside the parenthesis of setState. And when doing so with primitive types, it's still the same, just through a string or number inside the parenthesis. But when setting up state with complex types, then the type has to be identified also. This can be done by writing the type before setting state, then passing that type between setState and the ().&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Blog&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nx"&gt;JSX&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Element&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fede&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="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;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;strong&gt;Errors&lt;/strong&gt;&lt;br&gt;
Typescript errors can seem to be a paragraph long. It's also a lot of new syntaxes to get used to. When installing &lt;code&gt;@types/react&lt;/code&gt; we get the whole react types library. This means all the HTML elements. This is what's used to check if the element is being used right. And by used right, I mean using the attributes the element has right. This also means not trying to use attributes that don't exist in the element. Then there are the custom elements. The errors from these are usually from defining the right type for the props going in them. &lt;/p&gt;

&lt;p&gt;Typescript seems to be the solution to having to guess what type of value passes through a component. This means no more having to flip through files to see what kind of prop I'm getting anymore. It came at a cost of losing my mind learning it, but it was worth it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Sources&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  - &lt;a href="https://react-typescript-cheatsheet.netlify.app"&gt;https://react-typescript-cheatsheet.netlify.app&lt;/a&gt;
&lt;/h2&gt;

</description>
    </item>
    <item>
      <title>Intro to Bootstrap</title>
      <dc:creator>jimenezfede</dc:creator>
      <pubDate>Mon, 10 Oct 2022 14:01:18 +0000</pubDate>
      <link>https://dev.to/jimenezfede/intro-to-bootstrap-463i</link>
      <guid>https://dev.to/jimenezfede/intro-to-bootstrap-463i</guid>
      <description>&lt;p&gt;I always enjoyed drawing. I'm pretty decent at it. But when it comes to styling a webpage, it's as if I can't stay coloring inside the lines, so to speak. Learning CSS is pretty difficult for me. And using bootstrap is like grabbing a drawing, placing a piece of paper over it, then drawing the outline. Bootstrap does all the heavy lifting for styling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Structure&lt;/strong&gt;&lt;br&gt;
Bootstrap has a grid system structure with containers that are wrappers for rows, which then are wrappers for columns. To use a container, simply assign the element's class to the type of container as so &lt;code&gt;&amp;lt;div class='container'&amp;gt;&amp;lt;div&amp;gt;&lt;/code&gt;. Bootstrap has three different types of containers: &lt;code&gt;.container&lt;/code&gt;, &lt;code&gt;.container-fluid&lt;/code&gt;, and &lt;code&gt;.container-{breakpoint}&lt;/code&gt;. Breakpoints are the size of the container. There are six breakpoints: xs, sm, md, lg, xl, and xxl. The same goes for using rows and columns. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sass&lt;/strong&gt;&lt;br&gt;
Bootstrap uses sass variables and mixins to query breakpoints. Variables are prefixed with &lt;code&gt;$&lt;/code&gt; and can be found in &lt;code&gt;_variable.scss&lt;/code&gt;. Media queries are prefixed with &lt;code&gt;@&lt;/code&gt; and are used through sass mixins.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Components&lt;/strong&gt;&lt;br&gt;
Bootstrap has many components. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Alerts&lt;/li&gt;
&lt;li&gt;Badge&lt;/li&gt;
&lt;li&gt;Breadcrumb&lt;/li&gt;
&lt;li&gt;Buttons&lt;/li&gt;
&lt;li&gt;Button group&lt;/li&gt;
&lt;li&gt;Card&lt;/li&gt;
&lt;li&gt;Carousel&lt;/li&gt;
&lt;li&gt;Collapse&lt;/li&gt;
&lt;li&gt;Dropdowns&lt;/li&gt;
&lt;li&gt;Forms&lt;/li&gt;
&lt;li&gt;Input group&lt;/li&gt;
&lt;li&gt;Jumbotron&lt;/li&gt;
&lt;li&gt;List group&lt;/li&gt;
&lt;li&gt;Modal&lt;/li&gt;
&lt;li&gt;Navs&lt;/li&gt;
&lt;li&gt;Navbar&lt;/li&gt;
&lt;li&gt;Pagination&lt;/li&gt;
&lt;li&gt;Popovers&lt;/li&gt;
&lt;li&gt;Progress&lt;/li&gt;
&lt;li&gt;Scrollspy&lt;/li&gt;
&lt;li&gt;Tooltips&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks to bootstrap, styling is a lot easier. Still gotta do the research on how to use bootstrap, but after a couple of hours on the docs, and some practice, it finally clicks on how to use it. And it is definitely worth the time to do it. Cause afterwards, you may just feel like Michelangelo styling the sistine chapel on your webpage. But if not, then at worst, you'll be able to stay coloring inside the lines in your webpage, so to speak.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Sources&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=Jyvffr3aCp0&amp;amp;t=193s"&gt;https://www.youtube.com/watch?v=Jyvffr3aCp0&amp;amp;t=193s&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://getbootstrap.com/docs/5.2/getting-started/introduction/"&gt;https://getbootstrap.com/docs/5.2/getting-started/introduction/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Intro to Vim</title>
      <dc:creator>jimenezfede</dc:creator>
      <pubDate>Mon, 26 Sep 2022 07:15:11 +0000</pubDate>
      <link>https://dev.to/jimenezfede/neovim-jd5</link>
      <guid>https://dev.to/jimenezfede/neovim-jd5</guid>
      <description>&lt;p&gt;Ever been stuck in the terminal for not including a message when committing? Can't get out by pressing &lt;code&gt;esc&lt;/code&gt; or &lt;code&gt;q&lt;/code&gt;. Seriously had to google how to exit vim or nano every time.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UzyCWQ6h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/60abczvi0lkgd938pz5a.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UzyCWQ6h--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/60abczvi0lkgd938pz5a.gif" alt="this is madness" width="480" height="198"&gt;&lt;/a&gt;&lt;br&gt;
Madness? This is a top-of-the-line text editor!&lt;/p&gt;

&lt;p&gt;The most confusing part of vim to me was the modes. What's the point of all these modes? Well, after a lot of research, I found my answer. Now bear with me here, I'm still new to coding, so every time I hear of a keyboard shortcut I get excited. It's like finding hidden treasure. And you know those coders that are so good their hands never leave the keyboard to touch the mouse? They are like grand master coders to me. Well, with these text editors, the mouse doesn't exist. There is no scrolling up and down and clicking on a word with the mouse. So how does one move around? With the keyboard. For example, the letters &lt;code&gt;h&lt;/code&gt;, &lt;code&gt;j&lt;/code&gt;, &lt;code&gt;k&lt;/code&gt; &amp;amp; &lt;code&gt;l&lt;/code&gt; are used to move left, down, up &amp;amp; right. What if I need to type using those letters? Switch modes, normal mode is the movement mode, and insert mode is for typing. This is how one keeps their hands off the mouse or the arrow keys, for the most part. Now when first starting, like I am, being restricted to only these few commands along with a few others I learned on &lt;code&gt;:Tutor&lt;/code&gt; from nvim keeps me pretty slow. Kind've like how I started learning to code with var. Now, I can't even remember the last time I actually used var. Whenever I come across var, I'm like, 'what's this?'.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0QP5kjvJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3pxroynepu2kya76qc3g.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0QP5kjvJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3pxroynepu2kya76qc3g.gif" alt="Ryan Gosling" width="500" height="307"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;List of basic moment commands &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;move around = &lt;code&gt;h&lt;/code&gt; - left, &lt;code&gt;j&lt;/code&gt; - down, &lt;code&gt;k&lt;/code&gt; - up, &lt;code&gt;l&lt;/code&gt; - right&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;hope forward by word = &lt;code&gt;w&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;hope backwards by a word = &lt;code&gt;b&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;jump to the beginning of line = &lt;code&gt;SHIFT I&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;jump to the end of line = &lt;code&gt;SHIFT A&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;search for word =  &lt;code&gt;/&lt;/code&gt; (equivalent to &lt;code&gt;CTRL F&lt;/code&gt;)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;jump through results = &lt;code&gt;n&lt;/code&gt; or backwards &lt;code&gt;SHIFT N&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;List of basic editing commands&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;insert before the cursor = &lt;code&gt;i&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;insert after the cursor = &lt;code&gt;a&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;add line below and enter insert mode = &lt;code&gt;o&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;add line above and enter insert mode = &lt;code&gt;SHIFT O&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;copy/yank a word = &lt;code&gt;y&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;copy/yank line = &lt;code&gt;yy&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;paste line one line below = &lt;code&gt;p&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;delete character = &lt;code&gt;x&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;delete line = &lt;code&gt;dd&lt;/code&gt; (goes to same register as yank command)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;undo last command = &lt;code&gt;u&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;exit to normal mode = &lt;code&gt;Esc&lt;/code&gt; || &lt;code&gt;CTRL [&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enter Visual Mode = &lt;code&gt;v&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;highlight a word = &lt;code&gt;w&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;highlight line below = &lt;code&gt;j&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;delete current word and forward = &lt;code&gt;dw&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;delete current line plus one down = &lt;code&gt;dj&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;yank word = &lt;code&gt;yw&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;yank current line plus one down = &lt;code&gt;yj&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;help with specific word = &lt;code&gt;:help &amp;lt;topic&amp;gt;&lt;/code&gt; or &lt;code&gt;:helpgrep &amp;lt;topic&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now my first interaction with vim, back when I forgot to commit a message, I saw a plain, boring editor. No colors or special fonts. Well, vim is the most powerful when it's stripped of all those things that make it pretty. But vim is very customizable, just not easy to do. So here's where neovim comes to the rescue.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7NPKPkP_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1wh2mdx8zeb3ntbijq4v.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7NPKPkP_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1wh2mdx8zeb3ntbijq4v.gif" alt="Neo fighting" width="768" height="432"&gt;&lt;/a&gt; Not only are there so many configurations for neovim, but it's easier to configure.&lt;/p&gt;

&lt;p&gt;Just like with learning any new language, it's best to start with the basics. I started with &lt;code&gt;:Tutor&lt;/code&gt; with neovim. There's also &lt;code&gt;vimtutor&lt;/code&gt; from vim, which says it's only 20 minutes. Neovim's tutor took me longer than 20 minutes, but it doesn't have colors. Vim's tutor &lt;code&gt;vimtutor&lt;/code&gt; looks like it might be shorter. &lt;/p&gt;

&lt;p&gt;Sources&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://derekwyatt.org/vim/tutorials/novice/#Welcome"&gt;http://derekwyatt.org/vim/tutorials/novice/#Welcome&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>vim</category>
      <category>neovim</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Docker</title>
      <dc:creator>jimenezfede</dc:creator>
      <pubDate>Mon, 22 Aug 2022 05:08:20 +0000</pubDate>
      <link>https://dev.to/jimenezfede/docker-ekm</link>
      <guid>https://dev.to/jimenezfede/docker-ekm</guid>
      <description>&lt;p&gt;What does Docker do? What are containers? What are images? Why is this service so popular? I kept hearing about docker and how it uses containers. But had no clue as to why or what exactly these containers are or do. So after spending a couple of hours on dockers website, I got my answers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Images
&lt;/h2&gt;

&lt;p&gt;To create an image, Docker uses a file called Dockerfile. This file contains a list of commands of what should be in an image when it gets built. Once this list is completed, it’s sent to the Docker engine which then builds the image by running the commands. Each of these commands are layers. When a change is made on a certain layer, then only that layer gets rebuilt. This is why the containers are ‘lightweight’. So let’s say I have an outfit. My shirt, pants, and shoes are separate layers. And if I want to change my shirt, instead of having to get a whole new outfit, I can just throw away my shirt and get a new one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Containers
&lt;/h2&gt;

&lt;p&gt;A container is a process that’s kept separate from the rest of the system. It holds all the configurations and supporting files, which are images, needed for an app to run. It can have one or multiple images. The set up is made so that if an image goes down, then it can easily and quickly be replaced. A container also has its own file system and network. This is why when running the container, a specific port needs to be given. And this is also what makes it really secure. And if more than one container is needed on the same network, then they can be made to share the port. Containers are simply set on ‘isolation’ mode by default.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IGDu_OLX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uwefkz190bh0o0xc1z1g.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IGDu_OLX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uwefkz190bh0o0xc1z1g.gif" alt="isolation" width="357" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Docker Client
&lt;/h2&gt;

&lt;p&gt;Docker Client are the commands to run when communicating with Docker.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Docker build&lt;/code&gt; - builds the Dockerfile&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Docker run&lt;/code&gt; — runs a new container&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Docker image&lt;/code&gt; - manages an image&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Docker container&lt;/code&gt; - manages a container&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Docker pull&lt;/code&gt; — pulls an image from DockerHub&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Docker push&lt;/code&gt; - pushes an image to DockerHub&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Docker solves the environmental issues of running an application on ones own computer. No more having to worry about if my computer is gonna give me problems with running my app. I have a hard enough time just getting through git commands and eslint format issues when trying to commit.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ouJ1Lj0X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vkssdjnt32ld3c6771wu.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ouJ1Lj0X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vkssdjnt32ld3c6771wu.gif" alt="too many problems" width="220" height="124"&gt;&lt;/a&gt;&lt;br&gt;
 I can have my whole app run with docker. The code I write, the database, whatever I want. Simply just set everything in containers and let them work their magic. Gives me more time to code more console.log(‘Hello World’).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sources&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.docker.com"&gt;https://docs.docker.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.docker.com"&gt;https://www.docker.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>docker</category>
      <category>javascript</category>
    </item>
    <item>
      <title>MySQL</title>
      <dc:creator>jimenezfede</dc:creator>
      <pubDate>Mon, 15 Aug 2022 03:55:00 +0000</pubDate>
      <link>https://dev.to/jimenezfede/mysql-4fgf</link>
      <guid>https://dev.to/jimenezfede/mysql-4fgf</guid>
      <description>&lt;p&gt;Short for Structured Query Language, is a language for handling data in a relational database management system (RDBMS) like MySQL, Oracle, Postgres, etc. So think of a spreadsheet going super Saiyan by having the ability to sort out all the columns and rows in any combination possible really fast.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SYNTAX&lt;/strong&gt;&lt;br&gt;
Its common practice to use all capital letters when writing SQL commands. And to end statements with a semicolon. The capital letters are more for readability so that it's easy to distinguish when SQL commands are being used. But the semicolon is required in some RDBMS like MySQL. The reason is, a command may run more than one line, and so a semicolon is used to establish the end of the command.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NAVIGATING&lt;/strong&gt;&lt;br&gt;
Just navigating through databases is a learning process. Because whenever one of these databases is started, it just shows a blank prompt. There is a &lt;code&gt;help&lt;/code&gt; command that lists a lot of helpful commands. The command &lt;code&gt;show databases&lt;/code&gt; will list all the databases if any. Then the command &lt;code&gt;use&lt;/code&gt; followed by the name of the database name selects that database. Once using a database, &lt;code&gt;show tables&lt;/code&gt; will list all the tables. Then another useful command is &lt;code&gt;describe&lt;/code&gt; which will show how the table is made.&lt;/p&gt;

&lt;p&gt;w3schools has these commands as the most common ones&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SELECT &lt;/li&gt;
&lt;li&gt;UPDATE &lt;/li&gt;
&lt;li&gt;DELETE &lt;/li&gt;
&lt;li&gt;INSERT INTO &lt;/li&gt;
&lt;li&gt;CREATE DATABASE &lt;/li&gt;
&lt;li&gt;ALTER DATABASE&lt;/li&gt;
&lt;li&gt;CREATE TABLE&lt;/li&gt;
&lt;li&gt;ALTER TABLE &lt;/li&gt;
&lt;li&gt;DROP TABLE &lt;/li&gt;
&lt;li&gt;CREATE INDEX &lt;/li&gt;
&lt;li&gt;DROP INDEX &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;CREATING&lt;/strong&gt;&lt;br&gt;
Creating a database is as simple as just using &lt;code&gt;CREATE DATABASE dc_universe&lt;/code&gt;. But creating a table takes a little more. With creating a table, the table's name, column name, and the datatype of the values going into that column. There are a lot of datatypes to choose from. But for this, I will just use int (integer) and varchar(variable character). Varchar takes in a number representing the limit of characters for it. 255 is commonly used.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;superheroes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;span class="n"&gt;ID&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="k"&gt;Alias&lt;/span&gt; &lt;span class="nb"&gt;varchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="n"&gt;firstName&lt;/span&gt; &lt;span class="nb"&gt;varchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="n"&gt;lastName&lt;/span&gt; &lt;span class="nb"&gt;varchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PG13Ah0j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z6pund36776z514ckwuh.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PG13Ah0j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z6pund36776z514ckwuh.jpg" alt="Creating table" width="564" height="211"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;INSERTING&lt;/strong&gt;&lt;br&gt;
Then to add to the table, use the &lt;code&gt;insert into&lt;/code&gt; keyword followed by the name of the table, then the  keyword with the information to add.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;superheroes&lt;/span&gt; &lt;span class="k"&gt;VALUES&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="s1"&gt;'Batman'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Bruce'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Wayne'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;superheroes&lt;/span&gt; &lt;span class="k"&gt;VALUES&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="s1"&gt;'Superman'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Clark'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Kent'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;superheroes&lt;/span&gt; &lt;span class="k"&gt;VALUES&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="s1"&gt;'Wonder Woman'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Diana'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Prince'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;SELECTING&lt;/strong&gt;&lt;br&gt;
From here, to see the actual values in the table, the &lt;code&gt;SELECT&lt;/code&gt; and &lt;code&gt;FROM&lt;/code&gt; keywords are needed. &lt;code&gt;SELECT&lt;/code&gt; chooses the column. &lt;code&gt;FROM&lt;/code&gt; picks the table. &lt;br&gt;
&lt;code&gt;SELECT Alias FROM superheroes;&lt;/code&gt; will list just the alias name.&lt;br&gt;
&lt;code&gt;SELECT * FROM superheroes;&lt;/code&gt; will list all the columns in the table.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qz26dTzm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d9ub7rxq0lrzom0m01kd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qz26dTzm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d9ub7rxq0lrzom0m01kd.jpg" alt="Justice League" width="643" height="186"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DELETING&lt;/strong&gt;&lt;br&gt;
I actually made a mistake adding batman to the table while practicing. I forgot to add to the ID column. Thankfully, deleting is pretty easy to do.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S4RMp-uU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0yn3stsaftltsabl677p.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S4RMp-uU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0yn3stsaftltsabl677p.jpg" alt="Oops" width="588" height="119"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;DELETE&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;superheroes&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;ID&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;WHERE&lt;/code&gt; filters out the table by the criteria. Here I'm filtering out where the ID doesn't have a value since I forgot to give it a value.&lt;/p&gt;

&lt;p&gt;Using SQL can seem tedious when just starting to use it. I myself kept getting error messages from using the wrong syntax to trying to access tables that don't exist. But like anything else, just takes practice.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Sources&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.w3schools.com/sql/default.asp"&gt;https://www.w3schools.com/sql/default.asp&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=Yw3NNvqk-2o&amp;amp;t=4786s"&gt;https://www.youtube.com/watch?v=Yw3NNvqk-2o&amp;amp;t=4786s&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>sql</category>
      <category>javascript</category>
      <category>mysql</category>
    </item>
    <item>
      <title>EXPRESS JS</title>
      <dc:creator>jimenezfede</dc:creator>
      <pubDate>Mon, 08 Aug 2022 05:05:00 +0000</pubDate>
      <link>https://dev.to/jimenezfede/express-js-5foh</link>
      <guid>https://dev.to/jimenezfede/express-js-5foh</guid>
      <description>&lt;p&gt;Express is a very popular application to create servers in node. And for good reason, it's really convenient to use. And when learning anything, gotta start with the basics.&lt;/p&gt;

&lt;p&gt;To set up express, the express package needs to be downloaded &lt;code&gt;npm install express&lt;/code&gt;.  Then require it in the file with &lt;code&gt;const express = require('express')&lt;/code&gt;. To create the express application, simply just call it and assign it to a variable like so &lt;code&gt;const app = express()&lt;/code&gt;. Now that the application has been created, the ‘listen’ method is used to make it run on a port, &lt;code&gt;app.listen(3000)&lt;/code&gt;.  And with express, the order in which it is set up does matter. So the listen method will have to be at the bottom. Even below any other methods that will be set up.&lt;/p&gt;

&lt;p&gt;In the internet world, the slashes in the url direct to specific routes. The code above creates a homepage on route localhost:3000. So any interaction with the server has to be done with the route. And here is where Express excels. Express has many methods to interact with routes. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Route Methods&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Express route methods, like get, post, etc, come from HTTP request methods. The get method takes in at least 2 arguments. The first is the route. The route can be a string or a variable. The second argument is a function that acts like middleware by handling the request object sent to the route.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Homepage&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, this get request has the route set to the homepage with just a forward slash ‘/’. And the middleware is just a function that has request and response parameters. Then it just sends a response ‘Homepage’ when a request is made to the homepage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multiple Middlewares&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A route can have multiple middleware functions to handle the request object. When using multiple functions, then having a third parameter called ‘next’ is needed. The purpose of this ‘next’ function is to pass the request to the next middleware function in that route or to another different route.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/user/:id&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="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Batman&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/Batcave)
else next()
}, (req, res, next) =&amp;gt; {
res.send(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="nx"&gt;Go&lt;/span&gt; &lt;span class="nx"&gt;away&lt;/span&gt; &lt;span class="nx"&gt;Robin&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;)
})
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Express also has a 'use' method that will pass the middleware for every method used below it. For example, passing json through will then automatically parse data when sending it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/batsignal&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="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Nana Nana Nana&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;req&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;batman&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;strong&gt;Chainable Route Handlers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A route can be chained with multiple handlers, like get, post, put, etc. Which helps not to have repeat code. This is done with the &lt;code&gt;Router()&lt;/code&gt; method which makes a new router object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express&lt;/span&gt;&lt;span class="dl"&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;router&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Router&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/:batsuit&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="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="err"&gt;⇒&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Get batsuit &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;batsuit&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="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="err"&gt;⇒&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Add batsuit &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;batsuit&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="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;put&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="err"&gt;⇒&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Update batsuit &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;batsuit&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="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Express has so many more methods, these are just the ones I’ve been exposed to the most. Except for route chaining, I just learned about that one. I'm already daydreaming about how pretty my code will look when I use it. The express docs are pretty easy to navigate. After writing this, I am definitely a big fan of express.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Sources&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://expressjs.com/en/4x/api.html#expres"&gt;https://expressjs.com/en/4x/api.html#expres&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/expressjs/express/blob/master/lib/application.js#L540-543"&gt;https://github.com/expressjs/express/blob/master/lib/application.js#L540-543&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>node</category>
    </item>
    <item>
      <title>Python</title>
      <dc:creator>jimenezfede</dc:creator>
      <pubDate>Mon, 27 Jun 2022 13:47:42 +0000</pubDate>
      <link>https://dev.to/jimenezfede/python-1jmi</link>
      <guid>https://dev.to/jimenezfede/python-1jmi</guid>
      <description>&lt;p&gt;Python is a very popular coding language. Its creator Guido van Rossum made it to be read easily and to be used for any task. Guido has a master’s degree in computer science and mathematics, which explains why python works great with mathematics. It’s open-source so anybody can help by contributing to the language. Today python’s latest update is a major version 3. As much as I wanna go over everything in python, I’m going to just go over the very basics of syntax and forming strings. Python uses a new line to finish an operation, whereas javascript uses a semicolon. For loops, functions, and classes are made through spaces with python, javascript uses curly braces. At least one space is needed, but four is the standard practice. The amount of spaces chosen has to be used on each line for the block of code to work, else python gives an error.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Variables&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Python creates variables by assigning them to a value. Theres no declaring a variable in python as there is in javascript.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'Bruce Wayne'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pseudo coding, writing comments, is done by writing after the # character. In python, a variable can be set to a particular datatype through a process called casting.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'1'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# prints '1'
&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# prints 1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Type method is a python function that returns the datatype of a variable&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="c1"&gt;# prints &amp;lt;class 'str'&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Python's string datatype can be formed with single or double quotes. For a string that will run more than one line, they can be formed with three single or double quotes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;achilles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'''Let no man forget how menacing we are, we are lions! Do you know
whats waiting beyond that beach? Immortality! Take it! It's yours!'''&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If looking for a word inside of a string, the keyword in can be used.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'lions'&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;achilles&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# prints true
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Can also use an if conditional to check for a word&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;sparta&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'SPARTANS! what is your profession?'&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="s"&gt;'profession'&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;sparta&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;'HA-OOH! HA-OOH! HA-OOH!'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# prints HA-OOH! HA-OOH! HA-OOH!
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or can check if a word isn’t in a string with the not keyword&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="s"&gt;'cook'&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;sparta&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;'false'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# prints false
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To turn the characters in a string from lower case to upper case, theres an upper method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;upperCaseBatman&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;upper&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="n"&gt;upperCaseBatman&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# prints BATMAN
&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;upperCaseBatman&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="c1"&gt;# prints batman
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Adding a string and a variable can be done with the addition operator.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-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;vengeance&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;'I am '&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;vengeance&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;# prints I am Batman
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Python has many methods for strings. These are just a few. The syntax is pretty easy to catch on. And I must admit, it does make python very easy to read. Also makes it look really clean.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Sources&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.w3schools.com/python/default.asp"&gt;https://www.w3schools.com/python/default.asp&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
    </item>
    <item>
      <title>npm install care-package</title>
      <dc:creator>jimenezfede</dc:creator>
      <pubDate>Mon, 20 Jun 2022 04:53:47 +0000</pubDate>
      <link>https://dev.to/jimenezfede/npm-install-care-package-22jn</link>
      <guid>https://dev.to/jimenezfede/npm-install-care-package-22jn</guid>
      <description>&lt;p&gt;Node.js is a repository of open-source software. npm manages the packages in node.js. So if I wanted to use somebody else’s code library, like underscore.js, then I would need to install it into my own project through npm.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WqNqefeq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zv2itv17qro9gfo2qrt0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WqNqefeq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zv2itv17qro9gfo2qrt0.png" alt="Image description" width="880" height="82"&gt;&lt;/a&gt; This saves me time and headache from having to write my project from scratch. But first, I would need to install npm in my computer globally to use it.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oKe2jDH---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4s78q44x2dlkh4askc9e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oKe2jDH---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4s78q44x2dlkh4askc9e.png" alt="Image description" width="683" height="159"&gt;&lt;/a&gt;&lt;br&gt;
 What’s the difference between installing globally and installing in my project (locally)? Well, let’s get into that.&lt;/p&gt;

&lt;p&gt;Installing something globally makes it accessible from anywhere in my computer’s terminal. Whereas installing something locally, like in a new project’s directory, will make it accessible only in that directory. So if I create another project, let’s call it ‘callOfDuty’, then the underscore’s package won’t be accessible here. Why not just install everything globally so I won’t have to keep installing packages on each project every time I make a new project? Well because some packages can take up a lot of memory if it is also using some other package to run its own. This brings up a package’s dependencies.&lt;/p&gt;

&lt;p&gt;When installing a package, npm will read the package’s project.json file. This file will have a dependencies property that will list any other packages it uses. So npm will also install those other packages as well with their dependencies also and so on. I mean look at all these dependencies.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zsIq5Epd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mphqm6hm72x2aw6xsfcf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zsIq5Epd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mphqm6hm72x2aw6xsfcf.png" alt="Image description" width="880" height="395"&gt;&lt;/a&gt;&lt;br&gt;
 Therefore it’s probably best to just install all this into a project’s directory. &lt;/p&gt;

&lt;p&gt;What is nvm? Nvm manages the version of node.js. So if I had multiple versions of node.js installed on my computer, nvm would be in charge of each node.js version. Now, why would I want to have multiple versions of node.js on my computer? Well, some packages installed on a certain project may not be up to date, so they may still be using an older version of node.js. Therefore, having an older version could be useful.&lt;/p&gt;

&lt;p&gt;How are packages made? To create a package, simply type &lt;code&gt;npm init&lt;/code&gt; in the terminal inside of the directory for the project. Then just answer a few questions npm has about the package.  Another option is to type &lt;code&gt;npm init -y&lt;/code&gt;, and npm will create the package with default values. And those default names can be changed later.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Resources:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/sindresorhus/awesome-npm#packages"&gt;https://github.com/sindresorhus/awesome-npm#packages&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=P3aKRdUyr0s&amp;amp;t=359s"&gt;https://www.youtube.com/watch?v=P3aKRdUyr0s&amp;amp;t=359s&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.npmjs.com/"&gt;https://www.npmjs.com/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Npm_(software)"&gt;https://en.wikipedia.org/wiki/Npm_(software)&lt;/a&gt;&lt;br&gt;
__&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>npm</category>
      <category>node</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Git Thanos</title>
      <dc:creator>jimenezfede</dc:creator>
      <pubDate>Wed, 27 Apr 2022 01:26:16 +0000</pubDate>
      <link>https://dev.to/jimenezfede/git-thanos-ohe</link>
      <guid>https://dev.to/jimenezfede/git-thanos-ohe</guid>
      <description>&lt;p&gt;Git can be pretty scary. Especially for a person that’s new to coding like me. But the way to get better , no pun intended, is to get familiar with it. So let’s start off with what git is. It's a software that tracks changes in repos. And yes, a repo is short for repository. A repo consists of snapshots, each snapshot is called a commit. I create a repo called ‘getThanos’ in my github account. Then I clone it to my local computer by typing &lt;code&gt;git clone nameOfTheRepoGoesHere&lt;/code&gt;. The repo comes with its first commit named ‘main’.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git add&lt;/strong&gt;&lt;br&gt;
I start working on my file getThanos.js. My first edit is to gather all the avengers. I like this edit so I add it to my staging area by typing &lt;code&gt;git add getThanos.js&lt;/code&gt;. The staging area is where you place your edits before making another commit of them. The staging area notifies git that there’s been some changes to the file. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git commit&lt;/strong&gt;&lt;br&gt;
So now the avengers have a plan to get thanos. But this is risky and dangerous, so I wanna be safe and commit now. I do this by typing &lt;code&gt;git commit -m 'gathered avengers and now have a plan'&lt;/code&gt;. The -m is for adding a message to my commit so that I know what edits that commit has. In this case, that commit has the avengers plan to get Thanos.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git branch&lt;/strong&gt;&lt;br&gt;
Now before going forward with the plan, I wanna make some sort of version to try out my plan, so that if something goes horribly wrong, I can go back. Well in git, they have branches, where you can do edits and it won’t affect the main branch. So I do this by typing &lt;code&gt;git branch sendOutSpiderman&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git checkout&lt;/strong&gt;&lt;br&gt;
I created a branch, but I’m still on the ‘main’ branch. To do edits on the ‘sendOutSpiderman’ branch, I have to check it out with the command &lt;code&gt;git checkout sendOutSpiderman&lt;/code&gt;. So now I proceed with the plan. But spiderman runs into problems, he’s not focused since he wasn’t accepted into MIT. Okay so this plan isn’t gonna work, let’s go back to the main branch by typing &lt;code&gt;git checkout main&lt;/code&gt;. We have another plan to send out the Hulk. So we create another branch, &lt;code&gt;git checkout -b sendOutHulk&lt;/code&gt;. Combining ‘checkout’ with ‘-b’ is a shortcut to creating a branch and checking it out in one step.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git merge&lt;/strong&gt;&lt;br&gt;
Now we proceed with the Hulk. He couldn’t get Thanos, but there is some good in this edit, spiderman got accepted to MIT here. So I wanna save this edit and bring it into my main branch. To combine branches, git has a merge command. I save these edits and commit them, &lt;code&gt;git add getThanos.js&lt;/code&gt; then &lt;code&gt;git commit -m 'spiderman got into MIT'&lt;/code&gt;. Now I’m ready to combine them, so I checkout my main branch with &lt;code&gt;git checkout main&lt;/code&gt; then combine with &lt;code&gt;git merge sendOutHulk&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git revert / git reset&lt;/strong&gt;&lt;br&gt;
Now let’s fast forward to the end, you know where Ironman snaps his fingers. Let’s say I’m too heartbroken by this and want to go back right before that happened. There’s two ways git allows this. One is reset and the other is revert. Reset will move my current branch main back a commit. Which they say is like “rewriting history”. But when sharing a branch with others, reset can confuse other users. Revert will move the current branch to a new commit. This new commit won’t have the edits made in the commit I didn’t want. So in the situation with Ironman, let’s say my commit before that was when Star-Lord got mad at Thanos for killing Gamora. Revert will make a new commit after my current commit with Ironman snapping his fingers, but this new commit will be a copy of the Star-Lord commit. And now I can rewrite the ending. In this way, my Ironman snapping his fingers is still in my history, and I can use it for my bloopers.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
