<?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: Adarsh </title>
    <description>The latest articles on DEV Community by Adarsh  (@adarshmaharjan).</description>
    <link>https://dev.to/adarshmaharjan</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%2F697860%2F0f27128b-e9f9-4bff-a84f-7e518462e495.jpg</url>
      <title>DEV Community: Adarsh </title>
      <link>https://dev.to/adarshmaharjan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adarshmaharjan"/>
    <language>en</language>
    <item>
      <title>Just applied for it</title>
      <dc:creator>Adarsh </dc:creator>
      <pubDate>Sun, 05 Apr 2026 01:40:30 +0000</pubDate>
      <link>https://dev.to/adarshmaharjan/just-applied-for-it-42dl</link>
      <guid>https://dev.to/adarshmaharjan/just-applied-for-it-42dl</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/aws-builders/lift-scholarship-application-is-now-open-3hkh" class="crayons-story__hidden-navigation-link"&gt;Lift Scholarship Application is now Open!&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;
          &lt;a class="crayons-logo crayons-logo--l" href="/aws-builders"&gt;
            &lt;img alt="AWS Community Builders  logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F2794%2F88da75b6-aadd-4ea1-8083-ae2dfca8be94.png" class="crayons-logo__image" width="350" height="350"&gt;
          &lt;/a&gt;

          &lt;a href="/pratikmahalle" class="crayons-avatar  crayons-avatar--s absolute -right-2 -bottom-2 border-solid border-2 border-base-inverted  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1338883%2Ff6df614d-8871-433f-8745-36e3f6d1b2e5.jpg" alt="pratikmahalle profile" class="crayons-avatar__image" width="800" height="800"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/pratikmahalle" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Pratik Mahalle
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Pratik Mahalle
                
              
              &lt;div id="story-author-preview-content-2411825" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/pratikmahalle" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1338883%2Ff6df614d-8871-433f-8745-36e3f6d1b2e5.jpg" class="crayons-avatar__image" alt="" width="800" height="800"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Pratik Mahalle&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;span&gt;
              &lt;span class="crayons-story__tertiary fw-normal"&gt; for &lt;/span&gt;&lt;a href="/aws-builders" class="crayons-story__secondary fw-medium"&gt;AWS Community Builders &lt;/a&gt;
            &lt;/span&gt;
          &lt;/div&gt;
          &lt;a href="https://dev.to/aws-builders/lift-scholarship-application-is-now-open-3hkh" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Apr 16 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/aws-builders/lift-scholarship-application-is-now-open-3hkh" id="article-link-2411825"&gt;
          Lift Scholarship Application is now Open!
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/thelinuxfoundation"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;thelinuxfoundation&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/devops"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;devops&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/career"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;career&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/aws-builders/lift-scholarship-application-is-now-open-3hkh" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/exploding-head-daceb38d627e6ae9b730f36a1e390fca556a4289d5a41abb2c35068ad3e2c4b5.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;13&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/aws-builders/lift-scholarship-application-is-now-open-3hkh#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              2&lt;span class="hidden s:inline"&gt; comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            3 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
    </item>
    <item>
      <title>I have started using it</title>
      <dc:creator>Adarsh </dc:creator>
      <pubDate>Tue, 11 Nov 2025 06:01:46 +0000</pubDate>
      <link>https://dev.to/adarshmaharjan/i-have-started-using-it-1hnn</link>
      <guid>https://dev.to/adarshmaharjan/i-have-started-using-it-1hnn</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/mohammad222pr" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2943448%2Fc10c0e63-e26d-455a-ad1b-c974a36955c9.jpeg" alt="mohammad222pr"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/mohammad222pr/structuring-a-fastapi-project-best-practices-53l6" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Structuring a FastAPI Project: Best Practices&lt;/h2&gt;
      &lt;h3&gt;Mohammad ・ Mar 14&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Better safe than sorry</title>
      <dc:creator>Adarsh </dc:creator>
      <pubDate>Wed, 02 Jul 2025 00:10:15 +0000</pubDate>
      <link>https://dev.to/adarshmaharjan/better-safe-than-sorry-2c7m</link>
      <guid>https://dev.to/adarshmaharjan/better-safe-than-sorry-2c7m</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/kodebae/how-to-remove-a-leaked-env-file-from-github-permanently-3lei" class="crayons-story__hidden-navigation-link"&gt;How to remove a leaked .env file from GitHub permanently...&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/kodebae" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F480872%2F7bd10200-4808-4be1-994a-0a059c180b8c.jpeg" alt="kodebae profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/kodebae" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Kodebae
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Kodebae
                
              
              &lt;div id="story-author-preview-content-1981261" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/kodebae" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F480872%2F7bd10200-4808-4be1-994a-0a059c180b8c.jpeg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Kodebae&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/kodebae/how-to-remove-a-leaked-env-file-from-github-permanently-3lei" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Aug 31 '24&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/kodebae/how-to-remove-a-leaked-env-file-from-github-permanently-3lei" id="article-link-1981261"&gt;
          How to remove a leaked .env file from GitHub permanently...
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/git"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;git&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/github"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;github&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/security"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;security&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/beginners"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;beginners&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/kodebae/how-to-remove-a-leaked-env-file-from-github-permanently-3lei" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/exploding-head-daceb38d627e6ae9b730f36a1e390fca556a4289d5a41abb2c35068ad3e2c4b5.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;111&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/kodebae/how-to-remove-a-leaked-env-file-from-github-permanently-3lei#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              24&lt;span class="hidden s:inline"&gt; comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            2 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>git</category>
      <category>github</category>
      <category>security</category>
      <category>beginners</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>Adarsh </dc:creator>
      <pubDate>Wed, 02 Jul 2025 00:09:38 +0000</pubDate>
      <link>https://dev.to/adarshmaharjan/-f9p</link>
      <guid>https://dev.to/adarshmaharjan/-f9p</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/kodebae/how-to-remove-a-leaked-env-file-from-github-permanently-3lei" class="crayons-story__hidden-navigation-link"&gt;How to remove a leaked .env file from GitHub permanently...&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/kodebae" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F480872%2F7bd10200-4808-4be1-994a-0a059c180b8c.jpeg" alt="kodebae profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/kodebae" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Kodebae
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Kodebae
                
              
              &lt;div id="story-author-preview-content-1981261" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/kodebae" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F480872%2F7bd10200-4808-4be1-994a-0a059c180b8c.jpeg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Kodebae&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/kodebae/how-to-remove-a-leaked-env-file-from-github-permanently-3lei" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Aug 31 '24&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/kodebae/how-to-remove-a-leaked-env-file-from-github-permanently-3lei" id="article-link-1981261"&gt;
          How to remove a leaked .env file from GitHub permanently...
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/git"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;git&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/github"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;github&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/security"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;security&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/beginners"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;beginners&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/kodebae/how-to-remove-a-leaked-env-file-from-github-permanently-3lei" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/exploding-head-daceb38d627e6ae9b730f36a1e390fca556a4289d5a41abb2c35068ad3e2c4b5.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;111&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/kodebae/how-to-remove-a-leaked-env-file-from-github-permanently-3lei#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              24&lt;span class="hidden s:inline"&gt; comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            2 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>git</category>
      <category>github</category>
      <category>security</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Static Website hosting on AWS S3</title>
      <dc:creator>Adarsh </dc:creator>
      <pubDate>Mon, 29 Jul 2024 06:27:40 +0000</pubDate>
      <link>https://dev.to/adarshmaharjan/static-website-hosting-on-aws-s3-3081</link>
      <guid>https://dev.to/adarshmaharjan/static-website-hosting-on-aws-s3-3081</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;This is the blog for static website hosting in the AWS S3. I assume that you have a basic knowledge of the AWS-managed console and a basic understanding of the AWS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a static project locally
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Get the project for the GitHub link
&lt;/h3&gt;

&lt;p&gt;You can clone the GitHub repository or download the project through GitHub to the GitHub link given below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/adarshmaharjan/aws-static-website-hosting-blog.git" rel="noopener noreferrer"&gt;Project Link&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Manually Create your project
&lt;/h3&gt;

&lt;p&gt;Create a basic HTML project locally using the basic HTML file. The main HTML file should be named index.html so that it will render the given project through the index.html. And you can add style.css and main.js depending on your need for the project. The files that you need are listed below. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;index.html&lt;/li&gt;
&lt;li&gt;styles.css&lt;/li&gt;
&lt;li&gt;scripts.css&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Create S3 bucket
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Log into the AWS-managed console
&lt;/h3&gt;

&lt;p&gt;Enter the login username and password for logging into the AWS console with the credentials for the IAM user or the root password.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo1unoflwqqaax15zb9l9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo1unoflwqqaax15zb9l9.png" alt="Login To AWS" width="800" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Choose the AWS region
&lt;/h3&gt;

&lt;p&gt;You can choose the region for the AWS by selecting the top right corner drop-down of the AWS managed console.&lt;/p&gt;

&lt;p&gt;Before you create any bucket you should choose the AWS region the default is US East (N.Virginia) but you can select the AWS region depending on the distance between the server and the desired location. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5gjj3ryc520l55lf8dy1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5gjj3ryc520l55lf8dy1.png" alt="Choose AWS Region" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create S3 bucket
&lt;/h3&gt;

&lt;p&gt;Search the S3 in the AWS search and then click on it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1xan6v0o37dl4ld2bhc1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1xan6v0o37dl4ld2bhc1.png" alt="Search for S3 bucket" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create bucket
&lt;/h3&gt;

&lt;p&gt;After going to the S3 bucket click on the Create bucket so that you create a bucket and fill in the additional details. The details are documented below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a bucket name&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F03rhozh065wirqlwt6v1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F03rhozh065wirqlwt6v1.png" alt="Create bucket name" width="800" height="395"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uncheck a (Block Public access setting)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flklqb6qxvd0ygagkh9ia.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flklqb6qxvd0ygagkh9ia.png" alt="Enable Public Acess" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Leave everything as the default and click the create bucket button to create a S3 bucket.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd7vkx8inybn9vkmyhnx9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd7vkx8inybn9vkmyhnx9.png" alt="Create S3 bucket" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Change S3 bucket properties for the static website hosting
&lt;/h3&gt;

&lt;p&gt;Go to the S3 bucket click the S3 bucket link that was created and search for the properties in the S3. Under the properties click the search for the static website hosting and click on the edit button so that you enable the static website hosting.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select the properties Tab&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw9kcb9846vaou49gwqtl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw9kcb9846vaou49gwqtl.png" alt="select properties" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select The edit button of static website hosting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6o4f0ciwrbwul3lsspg1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6o4f0ciwrbwul3lsspg1.png" alt="Select The edit button of static website hosting" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enable Static website Hosting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxalswh0j0vgowrrbxoqu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxalswh0j0vgowrrbxoqu.png" alt="Enable static website hosting" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Upload File to S3
&lt;/h3&gt;

&lt;p&gt;Upload the file that you have cloned from the previous project link or that you have manually created to S3&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3j2ncm3j8encum068zc6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3j2ncm3j8encum068zc6.png" alt="Upload Files T0 S3" width="800" height="395"&gt;&lt;/a&gt;S3&lt;/p&gt;
&lt;h3&gt;
  
  
  Edit S3 Bucket Policy
&lt;/h3&gt;

&lt;p&gt;Edit the bucket policy and paste the code below to give access to all s3 objects for static website hosting.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "Id": "Policy1722232485407",
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Stmt1722232483590",
      "Action": [
        "s3:GetObject"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::aws-blog-project",
      "Principal": "*"
    }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Edit the bucket policy&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp42102lxo7tb65ui62kq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp42102lxo7tb65ui62kq.png" alt="Edit the bucket policy" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Paste the code above and save&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkkxbcoxkn4n0ksj4zwn7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkkxbcoxkn4n0ksj4zwn7.png" alt="Add bucket policy code" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After selecting the add enable checkbox then specify the default page for your static page. &lt;/p&gt;

&lt;p&gt;As we have created a project using the index.html specify the index.html as a default webpage for the static website and save the changes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fotrwzii37vo3754ikr80.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fotrwzii37vo3754ikr80.png" alt="Specify Default Page" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After saving the changes you can see the auto-generated link below the static website hosting. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgigh1q3m79mlun287hth.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgigh1q3m79mlun287hth.png" alt="Static web page" width="800" height="398"&gt;&lt;/a&gt;&lt;br&gt;
Click on the given link to visit your own S3 page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;You have successfully deployed your static website using AWS S3. &lt;/p&gt;

</description>
      <category>aws</category>
      <category>s3</category>
      <category>devops</category>
    </item>
    <item>
      <title>Integration of eslint, prettier, husky, lint-staged, commit-lint with next js</title>
      <dc:creator>Adarsh </dc:creator>
      <pubDate>Fri, 19 Jan 2024 05:56:37 +0000</pubDate>
      <link>https://dev.to/adarshmaharjan/integration-of-eslint-prettier-husky-lint-staged-commit-lint-with-next-js-42mj</link>
      <guid>https://dev.to/adarshmaharjan/integration-of-eslint-prettier-husky-lint-staged-commit-lint-with-next-js-42mj</guid>
      <description>&lt;h2&gt;
  
  
  Eslint
&lt;/h2&gt;

&lt;p&gt;ESLint is a popular open-source JavaScript linting utility. It helps developers find and fix common programming errors and enforce coding styles in their codebase. Using various plugins and rules, you can configure ESLint to suit your project's specific requirements. It's commonly used in web development to maintain code quality and consistency.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prettier
&lt;/h2&gt;

&lt;p&gt;"Prettier" is a code formatting tool that helps developers maintain a consistent coding style in their projects. It supports various programming languages like JavaScript, TypeScript, HTML, CSS, and more. It automatically formats code according to predefined rules, making it more readable and consistent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Husky
&lt;/h2&gt;

&lt;p&gt;The "husky" npm package is a Git hooks manager for Node.js projects. It helps automate tasks or checks at various points in the Git workflow. You can use it to enforce code standards, run tests, or perform other actions before commits or pushes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lint-staged
&lt;/h3&gt;

&lt;p&gt;lint-staged is a tool commonly used in web development. It runs linters on pre-committed files in a Git repository. This helps catch and fix issues before the code is committed. It's often used in conjunction with other tools like ESLint or Prettier to maintain code quality.&lt;/p&gt;

&lt;h2&gt;
  
  
  Commit Lint
&lt;/h2&gt;

&lt;p&gt;Commit lint is a tool to enforce commit message conventions in a Git repository. It helps maintain consistency and improves collaboration&lt;/p&gt;

&lt;h2&gt;
  
  
  Git Hooks
&lt;/h2&gt;

&lt;p&gt;Git hooks are scripts that Git executes before or after certain key events, such as committing, merging, and pushing. They allow you to customize and automate aspects of the version control process. Common hooks include pre-commit, post-commit, pre-push, etc. You can find and configure them in the .git/hooks directory of your Git repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;For the project, setup install the next with the help of the command below or using the next js documentation&lt;/p&gt;

&lt;h2&gt;
  
  
  Install vscode extensions
&lt;/h2&gt;

&lt;p&gt;Install Eslint and Prettier vscode extensions from the vscode extension marketplace using a browser or using vscode editor&lt;/p&gt;

&lt;h3&gt;
  
  
  Next JS and Eslint Setup
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-next-app@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After executing the command below go through the recommended setup to install the eslint with the next js.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What is your project named? my-app
Would you like to use TypeScript? No / Yes
Would you like to use ESLint? No / Yes
Would you like to use Tailwind CSS? No / Yes
Would you like to use `src/` directory? No / Yes
Would you like to use App Router? (recommended) No / Yes
Would you like to customize the default import alias (@/*)? No / Yes
What import alias would you like configured? @/*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Setup Prettier with eslint in the next js project
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i -D  prettier eslint-config-prettier
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installing, open your existing ESLint configuration file (.eslintrc.json or .eslintrc.js) and add the following line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "extends": ["next/core-web-vitals", "prettier"]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;create .prettierrc file and add the following code to implement a prettier standard&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "semi": true,
  "printWidth": 120,
  "singleQuote": true,
  "arrowParens": "always",
  "proseWrap": "preserve"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Setup husky and lint staged
&lt;/h3&gt;

&lt;p&gt;Install the husky and lint staged dependency using the following above commands&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i -D husky lint-staged
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that execute the command below to create a script that executes during the pre-commit using the git hooks&lt;/p&gt;

&lt;p&gt;This command will install and configure husky and lint-staged depending on the code quality tools from your project's package.json dependencies, so please make sure you install (npm install --save-dev) and configure all code quality tools like Prettier and ESLint before that.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx mrm@2 lint-staged
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;after exerting the script there will be an additional script in package.json which will be similar to the below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  "lint-staged": {
    "*.js": "eslint --cache --fix",
    "*.{js,css,md}": "prettier --write"
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are using the typescript replace the code below with the code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  "**/*.{ts,js}": "eslint --cache --fix",
  "**/*.{ts,js,md}": "prettier --write"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Setup Commit lint with the next js project
&lt;/h3&gt;

&lt;p&gt;Please go through this step after the installation of the husky only.&lt;/p&gt;

&lt;p&gt;Execute the command below to install the commit lint and configure&lt;/p&gt;

&lt;p&gt;Install&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g @commitlint/cli @commitlint/config-conventional
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add hook&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx husky add .husky/commit-msg  'npx --no -- commitlint --edit ${1}'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Configure&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo "module.exports = {extends: ['@commitlint/config-conventional']}" &amp;gt; commitlint.config.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The setup next js form eslint, prettier, husky, lint-stage and commit lint is completed and you can use this in the project to maintain maintained standardized code and commits&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>eslint</category>
      <category>prettier</category>
      <category>codingstandard</category>
    </item>
    <item>
      <title>SOLID design principle</title>
      <dc:creator>Adarsh </dc:creator>
      <pubDate>Sun, 14 Jan 2024 13:25:38 +0000</pubDate>
      <link>https://dev.to/adarshmaharjan/solid-2b33</link>
      <guid>https://dev.to/adarshmaharjan/solid-2b33</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwj4nrr0r6zy4o4fvvn5i.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwj4nrr0r6zy4o4fvvn5i.jpg" alt="Image description" width="800" height="465"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;S.O.L.I.D&lt;/strong&gt; stands for  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;S&lt;/strong&gt; stands for Single responsibility principle&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;O&lt;/strong&gt; stands for the open-closed principle&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;L&lt;/strong&gt; stands for the Liskov substitution principle&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I&lt;/strong&gt; stands for Interface segregation principle&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;D&lt;/strong&gt; stands for Dependency Inversion principle&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Single Responsibility Principle
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Single responsibility principle&lt;/strong&gt; is a simple principle, and it tells us that a class should have a single primary responsibility and as a consequence, it should only have one reason to change, That reason is somehow related to its responsibility in other words it's a bat idea to add more than one responsibility to a class.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Bad Practice
class Journal {
    constructor() {
        this.entries = []
    }
    addEntry(text) {
        //
    }
    removeEntry(index) {
        //
    }
    save(filename) {
        //
    }
    loadFromUrl(url) {
        //
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above code, we made a journal that is going to keep records. The bad practice signifies that you add a lot of code and give a multiple responsibility for a single class for journal management as well as file handling. &lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Better Practice
class Journal {
    constructor() {
        this.entries = []
    }
    addEntry(text) {
        //
    }
    removeEntry(index) {
        //
    }
}
class PersistenceManager {
    preprocessor() {
        //
    }
    saveToFile(journal, filename) {
        //
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example, it can be seen that it is easy to understand and implement the code by grouping the functionalities by the class instead of sticking all the functionality into a single class&lt;/p&gt;

&lt;p&gt;There is an anti-pattern that shows up during a coding practice which is rather bad as opposed to a good. There is also a pattern called a god object pattern which is a huge massive class that has lots of responsibility and spaghetti code which is very difficult to figure out&lt;/p&gt;

&lt;p&gt;And so the single responsibility is the exact opposite that basically lets us have just one responsibility and if we need additional responsibility then we just take other classes as they don't cost us anything. &lt;/p&gt;

&lt;p&gt;Another term we used is called separation of concerns. So separation of concern is what we do when we refactor for example let's suppose you find a complicated algorithm and what we are trying to do is split it into different parts that are somehow related. &lt;/p&gt;

&lt;p&gt;Seperation of the concern is also widely used in one of the most popular JS libraries react js. So in React, we solved this issue by creating container components that contain all the logic, which would then pass down the data via props to the presentational component. And with the introduction of React hooks, there's a new approach to this: using custom hooks. &lt;/p&gt;

&lt;p&gt;The code is available to preview on &lt;em&gt;"singleResponsibilityPrincipale.js"&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Open-Closed Principle
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Objects-Closed Principle(OCP)&lt;/strong&gt; states that objects or entities should be open for extension but closed for modification which means you never jump into an existing class and start to modify it unless you have to.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Product {
constructor(name, color, size) {
    //
    }
}
class ProductFilter {
    filterByColor(products, color) {
        //
    }
    filterBySize(products, size) {
        //
    }
    filterBySizeAndColor(products, size, color) {
        //
    }
    // state space explosion
    // 3 criteria (+weight) = 7 methods

    // OCP = open for open for extension but closed for modification
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above code extending the functionality is not a good thing because if the product filter class is something that other people might have just copied your class, and then you modified it, but it doesn't they just took a copy having something that has already been tested and put into production modifying it explicitly might not be a good idea&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// !Better Practice

class Product {
    constructor(name, color, size) {
        //
    }
}
class ColorSpecification {
    constructor(color) {
        //
    }
    isSatisfied(product) {
        //
    }
}
class SizeSpecification {
    constructor(size) {
        //
    }
    isSatisfied(product) {
        //
    }
}
class BetterSpecification {
    filter(items, spec) {
        //
    }
}
class AndSpecification {
    constructor(...spec) {
        //
    }
    isSatisfied(product) {
        //
    }
}

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

&lt;/div&gt;



&lt;p&gt;But generally, it's not such a great practice because it affects the scalability it affects maintenance ability of our code, So a better approach is to use inheritance or some sort of way of extending functionality&lt;/p&gt;

&lt;p&gt;Now typically an object-oriented programming language these specification classes would have some sort of base class you would have sort of maybe you have some kind of abstract class called specification but in javascript, there is no abstract class, but we could just force it into the constructor by making sure that if somebody calls the constructor of the specification then they get an error. &lt;/p&gt;

&lt;p&gt;Generally, the idea is that you use inheritance of some kind or seperation of concerns effectively to separate each criterion by which you want to filter into separate specification &lt;/p&gt;

&lt;p&gt;The implementation can be previewed in &lt;em&gt;"openClosed.js"&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Liskov Substitution Principle
&lt;/h3&gt;

&lt;p&gt;The third principle of solid design is the Liskov Substitution principle, and it is named after Barbra Liskov. The Liskov substitution principle states that any subclass object should be substituted for the superclass object from which it is derived.&lt;br&gt;
&lt;/p&gt;

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

class Rectangle {
    constructor() {
        this.width = 0
        this.height = 0
    }

    setColor(color) {
        // ...
    }

    render(area) {
        // ...
    }

    setWidth(width) {
        this.width = width
    }

    setHeight(height) {
        this.height = height
    }

    getArea() {
        return this.width * this.height
    }
}

class Square extends Rectangle {
    setWidth(width) {
        this.width = width
        this.height = width
    }

    setHeight(height) {
        this.width = height
        this.height = height
    }
}

function renderLargeRectangles(rectangles) {
    //
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;According to the code above rectangle class should substitute for the rectangle class but in the code above it only works for rectangles not for square&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Shape {
    setColor(color) {
        // ...
    }

    render(area) {
        // ...
    }
}

class Rectangle extends Shape {
    constructor(width, height) {
        super()
        this.width = width
        this.height = height
    }

    getArea() {
        return this.width * this.height
    }
}

class Square extends Shape {
    constructor(length) {
        super()
        this.length = length
    }

    getArea() {
        return this.length * this.length
    }
}

function renderLargeShapes(shapes) {
    //
}

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

&lt;/div&gt;



&lt;p&gt;So we are going to create a shape class that will be extended both to a rectangle and a square. The rectangle class has the constructor both with and height, and we can get the area by multiplying width and height, while the square class has a constructor with length only, and we render the area through the renderLargeShapes function &lt;/p&gt;

&lt;p&gt;The code implementation can be previewed in &lt;em&gt;"lsp.js"&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Interface Segregation Principle
&lt;/h3&gt;

&lt;p&gt;Interface segregation principle states 'A client should never be forced to implement an interface that it doesn’t use, or clients shouldn’t be forced to depend on methods they do not use'.&lt;/p&gt;

&lt;h3&gt;
  
  
  Simple Approach
&lt;/h3&gt;

&lt;p&gt;Suppose you enter a restaurant, and you are a pure vegetarian. The waiter in that restaurant gave you the menu card which includes vegetarian items, non-vegetarian items, drinks, and sweets. In this case, as a customer, you should have a menu card that includes only vegetarian items, not everything that you don’t eat in your food.&lt;/p&gt;

&lt;p&gt;Here the menu should be different for different types of customers. The common or general menu card for everyone can be divided into multiple cards instead of just one. Using this principle helps in reducing the side effects and frequency of required changes.&lt;/p&gt;

&lt;p&gt;In JavaScript, we don't have an interface by default. But we all would have faced situations where we want to do so many things on the constructor of a class.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class DOMTraverser {
    constructor(settings) {
        this.settings = settings
        this.setup()
    }

    setup() {
        this.rootNode = this.settings.rootNode
        this.animationModule.setup()
    }

    traverse() {
        // ...
    }
}

const $ = new DOMTraverser({
    rootNode: document.getElementsByTagName("body"),
    animationModule() {}, // Most of the time, we won't need to animate when traversing.
    // ...
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We create a dom traverser class awe pass a settings it gets a root node and we pass an animation module always but we may not need to animate&lt;br&gt;
&lt;/p&gt;

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

class DOMTraverser {
    constructor(settings) {
        this.settings = settings
        this.options = settings.options
        this.setup()
    }

    setup() {
        this.rootNode = this.settings.rootNode
        this.setupOptions()
    }

    setupOptions() {
        if (this.options.animationModule) {
            // ...
        }
    }

    traverse() {
        // ...
    }
}

const $ = new DOMTraverser({
    rootNode: document.getElementsByTagName("body"),
    options: {
        animationModule() {},
    },
})

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

&lt;/div&gt;



&lt;p&gt;So in the code above we make the passing of the animation module optional by making animation module objects optional so if passed in the animation module it is implemented if not its is not implemented&lt;/p&gt;

&lt;p&gt;The implementation of this principle can be previewed in &lt;em&gt;"isp.js"&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Dependency inversion principle
&lt;/h2&gt;

&lt;p&gt;The dependency inversion principle states that the high-level module must not depend on the low-level module, but they should depend on abstractions states that the high-level module must not depend on the low-level module, but they should depend on abstractions&lt;/p&gt;

&lt;p&gt;The dependency inversion principle defines a relationship that you should have between low-level modules and high-level modules.&lt;/p&gt;

&lt;h3&gt;
  
  
  Simple approach
&lt;/h3&gt;

&lt;p&gt;You can consider a real-life example of a TV remote battery. Your remote needs a battery but it’s not dependent on the battery brand. You can use any XYZ brand that you want and it will work. So we can say that the TV remote is loosely coupled with the brand name. Dependency Inversion makes your code more reusable&lt;br&gt;
&lt;/p&gt;

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

class InventoryRequester {
    constructor() {
        this.REQ_METHODS = ["HTTP"]
    }

    requestItem(item) {
        // ...
    }
}

class InventoryTracker {
    constructor(items) {
        this.items = items

        // BAD: 
        // We should just have requestItems depend on a request method: `request`
        this.requester = new InventoryRequester()
    }

    requestItems() {
        this.items.forEach((item) =&amp;gt; {
            this.requester.requestItem(item)
        })
    }
}

const inventoryTracker = new InventoryTracker(["apples", "bananas"])
inventoryTracker.requestItems()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above code, we create an inventory tracker class which is always going to use an inventory requester class that is always going to use the http method. We have created a dependency on a specific request implementation.&lt;br&gt;
&lt;/p&gt;

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

class InventoryTracker {
    constructor(items, requester) {
        this.items = items
        this.requester = requester
    }

    requestItems() {
        this.items.forEach((item) =&amp;gt; {
            this.requester.requestItem(item)
        })
    }
}

class InventoryRequesterV1 {
    constructor() {
        this.REQ_METHODS = ["HTTP"]
    }

    requestItem(item) {
        // ...
    }
}

class InventoryRequesterV2 {
    constructor() {
        this.REQ_METHODS = ["WS"]
    }

    requestItem(item) {
        // ...
    }
}


const inventoryTracker = new InventoryTracker(
    ["apples", "bananas"],
    new InventoryRequesterV2()
)
inventoryTracker.requestItems()

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

&lt;/div&gt;



&lt;p&gt;By constructing our dependencies externally and injecting them, we can easily&lt;br&gt;
substitute our request module for a fancy new one that uses WebSockets.&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional Content
&lt;/h2&gt;

&lt;p&gt;The above content resources are in the GitHub link below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/adarshmaharjan/solid_principale/tree/main" rel="noopener noreferrer"&gt;Resources&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>oop</category>
      <category>softwaredevelopment</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Linked list through recursion</title>
      <dc:creator>Adarsh </dc:creator>
      <pubDate>Thu, 28 Jul 2022 16:13:00 +0000</pubDate>
      <link>https://dev.to/adarshmaharjan/linked-list-through-recursion-n6c</link>
      <guid>https://dev.to/adarshmaharjan/linked-list-through-recursion-n6c</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;iostream&amp;gt;
using namespace std;
struct Node
{
  int data;
  struct Node *next;
};

void printList(struct Node *p)
{

  if (p == NULL)
  {
    return;
  }
  cout &amp;lt;&amp;lt; p-&amp;gt;data &amp;lt;&amp;lt; " ";
  printList(p-&amp;gt;next);
}

void recursivePrintList(struct Node *p)
{

  if (p == NULL)
  {
    return;
  }
  recursivePrintList(p-&amp;gt;next);
  cout &amp;lt;&amp;lt; p-&amp;gt;data &amp;lt;&amp;lt; " ";
}
Node *insertNode(Node *head, int data)
{
  Node *temp = new Node();
  temp-&amp;gt;data = data;
  temp-&amp;gt;next = head;
  head = temp;
  return head;
}
int main()
{
  Node *head = NULL;
  head = insertNode(head, 1);
  head = insertNode(head, 2);
  head = insertNode(head, 3);
  head = insertNode(head, 4);
  head = insertNode(head, 5);
  printList(head);
  cout &amp;lt;&amp;lt; endl;
  recursivePrintList(head);
  cout &amp;lt;&amp;lt; endl;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Linked list creation , deletion, insertion, and reversing of linked list</title>
      <dc:creator>Adarsh </dc:creator>
      <pubDate>Sun, 24 Jul 2022 15:00:00 +0000</pubDate>
      <link>https://dev.to/adarshmaharjan/linked-list-creation-deletion-insertion-and-reversing-of-linked-list-5co9</link>
      <guid>https://dev.to/adarshmaharjan/linked-list-creation-deletion-insertion-and-reversing-of-linked-list-5co9</guid>
      <description>&lt;p&gt;&lt;strong&gt;Linked list creation , deletion, insertion, and reversing of linked list&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
#include &amp;lt;iostream&amp;gt;
using namespace std;
struct Node
{
  int data;
  struct Node *next;
};
struct Node *head;
void printList()
{
  Node *temp = head;
  while (temp != NULL)
  {
    cout &amp;lt;&amp;lt; temp-&amp;gt;data &amp;lt;&amp;lt; " ";
    temp = temp-&amp;gt;next;
  }
  cout &amp;lt;&amp;lt; endl;
}
void insertNode(int data, int pos)
{
  Node *temp1 = new Node();
  temp1-&amp;gt;data = data;
  if (pos == 1)
  {
    temp1-&amp;gt;next = head;
    head = temp1;
    return;
  }
  Node *temp2 = head;
  for (size_t i = 0; i &amp;lt; pos - 2; i++)
  {
    temp2 = temp2-&amp;gt;next;
  }
  temp1-&amp;gt;next = temp2-&amp;gt;next;
  temp2-&amp;gt;next = temp1;
}
void deleteNode(int pos)
{
  Node *temp1 = head;
  if (pos == 1)
  {
    head = temp1-&amp;gt;next;
    delete temp1;
    return;
  }
  for (int i = 0; i &amp;lt; pos - 2; i++)
  {
    temp1 = temp1-&amp;gt;next;
  }
  Node *temp2 = temp1-&amp;gt;next;
  temp1-&amp;gt;next = temp2-&amp;gt;next;
  delete temp2;
}
void reverseList()
{
  Node *prev, *current, *next;
  current = head;
  prev = NULL;
  while (current != NULL)

  {
    next = current-&amp;gt;next;
    current-&amp;gt;next = prev;
    prev = current;
    current = next;
  }
  head = prev;
}
int main()
{
  head = NULL;
  for (int i = 1; i &amp;lt; 6; i++)
  {
    insertNode(i, i);
  }
  printList();
  deleteNode(3);
  printList();
  reverseList();
  printList();
  return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Linked List</title>
      <dc:creator>Adarsh </dc:creator>
      <pubDate>Thu, 21 Jul 2022 14:57:00 +0000</pubDate>
      <link>https://dev.to/adarshmaharjan/linked-list-3oma</link>
      <guid>https://dev.to/adarshmaharjan/linked-list-3oma</guid>
      <description>&lt;p&gt;&lt;strong&gt;Inserting into linked list at any position&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fasyx2myw9uoumd2mkwa7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fasyx2myw9uoumd2mkwa7.png" alt="Image description" width="800" height="337"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;

struct Node
{
  int data;
  struct Node *next;
};
struct Node *head;
void print()
{
  Node *temp = head;
  while (temp != NULL)
  {
    printf("%d ", temp-&amp;gt;data);
    temp = temp-&amp;gt;next;
  }
  printf("\n");
}

void insert(int data, int n)
{
  Node *temp1 = new Node();
  temp1-&amp;gt;data = data;
  temp1-&amp;gt;next = NULL;
  if (n == 1)
  {
    temp1-&amp;gt;next = head;
    head = temp1;
    print();
    return;
  }
  Node *temp2 = head;
  for (int i = 0; i &amp;lt; n - 2; i++)
  {
    temp2 = temp2-&amp;gt;next;
  }

  temp1-&amp;gt;next = temp2-&amp;gt;next;
  temp2-&amp;gt;next = temp1;
  print();
}

int main()
{
  head = NULL; // empty list
  insert(2, 1);
  insert(3, 2);
  insert(4, 1);
  insert(5, 2);
  return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Deleting the node in the linked list&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F16utud2oatw4x0cufzar.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F16utud2oatw4x0cufzar.png" alt="Image description" width="800" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5dahmujfta2tj86crs24.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5dahmujfta2tj86crs24.png" alt="Image description" width="800" height="337"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;

struct Node
{
  int data;
  struct Node *next;
};
struct Node *head;
void printList()
{
  Node *temp = head;
  while (temp != NULL)
  {
    printf("[%d|%p]-&amp;gt;", temp-&amp;gt;data, (void *)&amp;amp;temp);
    temp = temp-&amp;gt;next;
  }
  printf("\n");
}
void insert(int data)
{
  Node *temp = new Node();
  temp-&amp;gt;data = data;
  temp-&amp;gt;next = head;
  head = temp;
}
void deleteList(int n)
{
  struct Node *temp1 = head;
  if (n == 1)
  {
    head = temp1-&amp;gt;next;
    free(temp1);
    return;
  }
  int i;
  for (i = 0; i &amp;lt; n - 2; i++)
  {
    temp1 = temp1-&amp;gt;next;
  }
  printf("deleted data: %d ", temp1-&amp;gt;next-&amp;gt;data);

  printf("\n");
  struct Node *temp2 = temp1-&amp;gt;next;
  temp1-&amp;gt;next = temp2-&amp;gt;next;
  free(temp2);
}
int main()
{
  head = NULL;
  int n;
  insert(1);
  insert(2);
  insert(3);
  insert(4);
  insert(5);
  insert(6);
  insert(7);
  printList();
  printf("Enter a position to delete \n");
  scanf("%d", &amp;amp;n);
  deleteList(n);
  printList();
  return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Reversing a linked list&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj2wskesfqz4sivqpcu9b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj2wskesfqz4sivqpcu9b.png" alt="Image description" width="800" height="337"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdc31n3bk1cppseuinh1v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdc31n3bk1cppseuinh1v.png" alt="Image description" width="800" height="337"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6mkh777nypo3a33ojwv0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6mkh777nypo3a33ojwv0.png" alt="Image description" width="800" height="337"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F31pl7aa251iusukeonj5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F31pl7aa251iusukeonj5.png" alt="Image description" width="800" height="337"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
struct Node
{
  int data;
  struct Node *next;
};
struct Node *head;
void reverseList()
{
  struct Node *prev, *current, *next;
  current = head;
  prev = NULL;
  while (current != NULL)
  {
    next = current-&amp;gt;next;
    current-&amp;gt;next = prev; // linking to prev node
    // updating for the next node
    prev = current;
    current = next;
  }
  head = prev;
}
void printList()
{
  Node *temp = head;
  while (temp != NULL)
  {
    printf("%d ", temp-&amp;gt;data);
    temp = temp-&amp;gt;next;
  }
  printf("\n");
}
void insertNode(int data)
{
  Node *temp = new Node();
  temp-&amp;gt;data = data;
  temp-&amp;gt;next = head;
  head = temp;
}
int main()
{
  struct Node *head = NULL;
  insertNode(1);
  insertNode(2);
  insertNode(3);
  insertNode(4);
  printf("Linked List : ");
  printList();
  reverseList();
  printf("Reversed list: ");
  printList();
  return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Getting started with linked list</title>
      <dc:creator>Adarsh </dc:creator>
      <pubDate>Sun, 17 Jul 2022 06:39:20 +0000</pubDate>
      <link>https://dev.to/adarshmaharjan/getting-starte-with-linked-list-5n</link>
      <guid>https://dev.to/adarshmaharjan/getting-starte-with-linked-list-5n</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff9snl1ws3exzcx15v5c2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff9snl1ws3exzcx15v5c2.png" alt="Image description" width="800" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Inserting code at the begenning of the linked list</title>
      <dc:creator>Adarsh </dc:creator>
      <pubDate>Sun, 17 Jul 2022 06:36:50 +0000</pubDate>
      <link>https://dev.to/adarshmaharjan/inserting-code-at-the-begenning-of-the-linked-list-14aj</link>
      <guid>https://dev.to/adarshmaharjan/inserting-code-at-the-begenning-of-the-linked-list-14aj</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;

struct Node
{
  int data;
  struct Node *next;
};
// struct Node *head;

Node *insertVal(Node *head, int data)
{
  Node *temp = (Node *)malloc(sizeof(struct Node));
  temp-&amp;gt;data = data;
  temp-&amp;gt;next = head;
  head = temp;
  return head;
};
void printData(Node *head)
{
  struct Node *temp = head;
  printf("List is : ");
  while (temp != NULL)
  {
    printf("%d ", temp-&amp;gt;data);
    temp = temp-&amp;gt;next;
  }
  printf("\n");
};
int main()
{
  Node *head = NULL;
  printf("How many numbers ? \n");
  int n, x, i;
  scanf("%d", &amp;amp;n);
  printf("The number that u have entered is %d", n);
  for (i = 0; i &amp;lt; n; i++)
  {
    printf("Enter the data for the list \n");
    scanf("%d", &amp;amp;x);
    head = insertVal(head, x);
    printData(head);
  }
  return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
  </channel>
</rss>
