<?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: Kapil Pandey</title>
    <description>The latest articles on Forem by Kapil Pandey (@kapi1).</description>
    <link>https://forem.com/kapi1</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%2F435096%2F2c483ffc-7684-4fa1-9799-ec99c5d5c821.jpeg</url>
      <title>Forem: Kapil Pandey</title>
      <link>https://forem.com/kapi1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/kapi1"/>
    <language>en</language>
    <item>
      <title>What is JavaScript?</title>
      <dc:creator>Kapil Pandey</dc:creator>
      <pubDate>Mon, 17 Aug 2020 16:07:05 +0000</pubDate>
      <link>https://forem.com/kapi1/what-is-javascript-efo</link>
      <guid>https://forem.com/kapi1/what-is-javascript-efo</guid>
      <description>&lt;p&gt;JavaScript created by &lt;strong&gt;Brendan Eich&lt;/strong&gt;, originally known as &lt;strong&gt;&lt;em&gt;LiveScript&lt;/em&gt;&lt;/strong&gt;, which due to the popularity of &lt;strong&gt;Java&lt;/strong&gt; at that era got rename to JavaScript is a &lt;strong&gt;dynamic, weakly typed&lt;/strong&gt; language that gets compiled at runtime.&lt;/p&gt;

&lt;p&gt;Got no clue what the heck those words stand for? Don't worry because that's what this series is all about. So let's get into a time machine and go back to the era when JS(short-hand for JavaScript that will be used in the entire series) was introduced.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CzsujASY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/p5lrkz13scdod6s1cy64.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CzsujASY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/p5lrkz13scdod6s1cy64.jpg" alt="Time Machine" width="540" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  History of JS
&lt;/h3&gt;

&lt;p&gt;The language was created to allow web developers to embed executable code on their webpages so that they could make their webpages interactive, or perform simple tasks. Today, browser scripting remains the main use-case of JavaScript.&lt;/p&gt;

&lt;h3&gt;
  
  
  Java v/s JavaScript
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;JavaScript is an &lt;strong&gt;interpreted language&lt;/strong&gt;, not a compiled language. &lt;br&gt;
A program such as C++ or Java needs to be compiled before it is run. The source code is passed through a program called a compiler, which translates it into bytecode that the machine understands and can execute.&lt;br&gt;
In contrast, JavaScript has no compilation step. Instead, an interpreter in the browser reads over the JavaScript code, interprets each line, and runs it. &lt;br&gt;
More modern browsers use a technology known as Just-In-Time (JIT) compilation, which compiles JavaScript to executable bytecode just as it is about to run.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Js is &lt;em&gt;dynamic&lt;/em&gt;, Java is &lt;em&gt;static&lt;/em&gt; (Explained below)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Both languages have different runtime environments, different governing bodies, different libraries.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;dynamic, weakly typed&lt;/strong&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So let's understand what these two terms in the definition of JS really stand for:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oFqsvNz3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/f0uq2ei3kpdhjyfd2up3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oFqsvNz3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/f0uq2ei3kpdhjyfd2up3.jpg" alt="Type checking" width="880" height="221"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dynamic and weakly-typed language: In any programming language we have a process known as type checking, which is just looking at variables and their types and then saying does this expression make sense.
A dynamic programming language is a programming language in which operations otherwise done at compile-time are done at run-time.
This can be clearly understood by an example below.
In Java, we declare variables as shown below:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int a=10; //declare &amp;amp; define Integer type variable
String s="Kapil"; //declare &amp;amp; define String type variable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and they get memory allocated during compile-time and we cannot do &lt;code&gt;int a="Kapil"; String s=10&lt;/code&gt; as it is &lt;em&gt;&lt;strong&gt;static and strongly typed&lt;/strong&gt;&lt;/em&gt; and once a type is assigned to a variable it retains that type and can’t be intermingled in expressions with other types&lt;/p&gt;

&lt;p&gt;Whereas in JS we can simply intermingle variables like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var a=10 //declare &amp;amp; define a variable
a="Kapil" //variable a can store any value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;because it is &lt;strong&gt;dynamic and weakly typed&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In simple terms&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Static = Precompiled and code does not change at runtime&lt;/li&gt;
&lt;li&gt;Dynamic = Parsed and compiled on the fly, not precompiled.&lt;/li&gt;
&lt;li&gt;Strong = Predefined/fixed variable types i.e String, int, char, float, double, boolean, etc, and variables types are not interchangeable.&lt;/li&gt;
&lt;li&gt;Weak = Datatypes are assumed automatically, not predefined and can assign any value to a variable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FamBVQk1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cdd3ra936gltf65hlj8i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FamBVQk1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cdd3ra936gltf65hlj8i.png" alt="Axis chart" width="669" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That it for this post and I hope it may have helped you get a brief insight of what technically JavaScript is. It was more technically because I can guess you are a techie, as you are here to learn about JS 😉&lt;/p&gt;

&lt;p&gt;Stay tuned and let me know how often would you like to read blogs on this series in the comments below.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>[Solved] “Treating warnings as errors because of process.env.CI = true”</title>
      <dc:creator>Kapil Pandey</dc:creator>
      <pubDate>Thu, 23 Jul 2020 15:10:03 +0000</pubDate>
      <link>https://forem.com/kapi1/solved-treating-warnings-as-errors-because-of-process-env-ci-true-bk5</link>
      <guid>https://forem.com/kapi1/solved-treating-warnings-as-errors-because-of-process-env-ci-true-bk5</guid>
      <description>&lt;p&gt;Did deploying your code to netlify failed and in logs you are getting &lt;br&gt;
&lt;strong&gt;Treating warnings as errors because of process.env.CI = true&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F4764%2F1%2AC2ChAVEUzGn45yx5ATgyoQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F4764%2F1%2AC2ChAVEUzGn45yx5ATgyoQ.png" alt="Error"&gt;&lt;/a&gt;&lt;br&gt;
If yes then you are at the right place. I'll help you fix this error within seconds. Before showing you the fix let's first have a glance at the root cause of this error.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What is this error all about?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Beginning on &lt;em&gt;June 15, 2020,&lt;/em&gt; Netlify started a gradual rollout of &lt;strong&gt;&lt;em&gt;adding the environment variable CI to build environments, with the value of true&lt;/em&gt;&lt;/strong&gt;. This environment variable, short for Continuous Integration, is commonly set in various CI environments like Travis CI and Github Actions, among many others. The ecosystem has largely agreed to use this environment setting to detect when a build is executing in a CI environment, as opposed to a local development environment.&lt;/p&gt;

&lt;p&gt;This setting allows many common libraries to detect a CI environment and change behavior accordingly. One such behavior is the disabling of progress “spinners” that while useful in a local development terminal, can render poorly when operating in a log streamed CI environment.&lt;/p&gt;

&lt;p&gt;Because of this some libraries now interpret what were previously just warnings as hard errors and halt the build. The intention is that developers should not ship potentially broken configurations, but the downside is that builds that successfully completed previously started failing after this change.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;The fix&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If your build is breaking after this change, you can disable this behavior by unsetting the CI variable in your build. For example, the following will unset CI for the NPM command:&lt;br&gt;
&lt;code&gt;CI= npm run build&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Log in to &lt;a href="https://app.netlify.com/" rel="noopener noreferrer"&gt;Netlify&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Choose your &lt;code&gt;app&lt;/code&gt; and click on &lt;code&gt;Site settings&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Navigate to &lt;code&gt;Build &amp;amp; Deploy&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Under &lt;code&gt;Continuous Deployment&lt;/code&gt; select &lt;code&gt;Edit settings&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Update &lt;code&gt;Build command&lt;/code&gt; to
```
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;CI= npm run build&lt;br&gt;
       or&lt;br&gt;
CI=false npm run build //OP mentioned below in comments&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
If you are using `netlify.toml` to set the build command, update it as such:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;...&lt;br&gt;
  command = "CI= npm run build"&lt;br&gt;
...&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;*Rebuild you deployment
Now you should see `Production: master@c215c12 Published` 😉
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>netlify</category>
      <category>devops</category>
    </item>
    <item>
      <title>How to fix Page Not Found on netlify</title>
      <dc:creator>Kapil Pandey</dc:creator>
      <pubDate>Sun, 19 Jul 2020 12:28:16 +0000</pubDate>
      <link>https://forem.com/kapi1/how-to-fix-page-not-found-on-netlify-a4i</link>
      <guid>https://forem.com/kapi1/how-to-fix-page-not-found-on-netlify-a4i</guid>
      <description>&lt;p&gt;Since you are reading this, you surely might have came across the same error as shown in the cover image.&lt;/p&gt;

&lt;p&gt;I'm not sure if other static site servers/platforms are all like that, but if you deploy SPA to Netlify you can only navigate from index.html to other pages using Links.Once you refresh or type a URL directly in the address bar you'll get 404.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Why does this error occur?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If your SPA is build with React then React Router handles routing on the client side (browser) when you visit internal page (e.g. &lt;a href="http://localhost:3000/about"&gt;http://localhost:3000/about&lt;/a&gt;) but once you host your SPA on Netlify (server-side) the routing logic has to be modified because Netlify does not know how to handle the route.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;How to fix the issue?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;As per the &lt;a href="https://docs.netlify.com/routing/redirects/#syntax-for-the-redirects-file"&gt;doc&lt;/a&gt;, you need to create a file named &lt;strong&gt;_redirects&lt;/strong&gt; in the root folder.You can go to the link mentioned above to know more about it.I'll directly show how to fix it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a file named &lt;strong&gt;_redirects&lt;/strong&gt; without any extension inside public folder.&lt;/li&gt;
&lt;li&gt;Copy paste the below content in the file
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/*    /index.html   200
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Push your code and redeploy&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Cheers 🥂 you fixed the broken link!&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>webdev</category>
      <category>react</category>
      <category>github</category>
      <category>netlify</category>
    </item>
    <item>
      <title>Adding Profile page to Github using README.md</title>
      <dc:creator>Kapil Pandey</dc:creator>
      <pubDate>Sun, 19 Jul 2020 04:27:57 +0000</pubDate>
      <link>https://forem.com/kapi1/adding-profile-page-to-github-using-readme-md-2dil</link>
      <guid>https://forem.com/kapi1/adding-profile-page-to-github-using-readme-md-2dil</guid>
      <description>&lt;p&gt;GitHub rolled out a new feature that allow users to create a profile that is visible in users Github home page using a README file.Here's how you can access this feature:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Creating a new repository&lt;/strong&gt;&lt;br&gt;
Create a new repo but keep in mind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repo name should exactly be same as your user name.&lt;/li&gt;
&lt;li&gt;Repo must be public&lt;/li&gt;
&lt;li&gt;Last but not the least don't forget to initialize the README 
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--veBFG6oM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/7smby4cnfwyr3yfxngw0.jpg" alt="Alt Text"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Edit&lt;/strong&gt; the README.md file inside the new repo and add some content (text, GIFs, images, emojis, etc.).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Commit&lt;/strong&gt; your awesome looking README!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Push:&lt;/strong&gt; Finally don't forget to push your changes(if made locally).&lt;/p&gt;

&lt;p&gt;Here are some of the creative profiles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/timburgan"&gt;https://github.com/timburgan&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/jlengstorf"&gt;https://github.com/jlengstorf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/matyo91"&gt;https://github.com/matyo91&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/saadeghi"&gt;https://github.com/saadeghi&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/abhisheknaiidu"&gt;https://github.com/abhisheknaiidu&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/DoubleGremlin181"&gt;https://github.com/DoubleGremlin181&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/garimasingh128"&gt;https://github.com/garimasingh128&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>design</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
