<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Gustavo Henrique Silva Tenório</title>
    <description>The latest articles on Forem by Gustavo Henrique Silva Tenório (@gustavohst).</description>
    <link>https://forem.com/gustavohst</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%2F458437%2F7691399d-e05b-4d4b-af4e-42c4db38dc66.jpeg</url>
      <title>Forem: Gustavo Henrique Silva Tenório</title>
      <link>https://forem.com/gustavohst</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/gustavohst"/>
    <language>en</language>
    <item>
      <title>Creating a margin between elements without adding in the last one.</title>
      <dc:creator>Gustavo Henrique Silva Tenório</dc:creator>
      <pubDate>Wed, 20 Dec 2023 15:10:34 +0000</pubDate>
      <link>https://forem.com/gustavohst/creating-a-margin-between-elements-without-adding-in-the-last-one-229n</link>
      <guid>https://forem.com/gustavohst/creating-a-margin-between-elements-without-adding-in-the-last-one-229n</guid>
      <description>&lt;p&gt;Hello guys! &lt;/p&gt;

&lt;p&gt;Just sharing a simple tip about adding some margin or padding between components. &lt;br&gt;
CSS has so many ways to do it, but this one is simple and smooth. &lt;/p&gt;

&lt;p&gt;So, as you see the last padding in this image example seems to be with more padding than the above ones.&lt;/p&gt;

&lt;p&gt;How to solve it? Basically, we should avoid adding the last padding because there are no more posts below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.post + .post {
    margin-top: 1rem;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The + sign will make the CSS attributes be add just if you have a "post" class before :) &lt;/p&gt;

&lt;p&gt;Post example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    &amp;lt;article className="post"&amp;gt;
      Any text here
    &amp;lt;/article&amp;gt;
  );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;NOTE: Rem is equivalent to 16px. But is a nice pattern to help people who change interfaces on their pc or mobile. It will be rendered in the size that they define :) &lt;/p&gt;

</description>
      <category>css</category>
      <category>react</category>
      <category>codenewbie</category>
      <category>html</category>
    </item>
    <item>
      <title>Tip to shrink you code using "Omit" to create interfaces!</title>
      <dc:creator>Gustavo Henrique Silva Tenório</dc:creator>
      <pubDate>Tue, 12 Apr 2022 21:13:34 +0000</pubDate>
      <link>https://forem.com/gustavohst/type-tip-to-shrink-you-code-6c3</link>
      <guid>https://forem.com/gustavohst/type-tip-to-shrink-you-code-6c3</guid>
      <description>&lt;p&gt;Hey guys! I want to share one tip to you! &lt;/p&gt;

&lt;p&gt;Imagine that you have one interface called by "Deposit" to create using: Id, Name, Value, CreatedAt properties. &lt;/p&gt;

&lt;p&gt;Usually we will create somethink like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;interface Deposit{
    id: number;
    name: string;
    value : number;
    createdAt: string;
}
```



And if you need create another interface from "Deposit". For example, create a new one without the Id called by "DepositInput". We can use the Omit sintaxe. :D  

`type DepositInput = Omit&amp;lt;Deposit, 'id' &amp;gt;`

instead:


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

&lt;/div&gt;

&lt;p&gt;interface DepositInput {&lt;br&gt;
    name: string;&lt;br&gt;
    value : number;&lt;br&gt;
    createdAt: string;&lt;br&gt;
}&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


You have oportunity to make short your codes. 
Enjoy :) 


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

&lt;/div&gt;

</description>
      <category>react</category>
      <category>typescript</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Tip to get selectors to use in javascript</title>
      <dc:creator>Gustavo Henrique Silva Tenório</dc:creator>
      <pubDate>Tue, 16 Feb 2021 21:47:33 +0000</pubDate>
      <link>https://forem.com/gustavohst/tip-to-get-selectors-to-use-in-javascript-5hp</link>
      <guid>https://forem.com/gustavohst/tip-to-get-selectors-to-use-in-javascript-5hp</guid>
      <description>&lt;p&gt;Guys, this is a simple tip to get the selector very easily. The browser inspection copy function.&lt;/p&gt;

&lt;p&gt;Well, sometimes that functionality is very useful if you are handling a lot of HTML injections from these new javascript frameworks. Is expected that you do not need this, but someday, maybe this helps you save a little time.&lt;/p&gt;

&lt;p&gt;Just inspect the code, use the right-click in your tag element and select the &lt;strong&gt;copy&lt;/strong&gt; option on the menu, and then choose &lt;strong&gt;copy selector&lt;/strong&gt; or &lt;strong&gt;copy js path&lt;/strong&gt;. (Same as the image example)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fh7U9B0m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dj22hnhrtyg2vidamz95.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fh7U9B0m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dj22hnhrtyg2vidamz95.png" alt="image" width="800" height="488"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ex:&lt;br&gt;
&lt;code&gt;document.querySelector("#root &amp;gt; div &amp;gt; div.rightPanel &amp;gt; div.presentMe &amp;gt; div.name")&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;NOTE.1: Most of the time you should reduce the size of the selector. (Depends on the situation, analyze pls)&lt;/p&gt;

&lt;p&gt;Ex:&lt;br&gt;
&lt;code&gt;document.querySelector("rightPanel div.name")&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That is it :D! You got the selector.&lt;br&gt;
Thanks, Vinicius Tartari for sharing this knowledge with me :)&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>html</category>
      <category>webdev</category>
    </item>
    <item>
      <title>LET and CONST, when should I use?</title>
      <dc:creator>Gustavo Henrique Silva Tenório</dc:creator>
      <pubDate>Sun, 04 Oct 2020 23:21:40 +0000</pubDate>
      <link>https://forem.com/gustavohst/let-and-const-when-should-i-use-53n0</link>
      <guid>https://forem.com/gustavohst/let-and-const-when-should-i-use-53n0</guid>
      <description>&lt;p&gt;Hello, DevGuys! &lt;/p&gt;

&lt;p&gt;The CONST and LET variables are introduced in ES6 and nowadays it's very common to use in new codes. But, these days I've been studying React JS and a question came to mind, when should I use them? &lt;/p&gt;

&lt;p&gt;Well, it's simple... they have your duty in code and help us to understand the codification &lt;/p&gt;

&lt;p&gt;&lt;code&gt;CONST&lt;/code&gt; means the variable can't be reassigned a new value and declarations are block-scoped. So, you can create to define constants values to be as "ready only". Please don't try to change this value :D.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const UNDERAGE_VALIDATION = 18;
function validateAge(age){
 (age &amp;lt; UNDERAGE_VALIDATION) 
   ? console.log("Underage person")
   : console.log("Older");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;LET&lt;/code&gt; this variable will be reassigned and is block-scoped, that variable can be updated but not re-declared. :).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let counter = 0;
while(counter &amp;lt;= 10){ counter = counter + 1; }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's simple, keep it's simple and do a clean code. &lt;br&gt;
Bye-bye! &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How can I use &lt;pre/&gt; tag in react JS ?</title>
      <dc:creator>Gustavo Henrique Silva Tenório</dc:creator>
      <pubDate>Sun, 13 Sep 2020 12:03:43 +0000</pubDate>
      <link>https://forem.com/gustavohst/how-can-i-use-pre-tag-in-react-js-355g</link>
      <guid>https://forem.com/gustavohst/how-can-i-use-pre-tag-in-react-js-355g</guid>
      <description>&lt;p&gt;Hellow my fellows!&lt;/p&gt;

&lt;p&gt;Yesterday I learn a small detail, but important. I tried to add a code example using &lt;code&gt;&amp;lt;pre&amp;gt;&lt;/code&gt; tag in my react page to create my web portfolio. But, the &lt;code&gt;&amp;lt;pre&amp;gt;&lt;/code&gt; tag doesn't worked as expected. &lt;/p&gt;

&lt;p&gt;How should I use ? &lt;/p&gt;

&lt;p&gt;Simple, we need use the ` character to envolve the code example. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--e_qwGIb5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/5job4ad8ew17poy2m8ty.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--e_qwGIb5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/5job4ad8ew17poy2m8ty.png" alt="pre_tag_example" width="275" height="355"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Simple :D!&lt;/p&gt;

</description>
      <category>react</category>
      <category>html</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
