<?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: Kevin</title>
    <description>The latest articles on DEV Community by Kevin (@kevinhch).</description>
    <link>https://dev.to/kevinhch</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%2F146356%2F78339039-3347-4fd0-9a9b-71a00ea5a3d2.jpeg</url>
      <title>DEV Community: Kevin</title>
      <link>https://dev.to/kevinhch</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kevinhch"/>
    <language>en</language>
    <item>
      <title>Roast my code</title>
      <dc:creator>Kevin</dc:creator>
      <pubDate>Fri, 10 Apr 2020 08:45:32 +0000</pubDate>
      <link>https://dev.to/kevinhch/roast-my-code-35bg</link>
      <guid>https://dev.to/kevinhch/roast-my-code-35bg</guid>
      <description>&lt;p&gt;Hi, after maybe 3 months, finally I finished my self-project.&lt;/p&gt;

&lt;p&gt;What I tried to do with this project?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learn and build an entire APP with NodeJs and React&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Im a junior web developer, and I think it's time to create, to break, to get sick with this type of projects, learning by myself&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What are you doing here?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Well, I tried to use a new Stack, learning new auth systems, devs methods... If anybody is bored or want to check this code is in my GitHub.
Please I want your feedback, what I did wrong, what part is a bad practice, what part of my code is insecure, what part is a spaghetti, React components are a complete spaghetti?...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What can I do get better?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Well I hope is someone want to tell me, I will read all the comments.
Thanks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's the project: &lt;a href="https://github.com/KevinHCH/forum/"&gt;https://github.com/KevinHCH/forum/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Is worth use frameworks or modules?</title>
      <dc:creator>Kevin</dc:creator>
      <pubDate>Sun, 19 Jan 2020 16:48:49 +0000</pubDate>
      <link>https://dev.to/kevinhch/is-worth-use-frameworks-or-modules-3n21</link>
      <guid>https://dev.to/kevinhch/is-worth-use-frameworks-or-modules-3n21</guid>
      <description>&lt;p&gt;Hi, this days i was learning node and the NPM system.&lt;br&gt;
I checked a couple of modules to make my develops more faster and im trying to search good practices in node.&lt;br&gt;
I tryed to make an auth system with PassportJS usign roles and the classic "remember me", finally I did it, but learn&lt;br&gt;
all this new system of passport, how it works, how should i call the functions, cookies, sessions... tooks me 3 days.&lt;br&gt;
I made a system like this in plain PHP (no frameworks, just php files and queries) a couple of months ago, and Im pretty sure&lt;br&gt;
I can do the same in node in 1 day, but here's my question.&lt;br&gt;
How worth is it, how worth is learn to use a complex module with bad DOC like passport to implement a simple login system, &lt;br&gt;
is bad if I made in simple NodeJs? (just connecting to my database and making queries and checking emails and something like that)&lt;br&gt;
Is bad? Is good?&lt;br&gt;
Imagine a enterprise contacts me to build a new login system, should I use passport (with no Sequelize module) or maybe should I use the classic system? (making my own queries, checking...)&lt;br&gt;
How worth is use this modules or frameworks to made simple projects&lt;/p&gt;

</description>
      <category>node</category>
      <category>frameworks</category>
    </item>
    <item>
      <title>Explain me this like I'm five</title>
      <dc:creator>Kevin</dc:creator>
      <pubDate>Sat, 11 Jan 2020 15:29:30 +0000</pubDate>
      <link>https://dev.to/kevinhch/explain-me-this-like-i-m-five-co0</link>
      <guid>https://dev.to/kevinhch/explain-me-this-like-i-m-five-co0</guid>
      <description>&lt;p&gt;Hi, yesterday I was talking with a co-workers and we was talking about Node Js, how it works in local to develop API and pretty simples apps, how to connect to a database... but when we started to talk about how it works in Production enviroment, we are lost, i mean, both of us don't know how to deploy, or where is the best way to deploy this types of apps which runs in NODE, he deploy a simple app in Nginx and apache, wich its runs.&lt;br&gt;
But I still have the question, wich server or types or servers are using this plattforms like Digital ocean or Heroku, its worh deploy a Node app in Nginx or Apache? If i have a server, how should i deploy a simple app builded in Node and React (Digital ocean and Heroku are not a option) or what server is the best for this, nginx, apache...&lt;/p&gt;

</description>
      <category>node</category>
      <category>help</category>
      <category>deploy</category>
    </item>
    <item>
      <title>How it works?</title>
      <dc:creator>Kevin</dc:creator>
      <pubDate>Sat, 16 Nov 2019 15:31:15 +0000</pubDate>
      <link>https://dev.to/kevinhch/how-it-works-420c</link>
      <guid>https://dev.to/kevinhch/how-it-works-420c</guid>
      <description>&lt;p&gt;Hi, last day I was thinking about how Netflix, Spotify, Youtube works.&lt;br&gt;
Sometimes when I'm visiting some differents webs I always check and inspect with the DevTools to see what does it have (resources, images, comments in HTML code, tags, ajax calls, what libraries it uses...)&lt;br&gt;
When I visit websites that offer you multimedia content I always find a video tag or source tag with a link attr to the video that is hosted in his own server, and with that link I can access to the video from my browser.&lt;br&gt;
My question is: How netflix, spotify of plattforms like this send videos, music...? Im pretty sure they don't use ajax to send the complete album of ACDC or netflix don't use an iframe to show me the last episode of Breaking bad.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PVTExhLt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://clearlakeiowa.com/wp-content/uploads/2018/08/Thanks-a-Million-Banner-e1535472738766.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PVTExhLt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://clearlakeiowa.com/wp-content/uploads/2018/08/Thanks-a-Million-Banner-e1535472738766.jpg" width="100%" height="auto"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>netflix</category>
      <category>spotify</category>
      <category>twitch</category>
    </item>
    <item>
      <title>Why PHP...???</title>
      <dc:creator>Kevin</dc:creator>
      <pubDate>Tue, 30 Jul 2019 18:20:47 +0000</pubDate>
      <link>https://dev.to/kevinhch/why-php-4h4f</link>
      <guid>https://dev.to/kevinhch/why-php-4h4f</guid>
      <description>&lt;p&gt;Hello, today i was working with some PHP and AJAX, and i had a problem, finally i fixed it, but i was asking myself, why PHP works like this.&lt;br&gt;
This is my JS file.&lt;br&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;html&amp;gt;
&amp;lt;script&amp;gt;
        (() =&amp;gt; {
            const formData = new FormData();
            formData.append('orange', false)
            formData.append('purple', true)
            formData.append('someData', 'lorem ipsum...you know right')
            formData.append('numbers', [1,1,2,3,5,8])

            const sendData = async (url, method, data) =&amp;gt; {
                let response = await fetch(url, {method: method, body: data})
                let dataRes = await response.json()
                console.log(dataRes)
            };//senData
            const url = window.location

            sendData(`${url}back.php`, 'post', formData)


        })()    
&amp;lt;/script&amp;gt;
&amp;lt;html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I was validating a form and preparing the data to send to my backend and play with this data in my Data Base, ok no problem.&lt;br&gt;
But when i tried to validate the data on the backend...was horrible, because I tried to validate Booleans, and PHP did weird things with Booleans.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
// This is my "validation"
if(isset($_POST['orange']) &amp;amp;&amp;amp; $_POST['orange'] == true){
    echo "Why im here, orange is false!!";
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And this is the response from server. &lt;br&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OzMv_a4s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7ihyi7kiqmf2ibxkz2vc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OzMv_a4s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7ihyi7kiqmf2ibxkz2vc.png"&gt;&lt;/a&gt; &lt;br&gt;&lt;br&gt;
OK, no problem, let me check what types of variables i have:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zvPBttg0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/71mdpan9yscktk2u8zbk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zvPBttg0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/71mdpan9yscktk2u8zbk.png"&gt;&lt;/a&gt; &lt;br&gt;&lt;br&gt;
I got you, i can't compare a string with a boolean, ok, let me cast. &lt;br&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
echo "&amp;lt;pre&amp;gt;";
var_dump($_POST['orange']);
echo "&amp;lt;/pre&amp;gt;";

$orange = (bool) $_POST['orange'];
echo "casting to boolean...";
echo "&amp;lt;pre&amp;gt;";
var_dump($orange);
echo "&amp;lt;/pre&amp;gt;";

// This is my "validation"
if($orange == true){
    echo "Why im here, orange is false!!";
    echo "&amp;lt;pre&amp;gt;";
    var_dump($orange);
    echo "&amp;lt;/pre&amp;gt;";
}//if
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;But still true, why? I cas't the variable, now should be false, but still true. &lt;br&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

$orange = (bool) $_POST['orange'];
echo "casting to boolean...";
echo "&amp;lt;pre&amp;gt;";
var_dump($orange);
echo "&amp;lt;/pre&amp;gt;";

// This is my "validation"
if($orange == true){
    echo "Why im here, orange is false!!";
    echo "&amp;lt;pre&amp;gt;";
    var_dump($orange);
    echo "&amp;lt;/pre&amp;gt;";
}//if
echo "&amp;lt;pre&amp;gt;";
print_r($_POST);
echo "&amp;lt;/pre&amp;gt;";
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--u7djgRIB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/k8zutcnqp2n7lr7ayuog.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--u7djgRIB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/k8zutcnqp2n7lr7ayuog.png"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
And that's the problem, if i want to cast to a boolean I need to use json_decode (WHAT?), I have an string, i cast to a boolean, but PHP don't cast the variable, PHP check if he can cast, if he can, they will return true, not the content of the variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
$orange = (bool) json_decode($_POST['orange']);
//finally
if($orange == true){
    echo "Why im here, orange is false!!";
}else{
    echo "win win for me.&amp;lt;br&amp;gt;";
    var_dump($orange);
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Finally! &lt;br&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--D6KepabH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ppcfyy3dxiegpv6ogj7c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--D6KepabH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ppcfyy3dxiegpv6ogj7c.png"&gt;&lt;/a&gt; &lt;br&gt;&lt;br&gt;
The question is: Why PHP works so weird with booleans?.&lt;br&gt;
I'm pretty sure others progamming langs can be solve this types of problems pretty good.&lt;/p&gt;

&lt;p&gt;Other way to fix this problem was:&lt;br&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
if($orange == "true"){
    echo "do something";
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;But this is not my style.&lt;br&gt;
Tell me situations like these that have happened, to avoid them. &lt;/p&gt;

</description>
      <category>php</category>
      <category>why</category>
      <category>booleans</category>
    </item>
    <item>
      <title>I need to learn Linux</title>
      <dc:creator>Kevin</dc:creator>
      <pubDate>Thu, 06 Jun 2019 07:44:02 +0000</pubDate>
      <link>https://dev.to/kevinhch/i-need-to-learn-linux-mf7</link>
      <guid>https://dev.to/kevinhch/i-need-to-learn-linux-mf7</guid>
      <description>&lt;p&gt;Hello, I'm a junior web developer, I have seen that linux is very important, I know a little commands (mkdir, sudo, chmod...) but I don't know how it works or what types of permissions has this system (Linux) or the files system (etc, usr, bin...).&lt;br&gt;
Can you recommend Books, courses or somethinig like that to be a hero in Linux.&lt;br&gt;
Thanks.&lt;/p&gt;

</description>
      <category>help</category>
      <category>linux</category>
      <category>books</category>
      <category>info</category>
    </item>
    <item>
      <title>I'm thinking to use a new distro from Linux</title>
      <dc:creator>Kevin</dc:creator>
      <pubDate>Sat, 01 Jun 2019 10:55:55 +0000</pubDate>
      <link>https://dev.to/kevinhch/i-m-thinking-to-use-a-new-distro-from-linux-181</link>
      <guid>https://dev.to/kevinhch/i-m-thinking-to-use-a-new-distro-from-linux-181</guid>
      <description>&lt;p&gt;Hi, I'm thinking to use a new distro from linux, I'm a junior web developer and i want to switch from another distro, I tryed ubuntu 18.04, linux mint, linux lite.&lt;br&gt;
Any suggest?&lt;/p&gt;

</description>
      <category>linux</category>
      <category>distro</category>
      <category>web</category>
      <category>developer</category>
    </item>
    <item>
      <title>How to deploy a Symfony 4 project in a shared host.</title>
      <dc:creator>Kevin</dc:creator>
      <pubDate>Tue, 21 May 2019 14:13:38 +0000</pubDate>
      <link>https://dev.to/kevinhch/how-to-deploy-a-symfony-4-project-in-a-shared-host-197k</link>
      <guid>https://dev.to/kevinhch/how-to-deploy-a-symfony-4-project-in-a-shared-host-197k</guid>
      <description>&lt;p&gt;Hi, anybody knows if i can deploy a Symfony 4 project in a shared free host (&lt;a href="https://www.000webhost.com/"&gt;https://www.000webhost.com/&lt;/a&gt;).&lt;br&gt;
I saw and read a lot of post about projects in Symfony 2 or 3, but im trying to deploy my personal project in Symfony 4, but i don't know how to configure the .htaccess or ENV_VARS and im starting to think it's impossible because maybe this type of  host can't support Symfony 4.&lt;br&gt;
Thanks.&lt;/p&gt;

</description>
      <category>help</category>
      <category>apache</category>
      <category>symfony4</category>
      <category>sharedhost</category>
    </item>
    <item>
      <title>What an Admin can do?</title>
      <dc:creator>Kevin</dc:creator>
      <pubDate>Mon, 15 Apr 2019 18:24:16 +0000</pubDate>
      <link>https://dev.to/kevinhch/what-an-admin-can-do-4dgo</link>
      <guid>https://dev.to/kevinhch/what-an-admin-can-do-4dgo</guid>
      <description>&lt;p&gt;Hello, first of all, this is my first post, sorry for my bad english.&lt;br&gt;
I'm developing a little App to management a G.Y.M/Sport center, this application has roles, i don't know what an Admin can do, i mean, he can has a list of employees, the admin can add class or create a new schedule, but that's it?&lt;br&gt;
If somebody can tell me what an admin can do, because i dont have any idea.&lt;br&gt;
Thanks.&lt;/p&gt;

</description>
      <category>noob</category>
      <category>help</category>
      <category>sorry</category>
    </item>
  </channel>
</rss>
