<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Cristiansalerno on Medium]]></title>
        <description><![CDATA[Stories by Cristiansalerno on Medium]]></description>
        <link>https://medium.com/@cristiansalerno18?source=rss-42374db44679------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*VF-OrgLlH3n6cB6K.jpg</url>
            <title>Stories by Cristiansalerno on Medium</title>
            <link>https://medium.com/@cristiansalerno18?source=rss-42374db44679------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 10:38:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cristiansalerno18/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Backend — NodeJS, Login and Password Hash with bcrypt]]></title>
            <link>https://medium.com/@cristiansalerno18/backend-nodejs-login-and-password-hash-with-bcrypt-64da150fbfea?source=rss-42374db44679------2</link>
            <guid isPermaLink="false">https://medium.com/p/64da150fbfea</guid>
            <category><![CDATA[bcrypt]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[login]]></category>
            <category><![CDATA[express]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Cristiansalerno]]></dc:creator>
            <pubDate>Mon, 25 Nov 2019 13:34:05 GMT</pubDate>
            <atom:updated>2019-11-25T13:34:05.894Z</atom:updated>
            <content:encoded><![CDATA[<h3>Backend — NodeJS, Login and Password Hash with bcrypt</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*DpyP9bIWY410kv1o5-_dYQ.png" /></figure><p>Doing a register/login with NodeJS , bcrypt, MySQL and ExpressJS .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*YrJgXbA-3DSlrlF1_eZ40Q.png" /><figcaption>Dependencies used.</figcaption></figure><p>I’m using IOS so i use Sequel PRO , on Windows you can use Heidi or similar), to test queries and look the updates into the database. Also you can use PHP my admin from web, but…</p><p>Database is simple. id , username, email, password:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xAiWX7TKAv6610o5esNuYQ.png" /><figcaption>caption from sequel pro.</figcaption></figure><p>I have a model ‘user’ in order to manage all the queries to the database from this file.</p><p>To connect the app to my database i use dotenv.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*YXJahOlDRIPYB3RJQbTv8w.png" /><figcaption><a href="https://www.npmjs.com/package/dotenv">https://www.npmjs.com/package/dotenv</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*9h4CeXXt96XKIq2ahreGRw.png" /><figcaption>connection to my database</figcaption></figure><p>I have two functions with queries to register and login :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xu9-47ZOgU0uSPAI9hBc8A.png" /><figcaption>db. query uses mysql to do SQL sentences simpler.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6adw_FC1MF57zVNZg_Tqzg.png" /><figcaption>users.js and dependencies used.</figcaption></figure><p>I handle the promises with Async and with .then , .catch</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WBZOHC3RmaxfzYfu5K_i0A.png" /><figcaption>bcrypt.hashSync encrypt the password. that function receives two parameters , my password req.body.password and a number , 10 is recommended by the documentation, and this number means the rounds of minim encrypting.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zJr3a-1VTfnP-XwTWCCBmg.png" /><figcaption><a href="https://www.npmjs.com/package/bcrypt">https://www.npmjs.com/package/bcrypt</a></figcaption></figure><p>Another tool used to this post is “postman”, is very simple to use and helps if you don’t want to create an interface only to try petitions.</p><blockquote>https://www.getpostman.com/</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k2QLJJ-vDHaOGR4nhMgyyg.png" /><figcaption>creating the user with email and password.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eZrX5SRDypNz9B4T-971TQ.png" /><figcaption>user created correct and password encrypted.</figcaption></figure><blockquote><strong>let’s do now the login.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yS80b_gqBq-HeUTQLqvJZQ.png" /></figure><p>bcrypt compareSync, compares hashed password with the password created by the user to login. I put into a variable called equals. And then i handle with an if conditional.</p><p>With Postman again, i complete the fields in the body with the name’s required and with the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nzOWECCtuWdGR83gqGlp3A.png" /><figcaption>email, password and message.</figcaption></figure><p>if i put the wrong password or wrong email, see that code works for both cases:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4gRSiQao6ypbnRPIy9Heng.png" /></figure><p>That’s whats all folks, thanks for read and keep coding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*UXhddFYUToqDA7LgDqGzkA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64da150fbfea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ES6 — DOM]]></title>
            <link>https://medium.com/@cristiansalerno18/es6-dom-b882125e79aa?source=rss-42374db44679------2</link>
            <guid isPermaLink="false">https://medium.com/p/b882125e79aa</guid>
            <category><![CDATA[dom]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Cristiansalerno]]></dc:creator>
            <pubDate>Mon, 04 Nov 2019 20:07:34 GMT</pubDate>
            <atom:updated>2019-11-04T20:07:34.490Z</atom:updated>
            <content:encoded><![CDATA[<h3>ES6 — DOM</h3><p>Today i want to show some ways to manipulate the JS DOM without JQuery.</p><p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction">Introduction to the DOM - Web APIs | MDN</a></p><p>Examples how to manipulate DOM .</p><p>For Example, we have an &lt;ul&gt; tag with links . I use id on link 3 to manipulate with getElementById.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*NNse9HuD9J7oNOYYHSmQ7w.png" /></figure><p>getElementById( idName) and with innerText we can change the text inside.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*NhnGF-m0n7KOkxoqCuj2Hw.png" /><figcaption>Changed the innerText from ‘Item 3’ to ‘Item 5’</figcaption></figure><p>On ES6 we have a lot of options to modify and use the DOM without Jquery. see the below example : I use three diferents way in order to paint &lt;li&gt; tags inside my HTML by a dinamic way:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uQ3mvqpPvAve3Z_t7_3MFw.png" /><figcaption>For Of , For and forEach.</figcaption></figure><p>Also it’s possible to modify CSS adding or removing classes , create new elements with AppendChild , etc.</p><p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild">Node.appendChild() - Web APIs | MDN</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*4TLScW7M4k5rITIOgvRgmA.png" /><figcaption>Remember, documentation is there for an important reason, to be read. : )</figcaption></figure><p>I’m bit bussy learning Angular, so when i have some mins i write those articles in order to refresh my mind and most important that i say : “don’t lose the basics.”</p><h3>Keep learning, keep coding!</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fopen.spotify.com%2Fembed%2Ftrack%2F1wsnCfewxZlCs7cJxkaMZM&amp;url=https%3A%2F%2Fopen.spotify.com%2Ftrack%2F1wsnCfewxZlCs7cJxkaMZM&amp;image=https%3A%2F%2Fi.scdn.co%2Fimage%2Fab67616d00001e02c96f7c7b077c224975b4c5ce&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=spotify" width="300" height="380" frameborder="0" scrolling="no"><a href="https://medium.com/media/3d58ee35bb5d0ac961bb449e94b684f6/href">https://medium.com/media/3d58ee35bb5d0ac961bb449e94b684f6/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b882125e79aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript 30 — Last Day of Arrays .]]></title>
            <link>https://medium.com/@cristiansalerno18/javascript-30-last-day-of-arrays-8817b8879410?source=rss-42374db44679------2</link>
            <guid isPermaLink="false">https://medium.com/p/8817b8879410</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[foreach]]></category>
            <category><![CDATA[array-methods]]></category>
            <category><![CDATA[meetup]]></category>
            <category><![CDATA[arrays]]></category>
            <dc:creator><![CDATA[Cristiansalerno]]></dc:creator>
            <pubDate>Wed, 30 Oct 2019 22:06:34 GMT</pubDate>
            <atom:updated>2019-10-30T22:06:34.735Z</atom:updated>
            <content:encoded><![CDATA[<h3>Javascript 30 — Last Day of Arrays .</h3><p>Hello, today after the meetup of React, React Native and Redux here in Madrid . React is not my framework, i’m learning Angular , but all these conferences sems interesting for me so .. I’m just siting here writing the last chapter of Array Methods and showing for me , the most interestings to learn.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZspPw_srjsGP9GwIjS9-RA.jpeg" /><figcaption>Meetup , Madrid JS — React ,React Native and Redux.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YL_3xwwpIgl9r5tXg4guWQ.jpeg" /><figcaption>Finally home — let’s start!</figcaption></figure><p>IndexOf () — Today i use fruits . (not recomended at all declare or set variables using emojis )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*6TsHe_Ujh5tkBM23fvAQug.png" /><figcaption>take the indexOf Kiwi, Position 3 of the Array [ 3]</figcaption></figure><p>push(), Use to add Pineaple on the last position of the Array.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Go55vdTrySdBvRVgovCCw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*jMW19WDInP4B5ebS466WBw.png" /><figcaption>We’ve got pineaple now : D</figcaption></figure><p>pop() and shift()</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5G1ncAUsXiTtUTuNUlU_7Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*juscfjeD_omW0zcVBePGGw.png" /><figcaption>Banana is pop ()</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*myhYEayu4t6RacW8djVKzQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*qSphKjp0kOWPaJnIsRlAXA.png" /><figcaption>Apple is out .</figcaption></figure><p>The magic is here, for me the most usefull , forEach. Is like the “for of”, calls a provided callback function once for each element in an array in ascending order.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*stmwZEoqTZFKYZ_bPgPdJQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*WrzQcu-kKpEqEo474hxVCw.png" /><figcaption>console log ( people) ;</figcaption></figure><p>That’s whats all folks , tomorrow maybe i start with some things of the ES6 DOM.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8817b8879410" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript 30 — Array Cardio day 2]]></title>
            <link>https://medium.com/@cristiansalerno18/javascript-30-array-cardio-day-2-6b069de6bcf6?source=rss-42374db44679------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b069de6bcf6</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[array-methods]]></category>
            <category><![CDATA[vanillajs]]></category>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[wes-bos]]></category>
            <dc:creator><![CDATA[Cristiansalerno]]></dc:creator>
            <pubDate>Tue, 29 Oct 2019 19:02:26 GMT</pubDate>
            <atom:updated>2019-10-29T19:02:26.820Z</atom:updated>
            <content:encoded><![CDATA[<h3>Javascript 30 — Array Cardio day 2</h3><p>Today i want to share new methods and new ways to use the console when we are working on Arrays. We go work with those examples :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*ze2qQkL82-7VZxA6XvayDg.jpeg" /><figcaption><strong>1 )</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*5Y7-6owWTbFjfG2sfUYR8w.jpeg" /><figcaption><strong>2 )</strong></figcaption></figure><p><em>Filter the list of inventors for those who were born in the 1500&#39;s if it returns true you keep it otherwise it will drop it , we will use the Array.prototype.filter()</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*nD5aVJD-Lf804EwxqJh2qw.jpeg" /><figcaption>All the code is refactored to ES6</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*5opyGyt6L1XlyLcW9oBeSQ.jpeg" /><figcaption><strong>console.table(fifteen);</strong></figcaption></figure><p><em>Give us an array of the inventors’ first and last names , we use the Array.prototype.map() , we use + ‘ ‘ + to concat , inventor is our key, and we save all in our variable </em><strong>const inventorNames</strong><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*3hoZgKMTkqJj_dPTEOTG_Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*ZJUNTbyVNAKbVtR21A5Tmg.jpeg" /><figcaption><strong>console.table(inventorNames);</strong></figcaption></figure><p><em>Sort the inventors by birthdate, oldest to youngest , Well we use the Array.prototype.sort(), in this case i made on two ways, one “normal” and another refactored :</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*91EpYYI-JzKmwBegAv-XtQ.jpeg" /><figcaption>normal</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*CllUNEvCVP-GtBugJe24Cg.jpeg" /><figcaption>refactored</figcaption></figure><p>As you can see the results on console.table(inventorSort) and console.table(inventorSort_v2) are the same :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*wfWwXIjh4o0X33cpGq7zFQ.jpeg" /><figcaption>console.log for both examples.</figcaption></figure><p>Well that’s all for today, i write this blog in order to keep in practice vanilla.js, today i started with Angular 8 so i’m discovering a new fascinating world of frameworks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ydsjjLJ5gjIeFyuHtBz1ZQ.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b069de6bcf6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript 30 — Array cardio day 1]]></title>
            <link>https://medium.com/vanillajs-with-javascript-30-by-wess-boss/javascript-30-array-cardio-day-1-c69f66ea30aa?source=rss-42374db44679------2</link>
            <guid isPermaLink="false">https://medium.com/p/c69f66ea30aa</guid>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[array-methods]]></category>
            <dc:creator><![CDATA[Cristiansalerno]]></dc:creator>
            <pubDate>Mon, 28 Oct 2019 20:01:14 GMT</pubDate>
            <atom:updated>2019-10-28T20:25:14.963Z</atom:updated>
            <content:encoded><![CDATA[<h3>Javascript 30 — Array cardio day 1</h3><p>Always is better get practice with the methods of Arrays, on the below example you can see the Array.prototype.some() and Array.prototype.every().</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*2jrqAqdTKECbtISg_x0yXg.jpeg" /><figcaption>Cause i’m not going to the gym , i do this cardio days of arrays : )</figcaption></figure><p>Array.find() and Array.findIndex() are two methods similar to filter(), see below the examples, first i find the element of my array called comments, using the key id (element.key) using the find method, then i find the indexOf with another method , and using splice i delete the position of the index.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*E89h5y-mOQ8qps-iX-w0Aw.jpeg" /></figure><p>Not all is colours and animations on programming , but i think is funny also get some practice with the console, there is a daily tool on a dev’s life called Terminal in my case but if u fell more confidential with it, you can say him “best friend”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*FEIm8is8sST0gjzevlA5cg.jpeg" /><figcaption>Here’s what console show during the console.log() .</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c69f66ea30aa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/vanillajs-with-javascript-30-by-wess-boss/javascript-30-array-cardio-day-1-c69f66ea30aa">Javascript 30 — Array cardio day 1</a> was originally published in <a href="https://medium.com/vanillajs-with-javascript-30-by-wess-boss">VanillaJS with Javascript 30 by Wess Boss</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>