<?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: andreadotcomdotco</title>
    <description>The latest articles on Forem by andreadotcomdotco (@andreadotcomdotco).</description>
    <link>https://forem.com/andreadotcomdotco</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%2Forganization%2Fprofile_image%2F1547%2Fd56f2e62-8070-4ce4-814b-a09766fe0031.png</url>
      <title>Forem: andreadotcomdotco</title>
      <link>https://forem.com/andreadotcomdotco</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/andreadotcomdotco"/>
    <language>en</language>
    <item>
      <title>Stop procrastinating by looking for the perfect tutorial</title>
      <dc:creator>Jorge Gomez</dc:creator>
      <pubDate>Tue, 12 Nov 2019 05:53:06 +0000</pubDate>
      <link>https://forem.com/andreadotcomdotco/stop-procrastinating-by-looking-for-the-perfect-tutorial-391l</link>
      <guid>https://forem.com/andreadotcomdotco/stop-procrastinating-by-looking-for-the-perfect-tutorial-391l</guid>
      <description>&lt;p&gt;Hello Everyone, I just wanted to share some thoughts on this regard, because It's something that I have struggle with, and I just want to share my story and see if I can help some people or just get some feedback. I hope you enjoy my little post.&lt;/p&gt;

&lt;p&gt;Well, My name is Jorge, I'm a Computer Scientist from Colombia, I graduated in September of this year (2019). I have been struggling with procrastination since I remember. When I was studying I used to delay my homework until the last day or even the last hours of the appointment day. That of course lead me to have bad grades and a really mediocre GPA, I was really into relaxing myself and leaving important stuff for later, not only on my studies but even in my alimentary habits, my sleeping, and my health overall. I want to address that procrastination not only occurs on homework or mental related activities but it can affect our daily life, our relationships, our health both mental and physical and I can keep listing things.&lt;/p&gt;

&lt;p&gt;I will focus on the study/learning fact so we can get to a solution for that matter. &lt;br&gt;
I'm really into looking for tutorials, learning things by watching others doing it, is a good way to learn, but sometimes tutorials are disappointing, because they usually don't cover real life examples and there is always the same applications, a Todo List, a Blog...&lt;/p&gt;

&lt;p&gt;Procrastination is a sneaky one, you may think that by watching videos, or reading technical books (without following along), you are doing such a great advance, and you are learning a lot, but if you don't code, or you don't implement what you are reading or watching. You are just procrastinating your learning, and it's almost the same as watching a Netflix series, you need to get up and start coding, follow the tutorial but go deeper, not just follow the example, challenge yourself.&lt;/p&gt;

&lt;p&gt;We may think that by watching tutorials we well get to a point where we will be able to do anything, but it's not that simple and by procrastinating, and looking for another tutorial, of for another book, we will not be able to even write a "Hello World" by ourselves. I'm not telling you to stop watching tutorials, but to start building yourself.&lt;/p&gt;

&lt;p&gt;It may sound hard to start when you don't know anything, if you are a beginner our if you just don't have the confidence, but I will tell you that everyone has come to feel like that at least once in his/her career, so, don't feel ashamed if you fail, or if your final result don't look like what you want it, just keep improving, keep building, keep reading documentation, keep asking people.&lt;/p&gt;

&lt;p&gt;It happened to me a lot of times that I just purchase a tutorial, and I watch a couple of episodes and then I just leave it there, because It wasn't meaningful, don't be like me, go look for the contents, ask yourself, do I really need this? is it good for me? &lt;/p&gt;

&lt;p&gt;My only advice here, is to think before going into the tutorial (course), book, or blog, or wherever medium you use to learn, ask yourself if this will change anything in your actual learning status, like if you will learn something new.&lt;/p&gt;

&lt;p&gt;Finally, I just want to share a little quote with you:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Only delay things when you’ll do a better job with that extra time. Do it now, or do it better later. by Darius Foroux&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Don't wait to accomplish your goals, go hunt them, go build your idea, you don't need to know everything, you will learn it on the way, you just need to start building, and stop messing around. &lt;/p&gt;

&lt;p&gt;Hope you enjoyed this little post. If you have some recommendations or just want to add something, leave it on the comments I will be happy to see some reactions. :)&lt;/p&gt;

</description>
      <category>procrastination</category>
      <category>tutorials</category>
      <category>selfimprovement</category>
      <category>advice</category>
    </item>
    <item>
      <title>Improving your productivity with Visual Studio Code Snippets</title>
      <dc:creator>Jorge Gomez</dc:creator>
      <pubDate>Fri, 27 Sep 2019 06:07:28 +0000</pubDate>
      <link>https://forem.com/andreadotcomdotco/improving-your-productivity-with-visual-studio-code-snippets-8k2</link>
      <guid>https://forem.com/andreadotcomdotco/improving-your-productivity-with-visual-studio-code-snippets-8k2</guid>
      <description>&lt;p&gt;Hey everyone, this is my very first article so I hope that you like it.&lt;/p&gt;

&lt;p&gt;Okay, so let's move on to the importance of using Snippets, I will do this by showing some examples and how can we improve both our coding speed and productivity. &lt;/p&gt;

&lt;p&gt;Imagine the next situation: &lt;/p&gt;

&lt;p&gt;You are writing an API and you have to repeat a lot of code every time you return a response, the response can be either a success or an error. So you may have defined a class to handle your errors and also the successful return.&lt;/p&gt;

&lt;p&gt;Something like this:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VUO2GnMY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/fj9skiyvt1fv5jk3e56l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VUO2GnMY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/fj9skiyvt1fv5jk3e56l.png" alt="Alt Text" width="800" height="643"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your class may have more parameters or less, or you can have only one, just bear with me.&lt;/p&gt;

&lt;p&gt;Now anytime you have a request on your API, you may be doing something like this, if you are using express and Node.js:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xLNrqU9W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/1yp4aey050npo0e7m7bs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xLNrqU9W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/1yp4aey050npo0e7m7bs.png" alt="Alt Text" width="800" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the image above you can see that we have an endpoint to our API which is:&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="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/:valid&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we are using our classes that we defined above to handle error or success, and that may happend a lot on our code.&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="c1"&gt;// This is repetition, and we can create a snippet for this.&lt;/span&gt;
&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SuccessHandler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;The value is valid&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;somePayload&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; 
&lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ErrorHandler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;An Error has occurred&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;Let's now create those snippets, that is why you are here. &lt;/p&gt;

&lt;p&gt;So on VSCode we are going to press &lt;em&gt;ctrl + shift + p&lt;/em&gt;  to open for the command pallet, and then type "Snippets". It will show something like this: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LYTegFCo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/qcuci2597peysqlg0tsv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LYTegFCo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/qcuci2597peysqlg0tsv.png" alt="Alt Text" width="800" height="92"&gt;&lt;/a&gt;&lt;br&gt;
Then hit &lt;em&gt;Enter&lt;/em&gt; and you will see this:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--j6hpKfqJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/v6r2qcd2rbnx0y8kqkkn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j6hpKfqJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/v6r2qcd2rbnx0y8kqkkn.png" alt="Alt Text" width="800" height="640"&gt;&lt;/a&gt;&lt;br&gt;
As you can see in the options you can create global snippets, a file of snippets just for your actual project, or you can create snippets for a particular language. In this case I will just create a global snippet.&lt;/p&gt;

&lt;p&gt;Once you hit the button to create a snippet file, VSCode will ask you to give it a name, you can use wherever name you want. I call mine my_snippets.&lt;/p&gt;

&lt;p&gt;VSCode will open the file automatically for you to edit your custom snippets, and will show you an example. I will create two examples to show you how can you create yours.&lt;/p&gt;

&lt;p&gt;Inside my file I created a new object (Json Key) like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"Error Handler"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scope"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"javascript"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"prefix"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ehh"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"body"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="s2"&gt;"next(new ErrorHandler(${1:500}, ${2:message}))"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"optional."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Okay, let's review the json object, the key would be the name to our snippet, this can be any name you want to put in, but I would recommend something that you will remember on the future, or something related to what the snippet does.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;scope&lt;/em&gt; will indicate what languages are supported(allowed) to use this snippet.&lt;br&gt;
&lt;em&gt;prefix&lt;/em&gt; is how you will invoke the snippet.&lt;br&gt;
&lt;em&gt;body&lt;/em&gt; is as the name said the body of our snippet. Here you will define what you want to return when invoking the snippet.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;$&lt;/em&gt; indicate a new "variable" that you can add there, as I'm creating the handle error I just added the 500 error to the first parameter, but this could be anything you want. For example instead of 500 it could be &lt;em&gt;${1:statusCode}&lt;/em&gt;. Notice that the &lt;em&gt;1&lt;/em&gt; inside the braces indicate the first argument of the body value.&lt;/p&gt;

&lt;p&gt;Let's create the Success Handler snippet to clarify a little bit. It will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"Success Handler"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scope"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"javascript"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"prefix"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sh"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"body"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"res.status(200).json(new SuccessHandler(${1:200}, ${2:message}, ${3:payload}))"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Create successful return."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I haven't show you the usage of those beautiful friends of ours. let's see them in action.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Yn8XxGVE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/iuxrjh6m2ngdth0dsjmr.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Yn8XxGVE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/iuxrjh6m2ngdth0dsjmr.gif" alt="Alt Text" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Wrap up
&lt;/h4&gt;

&lt;p&gt;Well, this was my first article, I really hope that you like it and find it a little bit useful, there are some features of VSCode that we as developers some times forget to use. See you all next time.&lt;/p&gt;

&lt;p&gt;Happy Coding.&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>snippets</category>
      <category>productivity</category>
      <category>trick</category>
    </item>
  </channel>
</rss>
