<?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: Nirmal Thomas Mathew</title>
    <description>The latest articles on DEV Community by Nirmal Thomas Mathew (@nirmal15mathew).</description>
    <link>https://dev.to/nirmal15mathew</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%2F418792%2F44688135-0743-4137-872e-0d6eea55e21a.jpg</url>
      <title>DEV Community: Nirmal Thomas Mathew</title>
      <link>https://dev.to/nirmal15mathew</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nirmal15mathew"/>
    <language>en</language>
    <item>
      <title>Create your own React State Management</title>
      <dc:creator>Nirmal Thomas Mathew</dc:creator>
      <pubDate>Tue, 09 Nov 2021 13:20:15 +0000</pubDate>
      <link>https://dev.to/nirmal15mathew/create-your-own-react-state-management-26k7</link>
      <guid>https://dev.to/nirmal15mathew/create-your-own-react-state-management-26k7</guid>
      <description>&lt;blockquote&gt;
&lt;h4&gt;
  
  
  Level: Intermediate⚛️; Scroll to bottom for full code⬇️
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Pen and Paper
&lt;/h3&gt;

&lt;p&gt;The implementation is simple, I think many blogs have been written about the same method; I think this needed to be written. We will be using react context for universal state management. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a wrapper component&lt;/li&gt;
&lt;li&gt;use &lt;code&gt;React.createContext&lt;/code&gt; to create state context&lt;/li&gt;
&lt;li&gt;create new app state using &lt;code&gt;useReducer()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;create a method in reducer function to add / update state&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Implementation
&lt;/h3&gt;

&lt;p&gt;Create wrapper&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;StateManager&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;

    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating context&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createContext&lt;/span&gt;&lt;span class="p"&gt;({})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating state in wrapper&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// store context&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createContext&lt;/span&gt;&lt;span class="p"&gt;({})&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;Provider&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;StateManager&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// creating state&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;dispatch&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;useReducer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;reducer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{})&lt;/span&gt;
    &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Provider&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;dispatch&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Provider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Implementing reducer&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;reducer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;action&lt;/span&gt;
    &lt;span class="k"&gt;switch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ADD&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{...&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="nl"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One thing to be noted is that, the payload given must be an object containing app data&lt;/p&gt;

&lt;h3&gt;
  
  
  Usage
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;useContext&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;store&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;StateManager&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./StateManager.js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
    &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;StateManager&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ChildComp&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;StateManager&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;ChildComp&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;dispatch&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;store&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;// work with app state&lt;/span&gt;

    &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://reactjs.org/docs/hooks-reference.html#usereducer"&gt;How to use useReducer ? &lt;/a&gt;&lt;br&gt;
&lt;a href="https://reactjs.org/docs/context.html#gatsby-focus-wrapper"&gt;How to use react context ? &lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Whole Code
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// StateManager.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="c1"&gt;// reducer function &lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;reducer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;action&lt;/span&gt;
    &lt;span class="k"&gt;switch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ADD&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{...&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="nl"&gt;default&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;// store context&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createContext&lt;/span&gt;&lt;span class="p"&gt;({})&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;Provider&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;StateManager&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// creating state&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;dispatch&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;useReducer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;reducer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{})&lt;/span&gt;
    &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Provider&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;dispatch&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Provider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>react</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>redux</category>
    </item>
    <item>
      <title>Get Started with Raspberry Pi [ For js and python ]</title>
      <dc:creator>Nirmal Thomas Mathew</dc:creator>
      <pubDate>Sat, 30 Jan 2021 14:50:43 +0000</pubDate>
      <link>https://dev.to/nirmal15mathew/get-started-with-raspberry-pi-for-js-and-python-2hin</link>
      <guid>https://dev.to/nirmal15mathew/get-started-with-raspberry-pi-for-js-and-python-2hin</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;So how to get started. Raspberry Pi is a single board computer that you can use to do automation, smart systems, servers, and a lot more .So hop on to get started with some blinking led example.You need the following things now..&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Raspberry Pi 1/2/3/4 A,B,..&lt;/li&gt;
&lt;li&gt;SD card with NOOBS/ raspbian [ OS ]&lt;/li&gt;
&lt;li&gt;Breadboard (optional)&lt;/li&gt;
&lt;li&gt;Some LEDs&lt;/li&gt;
&lt;li&gt;Resistor of 200ohm&lt;/li&gt;
&lt;li&gt;Some wires to connect&lt;/li&gt;
&lt;li&gt;A 5v power supply with usb micro [ &amp;gt; 2A]&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;It is advisable to use a high power mobile charger if you are using Rpi 3 or above&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Basic Info
&lt;/h3&gt;

&lt;p&gt;The raspberry pi is a single-board computer that you can definitely connect a mouse, keyboard and display with its on board connectors. But you can connect it to a ssh ( which I will talk about in another post) also. It has 26 or more GPIO pins (general pins for Input and Output ) to control external things using its signal. We can control the board using code written on it. The pi in the raspberry pi refers to the python language that it is initially intended to use with.But now there are libraries and packages for almost every language.&lt;/p&gt;

&lt;h3&gt;
  
  
  Get Started
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;If you are not at all unaware or uncomfortable with breadboard don't use it. We can do this without it&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgdh4ivbfcjuadvxjqfdm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgdh4ivbfcjuadvxjqfdm.png" alt="Physical Numbering" width="300" height="140"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Turn off the board if it is on. And connect the 7th pin on the board to the breadboard.&lt;/li&gt;
&lt;li&gt;Connect the 6th pin of RPi to another slot of breadboard.
3.Connect the LED's longer pin to the first slot connected and the shorter to the wire last connected.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl36gb1ph98fylpvgj4o1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fl36gb1ph98fylpvgj4o1.png" alt="Connection figure" width="800" height="679"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After this boot up the raspberry pi, I would recommend using a mouse, keyboard and display ( but SSH is fine )&lt;/p&gt;

&lt;h3&gt;
  
  
  Start Coding
&lt;/h3&gt;

&lt;p&gt;Try creating a folder for your own.&lt;/p&gt;

&lt;h4&gt;
  
  
  For python
&lt;/h4&gt;

&lt;p&gt;Install RPi and python if not installed ( it would be already installed ).&lt;br&gt;
Code for blinking LED.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library
from time import sleep # Import the sleep function from the time module

GPIO.setwarnings(False) # Ignore warning for now
GPIO.setmode(GPIO.BOARD) # Use physical pin numbering
GPIO.setup(8, GPIO.OUT, initial=GPIO.LOW) # Set pin 8 to be an output pin and set initial value to low (off)

while True: # Run forever
 GPIO.output(7, GPIO.HIGH) # Turn on
 sleep(1) # Sleep for 1 second
 GPIO.output(7, GPIO.LOW) # Turn off
 sleep(1) # Sleep for 1 second

GPIO.cleanup()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file as main.py&lt;br&gt;
Now open terminal ( use CTRL + ALT + T ) and type the command &lt;code&gt;cd yourfoldername&lt;/code&gt;. Use your folder name instead of the placeholder in the command. After that type the command &lt;code&gt;python main.py&lt;/code&gt;. See your LED blinking. If it is not, check your connections after shutting down.&lt;/p&gt;
&lt;h4&gt;
  
  
  For Javascript
&lt;/h4&gt;

&lt;p&gt;Open terminal Using CTRL + ALT + T, and use the command &lt;code&gt;cd yourfoldername&lt;/code&gt; in terminal. After that use the command &lt;code&gt;nano main.js&lt;/code&gt;, a text editor will open up. Use CTRL + X and type Y is prompted. After that you will be back in terminal. Type the command &lt;code&gt;npm init&lt;/code&gt;, it will prompt you to type name and other things. Just hit enter for everything, and after that use the command &lt;code&gt;npm i onoff --save&lt;/code&gt;. Now type again &lt;code&gt;nano main.js&lt;/code&gt; and use the following code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var Gpio = require('onoff').Gpio; //include onoff to interact with the GPIO
var LED = new Gpio(4, 'out'); //use GPIO pin 4, and specify that it is output, the 4 here is the 7 in the physical pin
var blinkInterval = setInterval(blinkLED, 250); //run the blinkLED function every 250ms

function blinkLED() { //function to start blinking
  if (LED.readSync() === 0) { //check the pin state, if the state is 0 (or off)
    LED.writeSync(1); //set pin state to 1 (turn LED on)
  } else {
    LED.writeSync(0); //set pin state to 0 (turn LED off)
  }
}

function endBlink() { //function to stop blinking
  clearInterval(blinkInterval); // Stop blink intervals
  LED.writeSync(0); // Turn LED off
  LED.unexport(); // Unexport GPIO to free resources
}

setTimeout(endBlink, 5000); //stop blinking after 5 seconds
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that CTRL + X and press Y, now type &lt;code&gt;npm start&lt;/code&gt; or &lt;code&gt;node main.js&lt;/code&gt;, now you can see the LED blinking.If it is not, check your connections after shutting down.&lt;/p&gt;

&lt;p&gt;So what are you waiting, get started now. Comment your views.&lt;br&gt;
References: &lt;br&gt;
&lt;a href=""&gt;Fireship&lt;/a&gt;&lt;br&gt;
&lt;a href=""&gt;W3Schools - JS version&lt;/a&gt;&lt;br&gt;
&lt;a href=""&gt;Python version&lt;/a&gt;&lt;/p&gt;

</description>
      <category>raspberrypi</category>
      <category>python</category>
      <category>node</category>
      <category>embedded</category>
    </item>
    <item>
      <title>Why bulma is actually cool?!</title>
      <dc:creator>Nirmal Thomas Mathew</dc:creator>
      <pubDate>Mon, 16 Nov 2020 11:09:52 +0000</pubDate>
      <link>https://dev.to/nirmal15mathew/why-bulma-is-actually-cool-2lj6</link>
      <guid>https://dev.to/nirmal15mathew/why-bulma-is-actually-cool-2lj6</guid>
      <description>&lt;p&gt;Note: This is my first post so please pardon me for my mistakes, if any. Any constructive criticism is welcome.&lt;/p&gt;

&lt;p&gt;So how did I meet up with bulma. It's been only two years since I started web designing and only 2-3 months since I learned JavaScript. First language I learned was python, so it was fairly easy to catch up with js. The fascinating thing is it's been less than two weeks since I discovered Bulma and I already fell in love with it. I was having my vacation and I was away from my house and wanted to do something creative with Vue. So in my mobile I installed Spck editor and in fact it is the most wonderful code editor I have seen in mobile version.(I have very little experience doing web dev in mobile, please tell me if there are any better option), so in the app I created a new project and as js framework I chose vue and when it asked for css framework, it was puzzling. The options were bootstrap, bulma, material lite, semantic, etc,. I didn't know any of them so I went to do some research about each of them, so then I chose Bulma here's why 👇👇&lt;/p&gt;

&lt;h1&gt;
  
  
  1) Minimal and Simple
&lt;/h1&gt;

&lt;p&gt;The framework itself is a css file 📁, and it doesn't require any extra knowledge about the framework. Just link the file like a css file and you are good to go. We can create simple and minimal looking webpages without using any to very little css.&lt;/p&gt;

&lt;h1&gt;
  
  
  2) Well documented 📝
&lt;/h1&gt;

&lt;p&gt;The documentation of bulma is quite appreciable. Because any beginner can quickly start designing and developing professional looking pages with their instructions. Each of the features and components are categorised&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkybc32y7lfduj7rpzhpp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fkybc32y7lfduj7rpzhpp.jpg" alt="Bulma Documen" width="720" height="1520"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  3) Component structure 📶
&lt;/h1&gt;

&lt;p&gt;So in Bulma each UI component has a class name with meaning. For example there are classes like button, then we have is-primary, is-secondary, is-large, is-dark and other properties which we can add&lt;/p&gt;

&lt;h1&gt;
  
  
  4) Newbie friendly 👨‍🏫
&lt;/h1&gt;

&lt;p&gt;Those who are new to front end or just started with html can use any css library and Bulma would be the easiest one to start with. Or it would be great for developers concentrating in the programming part of the app rather than on the ui and just want a clean UI.Screw it there's even loading animations integrated.&lt;/p&gt;

&lt;h1&gt;
  
  
  5) Progressive
&lt;/h1&gt;

&lt;p&gt;The Bulma CSS library can be constructively learnt and tweaked with the level of expertise. If you are complete noob you can just follow docs and create the ui if you have somewhat knowledge in css, you can put together various helper classes. And if you are a pro in css and sass you can costumize the themes of Bulma. And all of this doesn't mess up with the js. This comes in real handy when you are using vanilla js or just a library or anything&lt;/p&gt;

&lt;h1&gt;
  
  
  6)Other features
&lt;/h1&gt;

&lt;p&gt;It is mobile first( means it has responsive components and features),flexbox layout and guess what it is inspired by Bootstrap.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
So what I am telling is just give it a go. You'll love it.Follow and leave a like if you want more posts like this one.&lt;/p&gt;

</description>
      <category>css</category>
      <category>vue</category>
      <category>javascript</category>
      <category>bulma</category>
    </item>
    <item>
      <title>Don't stick with the theme!</title>
      <dc:creator>Nirmal Thomas Mathew</dc:creator>
      <pubDate>Mon, 16 Nov 2020 05:15:06 +0000</pubDate>
      <link>https://dev.to/nirmal15mathew/don-t-stick-with-the-theme-44b3</link>
      <guid>https://dev.to/nirmal15mathew/don-t-stick-with-the-theme-44b3</guid>
      <description>&lt;p&gt;Before underestimating me hear me clearly.&lt;br&gt;
This is my first post and I am a noob&lt;/p&gt;

&lt;p&gt;What do I mean??&lt;br&gt;
I am talking about the ui of your app. If you are a webdev or an app developer ( not the one with figma) and you struggle with your designs hear me out. There are a lot of design trends in the ui realm and it's a mess. Like the material or the Cupertino, etc.. and it's hard to implement. (Yes, in flutter it's quite simple but)Some functionality or widgets by our apps needs to be different and you can't find a widget or a component for that and you can't find it , so naturally you try to combine different widgets and nothing works here's what you wanna do.&lt;/p&gt;

&lt;p&gt;1) Create your own widget/component&lt;br&gt;
I mean your own. Why not just keep it simple and clean&lt;br&gt;
2) Large apps are not strict followers of themes&lt;br&gt;
For example take the ui of YouTube or instagram, do they follow stylish or extra flashy UI. No usability &amp;gt; style. Think about it&lt;br&gt;
3) Don't follow the themes you see on Instagram.&lt;br&gt;
There are lot of flashy themes created with UI design softwares and some of them are actually good. But yours is too. The only way you can improve is by trying&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
I mean that's is bye. Leave a like&lt;/p&gt;

</description>
      <category>css</category>
      <category>ux</category>
      <category>webdev</category>
      <category>flutter</category>
    </item>
  </channel>
</rss>
