<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Tanmay Kushwaha]]></title><description><![CDATA[Tanmay Kushwaha]]></description><link>https://tanmay-kushwaha.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 25 Jun 2026 00:55:48 GMT</lastBuildDate><atom:link href="https://tanmay-kushwaha.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Promise in JavaScript]]></title><description><![CDATA[What is Promise ? 🤔
First forget computer.
Promise matlab wada.
Jaise mummy bolti hai —“Padhai karo, shaam ko pizza milega.”
Ab pizza mila ya nahi mila, wo baad ki baat hai.But mummy ne future ka ek ]]></description><link>https://tanmay-kushwaha.hashnode.dev/promise-in-javascript</link><guid isPermaLink="true">https://tanmay-kushwaha.hashnode.dev/promise-in-javascript</guid><category><![CDATA[promises]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><dc:creator><![CDATA[Tanmay Kushwaha]]></dc:creator><pubDate>Sun, 01 Mar 2026 12:23:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/696a63644f5bdb08add2419c/e724b51c-2f19-4202-91b4-f720ff2ef791.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>What is Promise ? 🤔</h2>
<p>First forget computer.</p>
<p>Promise matlab wada.</p>
<p>Jaise mummy bolti hai —<br /><strong>“Padhai karo, shaam ko pizza milega.”</strong></p>
<p>Ab pizza mila ya nahi mila, wo baad ki baat hai.<br />But mummy ne future ka ek wada kiya.</p>
<p>👉 JavaScript me bhi Promise exactly same cheez hai.</p>
<p>It is a thing that says:</p>
<p><strong>“Abhi result nahi hai, but future me milega… ya fail bhi ho sakta hai.”</strong></p>
<p>Bas itna hi.</p>
<h2>Real Life Example 🍔</h2>
<p>Suppose you ordered burger on Zomato.</p>
<p>Delivery boy ne bola:<br />“Bhaiya 20 min me aa raha hu.”</p>
<p>Ab teen possibilities hai:</p>
<h3>⏳ 1. Pending (abhi kuch pata nahi)</h3>
<p>Delivery boy raste me hai.</p>
<p>Burger mila? — ❌<br />Cancel hua? — ❌</p>
<p>Bas wait hi wait.</p>
<p>Ye hota hai <strong>Pending state</strong></p>
<h3>✅ 2. Fulfilled (burger aa gaya)</h3>
<p>Door bell bajti hai 🔔</p>
<p>Delivery boy:<br />“Bhaiya burger le lo”</p>
<p>Ab wada pura ho gaya.</p>
<p>Ye hota hai <strong>Fulfilled</strong></p>
<h3>❌ 3. Rejected (burger nahi aaya)</h3>
<p>Phone aata hai:</p>
<p>“Sir rider gir gaya… order cancel .”</p>
<p>Ab burger nahi milega.</p>
<p>Ye hota hai <strong>Rejected</strong></p>
<h2>Important Baat 🧠</h2>
<p>Promise hamesha 3 state me hi hota hai:</p>
<ul>
<li><p>Pending → wait chal raha</p>
</li>
<li><p>Fulfilled → success</p>
</li>
<li><p>Rejected → fail</p>
</li>
</ul>
<p>Aur ek baar decide ho gaya, fir change nahi hota.</p>
<p>Burger aa gaya to aa gaya.<br />Cancel ho gaya to ho gaya.</p>
<p>Delivery boy bol nahi sakta:</p>
<p>“Sir burger bhi le lo aur cancel bhi samajh lo.” 😂</p>
<h2>Ab Computer Wala Part (Darr mat) 💻</h2>
<p>Programing me kuch kaam time leta hai:</p>
<ul>
<li><p>Internet se data lana</p>
</li>
<li><p>File download</p>
</li>
<li><p>Server se baat karna</p>
</li>
</ul>
<p>Computer bolta hai:</p>
<p>“Bhai tu apna kaam kar, result baad me dunga.”</p>
<p>Isliye Promise use hota hai.</p>
<h2>Code Example (simple sa) 👶</h2>
<pre><code class="language-javascript">const pizzaPromise = new Promise((resolve, reject) =&gt; {
  let shopOpen = true;

  if (shopOpen) {
    resolve("Pizza mil gaya 🍕");
  } else {
    reject("Shop band tha 😭");
  }
});
</code></pre>
<p>Isme:</p>
<ul>
<li><p>resolve = success</p>
</li>
<li><p>reject = fail</p>
</li>
</ul>
<h2>Result kaise milega ? 🤷‍♂️</h2>
<p>Computer khud nahi batata.</p>
<p>Tumko bolna padta hai:</p>
<p>👉 “Result aate hi bata dena.”</p>
<p>Uske liye <code>.then()</code> use hota hai.</p>
<pre><code class="language-javascript">pizzaPromise.then((msg) =&gt; {
  console.log(msg);
});
</code></pre>
<p>Agar success hua → message print</p>
<h2>Agar fail ho gaya ? 😬</h2>
<p>Tab use hota hai <code>.catch()</code></p>
<pre><code class="language-javascript">pizzaPromise
  .then((msg) =&gt; console.log(msg))
  .catch((err) =&gt; console.log(err));
</code></pre>
<p>Success → then chalega<br />Fail → catch chalega</p>
<h2>Funny Example 🤣</h2>
<p>Exam ka result Promise jaisa hota hai.</p>
<p>Result day se pehle:</p>
<p>👉 Pending — mummy bhi tension me, tum bhi</p>
<p>Result aa gaya:</p>
<p>Pass → Fulfilled 🎉<br />Fail → Rejected 😭</p>
<p>Aur sabse funny:</p>
<p>Result change nahi hota.</p>
<p>Teacher ko bolke:</p>
<p>“Sir reject ko fulfill kar do please”<br />— nahi hota 😂</p>
<h2>One More Real Example 😏</h2>
<p>Crush ko message bhejna:</p>
<p>“Hi 🙂”</p>
<p>Reply nahi aaya → Pending<br />Reply “Hi” → Fulfilled 😍<br />Reply “Bhaiya bolu?” → Rejected 💀  </p>
<h1>🔥 Static Methods</h1>
<p>Ab tak ek hi Promise tha.</p>
<p>Real life me ek sath bahut cheeze hoti hai.</p>
<p>Jaise Goa trip plan 😎</p>
<h2>Promise.all() — Sab ayenge tabhi trip 🚗</h2>
<p>Tumne 4 dost ko bola Goa chalte hai.</p>
<p>Rule: <strong>Sab ayenge tabhi jayenge</strong></p>
<p>Ek bhi mana → trip cancel ❌</p>
<pre><code class="language-plaintext">Promise.all([
  Promise.resolve("Rahul aa raha"),
  Promise.resolve("Aman aa raha"),
  Promise.reject("Kunal mana kar diya"),
  Promise.resolve("Rohit aa raha")
])
.then((data) =&gt; console.log("Trip pakki", data))
.catch(() =&gt; console.log("Trip cancel 😭"));
</code></pre>
<p>👉 Ek bhi reject → sab fail</p>
<p>Bilkul real life jaisa 😅</p>
<h2>Promise.any() — Koi ek aa jaye bas 😭</h2>
<p>Ab tum desperate ho.</p>
<p>“Bhai koi ek chal le mere sath”</p>
<pre><code class="language-plaintext">Promise.any([
  Promise.reject("Rahul busy"),
  Promise.resolve("Aman aa raha"),
  Promise.reject("Kunal exam")
])
.then((data) =&gt; console.log("Trip ho gayi 😎", data))
.catch(() =&gt; console.log("Koi bhi nahi aya 💀"));
</code></pre>
<p>👉 Ek success mila → kaam ho gaya</p>
<h2>Promise.allSettled() — Sabka result batao 📋</h2>
<p>Ab tum sirf dekhna chahte ho:</p>
<p>Kaun aa raha<br />Kaun mana kar raha</p>
<p>Trip ho ya na ho, report chahiye.</p>
<pre><code class="language-plaintext">Promise.allSettled([
  Promise.resolve("Rahul aa raha"),
  Promise.reject("Kunal mana"),
  Promise.resolve("Aman aa raha")
])
.then((data) =&gt; console.log(data));
</code></pre>
<p>Output type:</p>
<ul>
<li><p>Fulfilled → aa raha</p>
</li>
<li><p>Rejected → mana</p>
</li>
</ul>
<p>👉 Ye kabhi fail nahi hota<br />Bas sabka result de deta</p>
<h2>Final Words 🫡</h2>
<p>Agar aap non technical ho, ya programing nahi jante, to bas itna yaad rakho:</p>
<p>👉 Promise = Future ka wada</p>
<p>Success bhi ho sakta<br />Fail bhi ho sakta<br />Abhi wait chal raha hota</p>
<p>Bas JavaScript wale log isko fancy bana dete 😁</p>
<p>Agar ye samajh aa gaya to aap Promise concept samajh gaye.<br />Coding baad me bhi seekh sakte ho 👍</p>
<p>Chalo ab chai piyo ☕</p>
]]></content:encoded></item><item><title><![CDATA[Emmet for HTML: A Beginner’s Guide to Writing Faster HTML]]></title><description><![CDATA[Introduction: Why Writing HTML Feels Slow in Starting 😓
When we start learning HTML, everything feels new and little confusing.
You want to make a simple page layout:

one div

inside one heading

one paragraph

and a list


And then you start typin...]]></description><link>https://tanmay-kushwaha.hashnode.dev/emmet-for-html-a-beginners-guide-to-writing-faster-html</link><guid isPermaLink="true">https://tanmay-kushwaha.hashnode.dev/emmet-for-html-a-beginners-guide-to-writing-faster-html</guid><category><![CDATA[HTML5]]></category><category><![CDATA[HTML]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[Emmet]]></category><category><![CDATA[#emmet #html #htmlelemnts #boilerplate ]]></category><dc:creator><![CDATA[Tanmay Kushwaha]]></dc:creator><pubDate>Fri, 30 Jan 2026 20:28:32 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769804781590/c3851778-e8b5-42f5-96be-254a5122a22a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction-why-writing-html-feels-slow-in-starting">Introduction: Why Writing HTML Feels Slow in Starting 😓</h2>
<p>When we start learning HTML, everything feels new and little confusing.</p>
<p>You want to make a simple page layout:</p>
<ul>
<li><p>one div</p>
</li>
<li><p>inside one heading</p>
</li>
<li><p>one paragraph</p>
</li>
<li><p>and a list</p>
</li>
</ul>
<p>And then you start typing full HTML like this:</p>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">div</span>&gt;
  &lt;<span class="hljs-selector-tag">h1</span>&gt;&lt;/<span class="hljs-selector-tag">h1</span>&gt;
  &lt;<span class="hljs-selector-tag">p</span>&gt;&lt;/<span class="hljs-selector-tag">p</span>&gt;
  &lt;<span class="hljs-selector-tag">ul</span>&gt;
    &lt;<span class="hljs-selector-tag">li</span>&gt;&lt;/<span class="hljs-selector-tag">li</span>&gt;
    &lt;<span class="hljs-selector-tag">li</span>&gt;&lt;/<span class="hljs-selector-tag">li</span>&gt;
    &lt;<span class="hljs-selector-tag">li</span>&gt;&lt;/<span class="hljs-selector-tag">li</span>&gt;
  &lt;/<span class="hljs-selector-tag">ul</span>&gt;
&lt;/<span class="hljs-selector-tag">div</span>&gt;
</code></pre>
<p>So many tags to type.<br />So many opening and closing brackets.<br />Sometimes we forget to close tags also 😅</p>
<p>For beginners, this typing part feels slow and boring.</p>
<p>This is exactly where <strong>Emmet</strong> helps us.</p>
<hr />
<h2 id="heading-what-is-emmet-very-simple-meaning">What is Emmet? (Very Simple Meaning)</h2>
<p><strong>Emmet is a shortcut way to write HTML code faster.</strong></p>
<p>Instead of writing full HTML tags again and again,<br />you write small short forms, and Emmet converts them into full HTML automatically.</p>
<p>You can think Emmet like:</p>
<blockquote>
<p>Writing short message in mobile and auto-complete finishes the sentence.</p>
</blockquote>
<p>Same concept, but for HTML code.</p>
<hr />
<h2 id="heading-why-emmet-is-useful-for-html-beginners">Why Emmet is Useful for HTML Beginners</h2>
<p>For beginners, Emmet is very helpful because:</p>
<ul>
<li><p>It saves typing time</p>
</li>
<li><p>It reduces silly mistakes</p>
</li>
<li><p>It helps you understand HTML structure</p>
</li>
<li><p>You focus more on learning, not typing</p>
</li>
</ul>
<p>Important thing to remember:<br />👉 <strong>Emmet is optional</strong>, but once you start using it, you will not like to write HTML without it.</p>
<hr />
<h2 id="heading-how-emmet-works-inside-code-editors">How Emmet Works Inside Code Editors</h2>
<p>Emmet already comes built-in in most code editors.</p>
<p>Common editors:</p>
<ul>
<li><p>VS Code (mostly used)</p>
</li>
<li><p>Sublime Text</p>
</li>
<li><p>Atom</p>
</li>
</ul>
<h3 id="heading-how-it-works-step-by-step">How it works step by step:</h3>
<ol>
<li><p>You type Emmet shortcut</p>
</li>
<li><p>Press <strong>Tab</strong></p>
</li>
<li><p>HTML code appears automatically</p>
</li>
</ol>
<p>In VS Code, you don’t need to install anything extra.</p>
<hr />
<h2 id="heading-basic-emmet-syntax-and-abbreviations">Basic Emmet Syntax and Abbreviations</h2>
<p>Let us start with very basic example.</p>
<h3 id="heading-creating-html-element-using-emmet">Creating HTML element using Emmet</h3>
<p><strong>Emmet code</strong></p>
<pre><code class="lang-css"><span class="hljs-selector-tag">p</span>
</code></pre>
<p>Press <strong>Tab</strong></p>
<p><strong>HTML output</strong></p>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">p</span>&gt;&lt;/<span class="hljs-selector-tag">p</span>&gt;
</code></pre>
<p>This is the simplest example of Emmet.</p>
<hr />
<h2 id="heading-creating-html-elements-faster">Creating HTML Elements Faster</h2>
<h3 id="heading-example-div-element">Example: div element</h3>
<p><strong>Emmet</strong></p>
<pre><code class="lang-css"><span class="hljs-selector-tag">div</span>
</code></pre>
<p><strong>Generated HTML</strong></p>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">div</span>&gt;&lt;/<span class="hljs-selector-tag">div</span>&gt;
</code></pre>
<p>Same logic works for:</p>
<ul>
<li><p><code>h1</code></p>
</li>
<li><p><code>section</code></p>
</li>
<li><p><code>article</code></p>
</li>
<li><p><code>footer</code></p>
</li>
<li><p><code>header</code></p>
</li>
</ul>
<hr />
<h2 id="heading-adding-classes-using-emmet">Adding Classes Using Emmet</h2>
<p>To add class, Emmet uses <strong>dot ( . )</strong></p>
<h3 id="heading-example">Example:</h3>
<p><strong>Emmet</strong></p>
<pre><code class="lang-css"><span class="hljs-selector-tag">div</span><span class="hljs-selector-class">.box</span>
</code></pre>
<p><strong>HTML</strong></p>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">div</span> <span class="hljs-selector-tag">class</span>="<span class="hljs-selector-tag">box</span>"&gt;&lt;/<span class="hljs-selector-tag">div</span>&gt;
</code></pre>
<p>This is very commonly used in real projects.</p>
<hr />
<h2 id="heading-adding-ids-using-emmet">Adding IDs Using Emmet</h2>
<p>To add id, use <strong>hash ( # )</strong></p>
<h3 id="heading-example-1">Example:</h3>
<p><strong>Emmet</strong></p>
<pre><code class="lang-css"><span class="hljs-selector-tag">div</span><span class="hljs-selector-id">#main</span>
</code></pre>
<p><strong>HTML</strong></p>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">div</span> <span class="hljs-selector-tag">id</span>="<span class="hljs-selector-tag">main</span>"&gt;&lt;/<span class="hljs-selector-tag">div</span>&gt;
</code></pre>
<p>Simple and clean.</p>
<hr />
<h2 id="heading-adding-class-and-id-together">Adding Class and ID Together</h2>
<h3 id="heading-example-2">Example:</h3>
<p><strong>Emmet</strong></p>
<pre><code class="lang-css"><span class="hljs-selector-tag">div</span><span class="hljs-selector-id">#navbar</span><span class="hljs-selector-class">.menu</span>
</code></pre>
<p><strong>HTML</strong></p>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">div</span> <span class="hljs-selector-tag">id</span>="<span class="hljs-selector-tag">navbar</span>" <span class="hljs-selector-tag">class</span>="<span class="hljs-selector-tag">menu</span>"&gt;&lt;/<span class="hljs-selector-tag">div</span>&gt;
</code></pre>
<p>Emmet understands automatically what is id and what is class.</p>
<hr />
<h2 id="heading-adding-attributes-using-emmet">Adding Attributes Using Emmet</h2>
<p>Attributes are written inside <strong>square brackets [ ]</strong></p>
<h3 id="heading-example-3">Example:</h3>
<p><strong>Emmet</strong></p>
<pre><code class="lang-css"><span class="hljs-selector-tag">a</span><span class="hljs-selector-attr">[href=<span class="hljs-string">"https://example.com"</span> target=<span class="hljs-string">"_blank"</span>]</span>
</code></pre>
<p><strong>HTML</strong></p>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">a</span> <span class="hljs-selector-tag">href</span>="<span class="hljs-selector-tag">https</span>://<span class="hljs-selector-tag">example</span><span class="hljs-selector-class">.com</span>" <span class="hljs-selector-tag">target</span>="_<span class="hljs-selector-tag">blank</span>"&gt;&lt;/<span class="hljs-selector-tag">a</span>&gt;
</code></pre>
<p>Very useful for links, images and input tags.</p>
<hr />
<h2 id="heading-creating-nested-elements-using-emmet">Creating Nested Elements Using Emmet</h2>
<p>Nested elements means element inside another element.</p>
<p>To do this in Emmet, we use <strong>greater than sign ( &gt; )</strong></p>
<h3 id="heading-example-4">Example:</h3>
<p><strong>Emmet</strong></p>
<pre><code class="lang-css"><span class="hljs-selector-tag">div</span>&gt;<span class="hljs-selector-tag">p</span>
</code></pre>
<p><strong>HTML</strong></p>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">div</span>&gt;
  &lt;<span class="hljs-selector-tag">p</span>&gt;&lt;/<span class="hljs-selector-tag">p</span>&gt;
&lt;/<span class="hljs-selector-tag">div</span>&gt;
</code></pre>
<p>Easy to understand structure also.</p>
<hr />
<h3 id="heading-more-nested-example">More Nested Example</h3>
<p><strong>Emmet</strong></p>
<pre><code class="lang-css"><span class="hljs-selector-tag">div</span>&gt;<span class="hljs-selector-tag">ul</span>&gt;<span class="hljs-selector-tag">li</span>
</code></pre>
<p><strong>HTML</strong></p>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">div</span>&gt;
  &lt;<span class="hljs-selector-tag">ul</span>&gt;
    &lt;<span class="hljs-selector-tag">li</span>&gt;&lt;/<span class="hljs-selector-tag">li</span>&gt;
  &lt;/<span class="hljs-selector-tag">ul</span>&gt;
&lt;/<span class="hljs-selector-tag">div</span>&gt;
</code></pre>
<p>This helps beginners visualise HTML hierarchy.</p>
<hr />
<h2 id="heading-repeating-elements-using-emmet-multiplication">Repeating Elements Using Emmet Multiplication</h2>
<p>To repeat elements, Emmet uses <strong>asterisk ( * )</strong></p>
<h3 id="heading-example-create-4-paragraphs">Example: Create 4 paragraphs</h3>
<p><strong>Emmet</strong></p>
<pre><code class="lang-css"><span class="hljs-selector-tag">p</span>*4
</code></pre>
<p><strong>HTML</strong></p>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">p</span>&gt;&lt;/<span class="hljs-selector-tag">p</span>&gt;
&lt;<span class="hljs-selector-tag">p</span>&gt;&lt;/<span class="hljs-selector-tag">p</span>&gt;
&lt;<span class="hljs-selector-tag">p</span>&gt;&lt;/<span class="hljs-selector-tag">p</span>&gt;
&lt;<span class="hljs-selector-tag">p</span>&gt;&lt;/<span class="hljs-selector-tag">p</span>&gt;
</code></pre>
<hr />
<h3 id="heading-nested-repetition-example">Nested + Repetition Example</h3>
<p><strong>Emmet</strong></p>
<pre><code class="lang-css"><span class="hljs-selector-tag">ul</span>&gt;<span class="hljs-selector-tag">li</span>*3
</code></pre>
<p><strong>HTML</strong></p>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">ul</span>&gt;
  &lt;<span class="hljs-selector-tag">li</span>&gt;&lt;/<span class="hljs-selector-tag">li</span>&gt;
  &lt;<span class="hljs-selector-tag">li</span>&gt;&lt;/<span class="hljs-selector-tag">li</span>&gt;
  &lt;<span class="hljs-selector-tag">li</span>&gt;&lt;/<span class="hljs-selector-tag">li</span>&gt;
&lt;/<span class="hljs-selector-tag">ul</span>&gt;
</code></pre>
<p>This is used daily while writing lists.</p>
<hr />
<h2 id="heading-generating-full-html-boilerplate-using-emmet">Generating Full HTML Boilerplate Using Emmet</h2>
<p>This is most loved Emmet shortcut 😄</p>
<h3 id="heading-just-type">Just type:</h3>
<p><strong>Emmet</strong></p>
<pre><code class="lang-css">!
</code></pre>
<p>Press <strong>Tab</strong></p>
<h3 id="heading-full-html-boilerplate-generated">Full HTML Boilerplate Generated</h3>
<pre><code class="lang-css">&lt;!<span class="hljs-selector-tag">DOCTYPE</span> <span class="hljs-selector-tag">html</span>&gt;
&lt;<span class="hljs-selector-tag">html</span> <span class="hljs-selector-tag">lang</span>="<span class="hljs-selector-tag">en</span>"&gt;
&lt;<span class="hljs-selector-tag">head</span>&gt;
  &lt;<span class="hljs-selector-tag">meta</span> <span class="hljs-selector-tag">charset</span>="<span class="hljs-selector-tag">UTF-8</span>"&gt;
  &lt;<span class="hljs-selector-tag">meta</span> <span class="hljs-selector-tag">name</span>="<span class="hljs-selector-tag">viewport</span>" <span class="hljs-selector-tag">content</span>="<span class="hljs-selector-tag">width</span>=<span class="hljs-selector-tag">device-width</span>, <span class="hljs-selector-tag">initial-scale</span>=1<span class="hljs-selector-class">.0</span>"&gt;
  &lt;<span class="hljs-selector-tag">title</span>&gt;<span class="hljs-selector-tag">Document</span>&lt;/<span class="hljs-selector-tag">title</span>&gt;
&lt;/<span class="hljs-selector-tag">head</span>&gt;
&lt;<span class="hljs-selector-tag">body</span>&gt;

&lt;/<span class="hljs-selector-tag">body</span>&gt;
&lt;/<span class="hljs-selector-tag">html</span>&gt;
</code></pre>
<p>Without Emmet, typing this every time is really boring.</p>
<hr />
<h2 id="heading-emmet-workflow-inside-code-editor">Emmet Workflow Inside Code Editor</h2>
<p>Normal workflow looks like this:</p>
<ol>
<li><p>Decide HTML structure in mind</p>
</li>
<li><p>Write Emmet shortcut</p>
</li>
<li><p>Press Tab</p>
</li>
<li><p>Edit content</p>
</li>
<li><p>Move forward</p>
</li>
</ol>
<p>This makes HTML writing smooth and fast.</p>
<hr />
<h2 id="heading-emmet-is-optional-but-powerful">Emmet is Optional but Powerful</h2>
<p>One important thing for beginners:</p>
<ul>
<li><p>You can write HTML without Emmet also</p>
</li>
<li><p>But Emmet makes you faster</p>
</li>
<li><p>Most developers use Emmet daily</p>
</li>
</ul>
<p>So learn it slowly, no need to memorise everything at once.</p>
<hr />
<h2 id="heading-final-conclusion">Final Conclusion</h2>
<p>When you are learning HTML, writing too much code can feel tiring and confusing.<br /><strong>Emmet removes this pain</strong>.</p>
<p>Start with small shortcuts:</p>
<ul>
<li><p>div</p>
</li>
<li><p>class</p>
</li>
<li><p>nesting</p>
</li>
<li><p>multiplication</p>
</li>
</ul>
<p>Practice little everyday, and slowly Emmet becomes habit.</p>
<p>Once you get used to Emmet,<br />writing HTML feels easy and fun, not boring.</p>
<p>Happy coding and keep practising 🚀</p>
]]></content:encoded></item><item><title><![CDATA[How DNS Resolution Works]]></title><description><![CDATA[Whenever we open our browser and type something like google.com, we never think what happens inside. Page opens in seconds and we move on. But behind this simple action, there is one very important system working silently — DNS.
In this blog, we’ll u...]]></description><link>https://tanmay-kushwaha.hashnode.dev/how-dns-resolution-works</link><guid isPermaLink="true">https://tanmay-kushwaha.hashnode.dev/how-dns-resolution-works</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[dns resolver]]></category><category><![CDATA[dns-records]]></category><category><![CDATA[dns]]></category><category><![CDATA[#DNS Resolution]]></category><category><![CDATA[dns server]]></category><category><![CDATA[#TLD]]></category><dc:creator><![CDATA[Tanmay Kushwaha]]></dc:creator><pubDate>Fri, 30 Jan 2026 20:11:20 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769803365401/56023f19-1743-4ef0-9550-7c1d11b47b07.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Whenever we open our browser and type something like <a target="_blank" href="http://google.com"><strong>google.com</strong></a>, we never think what happens inside. Page opens in seconds and we move on. But behind this simple action, there is one very important system working silently — <strong>DNS</strong>.</p>
<p>In this blog, we’ll understand <strong>how DNS resolution works</strong>, using the <code>dig</code> command, in very simple words and full Indian context. No heavy theory, just real world explanation.</p>
<hr />
<h2 id="heading-what-is-dns-and-why-name-resolution-exists">What is DNS and Why Name Resolution Exists</h2>
<p>DNS means <strong>Domain Name System</strong>.</p>
<p>Best way to understand DNS is this:<br />👉 <strong>DNS is the phonebook of the internet</strong>.</p>
<p>Humans remember names:</p>
<ul>
<li><p><a target="_blank" href="http://google.com">google.com</a></p>
</li>
<li><p><a target="_blank" href="http://facebook.com">facebook.com</a></p>
</li>
</ul>
<p>But computers only understand numbers:</p>
<ul>
<li>142.250.183.14</li>
</ul>
<p>So DNS helps convert <strong>domain name → IP address</strong>.<br />This conversion is called <strong>name resolution</strong>.</p>
<p>Without DNS, internet would be headache yaar. Imagine remembering IP address of every website — impossible.</p>
<hr />
<h2 id="heading-what-is-the-dig-command-and-why-we-use-it">What is the <code>dig</code> Command and Why We Use It</h2>
<p><code>dig</code> stands for <strong>Domain Information Groper</strong>.</p>
<p>It is a command-line tool mostly used by:</p>
<ul>
<li><p>developers</p>
</li>
<li><p>system engineers</p>
</li>
<li><p>devops people</p>
</li>
</ul>
<p><code>dig</code> helps us see:</p>
<ul>
<li><p>DNS records</p>
</li>
<li><p>Which server is replying</p>
</li>
<li><p>How DNS lookup is happening</p>
</li>
</ul>
<p>Example:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">dig</span> <span class="hljs-selector-tag">google</span><span class="hljs-selector-class">.com</span>
</code></pre>
<p>This command shows the <strong>final IP address</strong>, plus many technical details.<br />Basically, <code>dig</code> shows what browser normally hides from us.</p>
<hr />
<h2 id="heading-dns-works-in-layers-very-important-concept">DNS Works in Layers (Very Important Concept)</h2>
<p>DNS resolution does not happen in one shot.<br />It happens step by step in layers.</p>
<p>Order is always like this:</p>
<p><strong>Root Server → TLD Server → Authoritative Server</strong></p>
<p>If you remember only this flow, half DNS is already clear.</p>
<hr />
<h2 id="heading-understanding-dig-ns-root-name-servers">Understanding <code>dig . NS</code> – Root Name Servers</h2>
<p>Let’s start from the top level.</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">dig</span> . <span class="hljs-selector-tag">NS</span>
</code></pre>
<p>Here, <code>.</code> (dot) represents the <strong>root of DNS</strong>.</p>
<p>This command gives us list of <strong>root name servers</strong>, like:</p>
<ul>
<li><p><a target="_blank" href="http://a.root-servers.net">a.root-servers.net</a></p>
</li>
<li><p><a target="_blank" href="http://b.root-servers.net">b.root-servers.net</a></p>
</li>
</ul>
<p>Root servers:</p>
<ul>
<li><p>Don’t know IP of <a target="_blank" href="http://google.com">google.com</a></p>
</li>
<li><p>Only know who manages <code>.com</code>, <code>.in</code>, <code>.org</code> etc</p>
</li>
</ul>
<p>Root server is like:</p>
<blockquote>
<p>“I don’t know exact address, but I know where to ask next”</p>
</blockquote>
<hr />
<h2 id="heading-understanding-dig-com-ns-tld-name-servers">Understanding <code>dig com NS</code> – TLD Name Servers</h2>
<p>Next layer is <strong>TLD (Top Level Domain)</strong>.</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">dig</span> <span class="hljs-selector-tag">com</span> <span class="hljs-selector-tag">NS</span>
</code></pre>
<p>This tells us:</p>
<blockquote>
<p>Who handles <code>.com</code> websites?</p>
</blockquote>
<p>TLD servers:</p>
<ul>
<li><p>Handle <code>.com</code></p>
</li>
<li><p>Know which <strong>authoritative servers</strong> manage <a target="_blank" href="http://google.com">google.com</a></p>
</li>
</ul>
<p>Still, no IP address here.<br />Only directions.</p>
<p>Think of it like asking railway enquiry counter — they guide you, they don’t take you home.</p>
<hr />
<h2 id="heading-understanding-dig-googlecomhttpgooglecom-ns-authoritative-name-servers">Understanding <code>dig</code> <a target="_blank" href="http://google.com"><code>google.com</code></a> <code>NS</code> – Authoritative Name Servers</h2>
<p>Now we reach correct owner.</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">dig</span> <span class="hljs-selector-tag">google</span><span class="hljs-selector-class">.com</span> <span class="hljs-selector-tag">NS</span>
</code></pre>
<p>This shows <strong>authoritative name servers</strong> like:</p>
<ul>
<li><p><a target="_blank" href="http://ns1.google.com">ns1.google.com</a></p>
</li>
<li><p><a target="_blank" href="http://ns2.google.com">ns2.google.com</a></p>
</li>
</ul>
<p>These servers:</p>
<ul>
<li><p>Are controlled by Google</p>
</li>
<li><p>Store real DNS records</p>
</li>
<li><p>Give final trusted answer</p>
</li>
</ul>
<p>Authoritative servers are <strong>boss level</strong>.<br />Whatever they say is final.</p>
<hr />
<h2 id="heading-understanding-dig-googlecomhttpgooglecom-full-dns-flow">Understanding <code>dig</code> <a target="_blank" href="http://google.com"><code>google.com</code></a> – Full DNS Flow</h2>
<p>Now the final command:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">dig</span> <span class="hljs-selector-tag">google</span><span class="hljs-selector-class">.com</span>
</code></pre>
<p>This gives:</p>
<ul>
<li><p>IP address</p>
</li>
<li><p>TTL</p>
</li>
<li><p>Server details</p>
</li>
</ul>
<p>Behind the scene, this happened:</p>
<ol>
<li><p>Resolver asked <strong>Root server</strong></p>
</li>
<li><p>Root replied with <strong>.com TLD servers</strong></p>
</li>
<li><p>Resolver asked <strong>TLD server</strong></p>
</li>
<li><p>TLD replied with <strong>Google’s authoritative servers</strong></p>
</li>
<li><p>Resolver asked <strong>authoritative server</strong></p>
</li>
<li><p>Got final IP address</p>
</li>
</ol>
<p>All this happens in milliseconds. Crazy fast no?</p>
<hr />
<h2 id="heading-what-are-ns-records-and-why-they-are-important">What Are NS Records and Why They Are Important</h2>
<p>NS means <strong>Name Server</strong>.</p>
<p>NS records tell:</p>
<blockquote>
<p>“Who is responsible for this domain?”</p>
</blockquote>
<p>Why NS records matter:</p>
<ul>
<li><p>They define trust</p>
</li>
<li><p>They allow delegation</p>
</li>
<li><p>Without NS, DNS cannot move forward</p>
</li>
</ul>
<p>DNS works only because of <strong>NS records chain</strong>.</p>
<hr />
<h2 id="heading-role-of-recursive-resolver-hidden-hero">Role of Recursive Resolver (Hidden Hero)</h2>
<p>Your browser does not talk to root server directly.</p>
<p>A <strong>recursive resolver</strong> does this job for you.</p>
<p>Resolver:</p>
<ul>
<li><p>Talks to all DNS servers</p>
</li>
<li><p>Stores results in cache</p>
</li>
<li><p>Returns final IP to browser</p>
</li>
</ul>
<p>That’s why website opens faster second time.<br />Caching saves time and internet energy 😄</p>
<hr />
<h2 id="heading-how-dns-connects-to-real-browser-request">How DNS Connects to Real Browser Request</h2>
<p>Once browser gets IP address:</p>
<ol>
<li><p>DNS work is done</p>
</li>
<li><p>Browser starts TCP connection</p>
</li>
<li><p>HTTP/HTTPS request is sent</p>
</li>
<li><p>Server sends webpage</p>
</li>
</ol>
<p>No DNS = No internet. Simple as that.</p>
<hr />
<h2 id="heading-dns-from-system-design-point-of-view">DNS From System Design Point of View</h2>
<p>DNS is:</p>
<ul>
<li><p>Distributed system</p>
</li>
<li><p>Highly scalable</p>
</li>
<li><p>No single point of failure</p>
</li>
<li><p>Cache friendly</p>
</li>
</ul>
<p>This design allows internet to work smoothly even with billions of users.</p>
<hr />
<h2 id="heading-final-conclusion">Final Conclusion</h2>
<p>DNS looks boring in beginning, but honestly it is <strong>one of the most important system on internet</strong>.</p>
<p>By understanding:</p>
<ul>
<li><p>Root servers</p>
</li>
<li><p>TLD servers</p>
</li>
<li><p>Authoritative servers</p>
</li>
<li><p><code>dig</code> command</p>
</li>
</ul>
<p>You are not just learning theory, you are understanding <strong>real internet working</strong>.</p>
]]></content:encoded></item><item><title><![CDATA[CSS Selectors 101: Targeting Elements with Precision]]></title><description><![CDATA[On any HTML page, there are many elements like paragraph, heading, div, button and more.CSS selectors help us select the correct element and apply style on it.
Without selectors, CSS is nothing. Selectors are the base of CSS.
Why CSS Selectors Are Ne...]]></description><link>https://tanmay-kushwaha.hashnode.dev/css-selectors-101-targeting-elements-with-precision</link><guid isPermaLink="true">https://tanmay-kushwaha.hashnode.dev/css-selectors-101-targeting-elements-with-precision</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[CSS]]></category><category><![CDATA[css_selector]]></category><dc:creator><![CDATA[Tanmay Kushwaha]]></dc:creator><pubDate>Fri, 30 Jan 2026 19:52:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769801330690/223088b1-cf89-497e-821f-ae0ece9d5049.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>On any HTML page, there are many elements like paragraph, heading, div, button and more.<br />CSS selectors help us <strong>select the correct element</strong> and apply style on it.</p>
<p>Without selectors, CSS is nothing. Selectors are the <strong>base of CSS</strong>.</p>
<h2 id="heading-why-css-selectors-are-needed">Why CSS Selectors Are Needed</h2>
<p>Let’s understand with a simple Indian example.</p>
<p>Imagine you are teacher in a class.</p>
<ul>
<li><p>You say: <strong>“All students stand up”</strong> → everyone stands</p>
</li>
<li><p>You say: <strong>“Students wearing white uniform stand up”</strong> → some students stands</p>
</li>
<li><p>You say: <strong>“Rohit stand up”</strong> → only one student stands</p>
</li>
</ul>
<p>CSS selectors work in same way.</p>
<p>They tell browser:</p>
<ul>
<li><p>which element to pick</p>
</li>
<li><p>which style to apply</p>
</li>
<li><p>where exactly to apply</p>
</li>
</ul>
<p>That’s why CSS selectors are very important.</p>
<hr />
<h2 id="heading-css-selectors-ways-to-choose-elements">CSS Selectors = Ways to Choose Elements</h2>
<p>Selectors are just <strong>ways to choose HTML elements</strong>.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Real Life</td><td>CSS</td></tr>
</thead>
<tbody>
<tr>
<td>Calling everyone</td><td>Element selector</td></tr>
<tr>
<td>Calling a group</td><td>Class selector</td></tr>
<tr>
<td>Calling one person</td><td>ID selector</td></tr>
</tbody>
</table>
</div><p>Simple and clear logic.</p>
<hr />
<h2 id="heading-1-element-selector">1. Element Selector</h2>
<p>Element selector selects <strong>all elements of one type</strong>.</p>
<h3 id="heading-example">Example</h3>
<pre><code>p {
  <span class="hljs-attr">color</span>: blue;
}
</code></pre><h3 id="heading-what-happens">What happens?</h3>
<ul>
<li><p>All <code>&lt;p&gt;</code> text becomes blue</p>
</li>
<li><p>No class or id required</p>
</li>
</ul>
<h3 id="heading-when-to-use">When to use?</h3>
<ul>
<li><p>When same style needed for all elements</p>
</li>
<li><p>Like all paragraph, all headings, body etc</p>
</li>
</ul>
<p>This is the <strong>starting point of CSS</strong>.</p>
<hr />
<h2 id="heading-2-class-selector">2. Class Selector</h2>
<p>Class selector is used when we want to style <strong>some elements</strong>, not all.</p>
<p>Class selector always start with <strong>dot (.)</strong>.</p>
<h3 id="heading-example-1">Example</h3>
<pre><code>.card {
  <span class="hljs-attr">border</span>: <span class="hljs-number">1</span>px solid black;
  padding: <span class="hljs-number">10</span>px;
}
</code></pre><pre><code>&lt;div <span class="hljs-class"><span class="hljs-keyword">class</span></span>=<span class="hljs-string">"card"</span>&gt;Card <span class="hljs-number">1</span>&lt;/div&gt;
<span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card"</span>&gt;</span>Card 2<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
<span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>Normal div<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
</code></pre><h3 id="heading-result">Result</h3>
<ul>
<li><p>Only elements with class <code>card</code> get styled</p>
</li>
<li><p>Same class can be used many time</p>
</li>
</ul>
<h3 id="heading-why-class-is-popular">Why class is popular?</h3>
<ul>
<li><p>Reusable</p>
</li>
<li><p>Flexible</p>
</li>
<li><p>Mostly used in real websites</p>
</li>
</ul>
<hr />
<h2 id="heading-3-id-selector">3. ID Selector</h2>
<p>ID selector is used for <strong>one unique element only</strong>.</p>
<p>ID selector starts with <strong>#</strong>.</p>
<h3 id="heading-example-2">Example</h3>
<pre><code>#main-title {
  font-size: <span class="hljs-number">28</span>px;
}
</code></pre><pre><code>&lt;h1 id=<span class="hljs-string">"main-title"</span>&gt;Welcome&lt;/h1&gt;
</code></pre><h3 id="heading-important-rule">Important rule ⚠️</h3>
<ul>
<li><p>One ID = one element</p>
</li>
<li><p>ID should not repeat</p>
</li>
</ul>
<h3 id="heading-use-case">Use case</h3>
<ul>
<li><p>Header, footer, main container</p>
</li>
<li><p>Unique layout elements</p>
</li>
</ul>
<hr />
<h2 id="heading-4-group-selectors">4. Group Selectors</h2>
<p>Group selector is used when we want <strong>same style on multiple selectors</strong>.</p>
<h3 id="heading-example-3">Example</h3>
<pre><code>h1, h2, h3 {
  <span class="hljs-attr">color</span>: darkgreen;
}
</code></pre><h3 id="heading-why-use">Why use?</h3>
<ul>
<li><p>Less code</p>
</li>
<li><p>Clean CSS</p>
</li>
<li><p>Easy to maintain</p>
</li>
</ul>
<hr />
<h2 id="heading-5-descendant-selectors">5. Descendant Selectors</h2>
<p>Descendant selector targets <strong>element inside another element</strong>.</p>
<h3 id="heading-example-4">Example</h3>
<pre><code>div p {
  <span class="hljs-attr">color</span>: brown;
}
</code></pre><h3 id="heading-meaning">Meaning</h3>
<ul>
<li><p><code>&lt;p&gt;</code> inside <code>&lt;div&gt;</code> gets styled</p>
</li>
<li><p>Outside paragraph not affected</p>
</li>
</ul>
<h3 id="heading-real-life-meaning">Real life meaning</h3>
<p>“Only people sitting inside this room listen carefully”</p>
<hr />
<h2 id="heading-6-basic-pseudo-classes-initial-level">6. Basic Pseudo-Classes (Initial Level)</h2>
<p>Pseudo-classes are used to style elements <strong>based on their state</strong>.</p>
<p>We will keep it very basic for now.</p>
<h3 id="heading-common-beginner-pseudo-classes">Common beginner pseudo-classes:</h3>
<ul>
<li><p><code>:hover</code></p>
</li>
<li><p><code>:active</code></p>
</li>
<li><p><code>:focus</code></p>
</li>
</ul>
<h3 id="heading-example-5">Example</h3>
<pre><code>button:hover {
  background-color: green;
}
</code></pre><h3 id="heading-what-this-means">What this means?</h3>
<ul>
<li><p>When mouse goes on button</p>
</li>
<li><p>Button color changes</p>
</li>
</ul>
<h3 id="heading-another-example">Another example</h3>
<pre><code>a:hover {
  <span class="hljs-attr">color</span>: red;
}
</code></pre><p>Pseudo-classes help in making website <strong>interactive</strong>.</p>
<p>👉 Don’t go deep now, just know they exist and are useful.</p>
<hr />
<h2 id="heading-7-css-priority-high-level">7. CSS Priority (High Level)</h2>
<p>Sometimes many selectors apply on same element.<br />So CSS follows a priority rule.</p>
<h3 id="heading-normal-priority-order">Normal priority order:</h3>
<pre><code>ID &gt; Class &gt; Element
</code></pre><h3 id="heading-example-6">Example</h3>
<pre><code>p {
  <span class="hljs-attr">color</span>: black;
}

.text {
  <span class="hljs-attr">color</span>: blue;
}

#special {
  <span class="hljs-attr">color</span>: red;
}
</code></pre><p>If one paragraph has class and id both, <strong>red color apply</strong>.</p>
<hr />
<h2 id="heading-8-the-important-rule-highest-priority">8. The <code>!important</code> Rule (Highest Priority)</h2>
<p><code>!important</code> is the <strong>highest priority rule in CSS</strong>.</p>
<h3 id="heading-what-it-does">What it does?</h3>
<ul>
<li><p>Overrides all previous styles</p>
</li>
<li><p>Even ID selector can be ignored</p>
</li>
</ul>
<h3 id="heading-example-7">Example</h3>
<pre><code>p {
  <span class="hljs-attr">color</span>: blue !important;
}

#special {
  <span class="hljs-attr">color</span>: red;
}
</code></pre><h3 id="heading-result-1">Result</h3>
<ul>
<li><p>Text color becomes blue</p>
</li>
<li><p>Because <code>!important</code> wins</p>
</li>
</ul>
<h3 id="heading-final-priority-order">Final priority order:</h3>
<pre><code>!important &gt; ID &gt; Class &gt; Element
</code></pre><p>⚠️ Use carefully, too much use creates confusion.</p>
<hr />
<h2 id="heading-before-and-after-styling-example">Before and After Styling Example</h2>
<h3 id="heading-before-css">Before CSS</h3>
<pre><code>&lt;p&gt;Hello CSS&lt;/p&gt;
<span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"note"</span>&gt;</span>Important line<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span></span>
</code></pre><h3 id="heading-after-css">After CSS</h3>
<pre><code>p {
  <span class="hljs-attr">color</span>: black;
}

.note {
  <span class="hljs-attr">color</span>: red;
  font-weight: bold;
}
</code></pre><p>Same HTML, but different look.<br />Selectors did the magic.</p>
]]></content:encoded></item><item><title><![CDATA[TCP vs UDP: When to Use What, and How TCP Relates to HTTP]]></title><description><![CDATA[Why Internet Needs Rules to Send Data
Think about normal life.If you want to talk to someone or send something, you follow some rules, right?
Like:

Phone number should be correct

Address should be clear

Message should reach properly


Internet als...]]></description><link>https://tanmay-kushwaha.hashnode.dev/tcp-vs-udp-when-to-use-what-and-how-tcp-relates-to-http</link><guid isPermaLink="true">https://tanmay-kushwaha.hashnode.dev/tcp-vs-udp-when-to-use-what-and-how-tcp-relates-to-http</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[TCP]]></category><category><![CDATA[tcp/ip-model]]></category><category><![CDATA[UDP]]></category><category><![CDATA[tcp vs udp]]></category><dc:creator><![CDATA[Tanmay Kushwaha]]></dc:creator><pubDate>Fri, 30 Jan 2026 18:45:05 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769798639727/363f8453-795c-4ef0-9b11-e789f73d029a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-why-internet-needs-rules-to-send-data">Why Internet Needs Rules to Send Data</h2>
<p>Think about normal life.<br />If you want to talk to someone or send something, you follow some rules, right?</p>
<p>Like:</p>
<ul>
<li><p>Phone number should be correct</p>
</li>
<li><p>Address should be clear</p>
</li>
<li><p>Message should reach properly</p>
</li>
</ul>
<p>Internet also works in same way.<br />When data goes from your mobile or laptop to a server, it cannot go without rules.<br />Otherwise everything will be mess.</p>
<p>These rules are called <strong>protocols</strong>.</p>
<p>Two very important protocols are <strong>TCP</strong> and <strong>UDP</strong>.</p>
<hr />
<h2 id="heading-what-are-tcp-and-udp-very-high-level">What are TCP and UDP? (Very High Level)</h2>
<h3 id="heading-what-is-tcp">What is TCP?</h3>
<p><strong>TCP (Transmission Control Protocol)</strong> is like a <strong>proper phone call</strong> or <strong>trusted courier service</strong>.</p>
<p>TCP first checks:</p>
<ul>
<li><p>Is other side ready or not</p>
</li>
<li><p>Data is reaching or not</p>
</li>
<li><p>Order is correct or not</p>
</li>
</ul>
<p>If some data is missing, TCP will send it again.</p>
<p>So TCP is little slow, but very safe and reliable.</p>
<p><strong>Indian example:</strong><br />Sending important documents by courier with tracking number.</p>
<hr />
<h3 id="heading-what-is-udp">What is UDP?</h3>
<p><strong>UDP (User Datagram Protocol)</strong> is like <strong>announcement on loudspeaker</strong> or <strong>live TV broadcast</strong>.</p>
<p>UDP just sends data fast:</p>
<ul>
<li><p>No checking</p>
</li>
<li><p>No confirmation</p>
</li>
<li><p>No resend</p>
</li>
</ul>
<p>If something lost, it is lost.</p>
<p><strong>Indian example:</strong><br />Live match commentary on radio.<br />If signal gone, commentator will not repeat again 😄</p>
<p>UDP is very fast but risky.</p>
<hr />
<h2 id="heading-key-differences-between-tcp-and-udp">Key Differences Between TCP and UDP</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Point</td><td>TCP</td><td>UDP</td></tr>
</thead>
<tbody>
<tr>
<td>Connection</td><td>Required</td><td>Not required</td></tr>
<tr>
<td>Speed</td><td>Slower</td><td>Faster</td></tr>
<tr>
<td>Reliability</td><td>Very high</td><td>Low</td></tr>
<tr>
<td>Data order</td><td>Maintained</td><td>Not guaranteed</td></tr>
<tr>
<td>Error checking</td><td>Yes</td><td>No</td></tr>
<tr>
<td>Best for</td><td>Important data</td><td>Live data</td></tr>
</tbody>
</table>
</div><hr />
<h2 id="heading-when-to-use-tcp">When to Use TCP</h2>
<p>Use <strong>TCP</strong> when:</p>
<ul>
<li><p>Data is very important</p>
</li>
<li><p>Accuracy matters</p>
</li>
<li><p>Losing data is not allowed</p>
</li>
</ul>
<h3 id="heading-real-world-tcp-examples">Real-World TCP Examples</h3>
<ul>
<li><p>Opening websites</p>
</li>
<li><p>Login and signup forms</p>
</li>
<li><p>Online payments</p>
</li>
<li><p>Emails</p>
</li>
<li><p>File downloads</p>
</li>
</ul>
<p>If even small data is missing, system can fail.<br />That is why TCP is used.</p>
<hr />
<h2 id="heading-when-to-use-udp">When to Use UDP</h2>
<p>Use <strong>UDP</strong> when:</p>
<ul>
<li><p>Speed is more important than accuracy</p>
</li>
<li><p>Small data loss is acceptable</p>
</li>
</ul>
<h3 id="heading-real-world-udp-examples">Real-World UDP Examples</h3>
<ul>
<li><p>Video calls</p>
</li>
<li><p>Online gaming</p>
</li>
<li><p>Live video streaming</p>
</li>
<li><p>Voice calls</p>
</li>
</ul>
<p>In video call, if one frame is missing, call still works fine.<br />So UDP is best here.</p>
<hr />
<h2 id="heading-tcp-vs-udp-real-life-examples">TCP vs UDP: Real-Life Examples</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Activity</td><td>Protocol</td></tr>
</thead>
<tbody>
<tr>
<td>Website loading</td><td>TCP</td></tr>
<tr>
<td>YouTube live stream</td><td>UDP</td></tr>
<tr>
<td>Online banking</td><td>TCP</td></tr>
<tr>
<td>PUBG / Free Fire</td><td>UDP</td></tr>
<tr>
<td>File download</td><td>TCP</td></tr>
<tr>
<td>WhatsApp voice call</td><td>UDP</td></tr>
</tbody>
</table>
</div><hr />
<h2 id="heading-what-is-http-and-where-it-fits">What is HTTP and Where It Fits</h2>
<p>Now many beginners get confused here.</p>
<p><strong>HTTP (HyperText Transfer Protocol)</strong> is <strong>not</strong> responsible for sending data physically.</p>
<p>HTTP only defines:</p>
<ul>
<li><p>How request is made</p>
</li>
<li><p>How response is sent</p>
</li>
<li><p>Data format</p>
</li>
<li><p>Status codes like 200, 404</p>
</li>
</ul>
<p>So HTTP is <strong>application-level protocol</strong>, not transport one.</p>
<hr />
<h2 id="heading-relationship-between-tcp-and-http">Relationship Between TCP and HTTP</h2>
<p>Think like this 👇</p>
<ul>
<li><p>HTTP decides <strong>what to say</strong></p>
</li>
<li><p>TCP decides <strong>how to send safely</strong></p>
</li>
</ul>
<p>HTTP always runs <strong>on top of TCP</strong>.</p>
<p>TCP handles:</p>
<ul>
<li><p>Connection</p>
</li>
<li><p>Data order</p>
</li>
<li><p>Reliability</p>
</li>
</ul>
<p>HTTP just uses TCP to send its messages.</p>
<p>👉 HTTP does not replace TCP<br />👉 HTTP cannot work without TCP</p>
<hr />
<h2 id="heading-why-http-does-not-replace-tcp">Why HTTP Does Not Replace TCP</h2>
<p>Because both have different work.</p>
<ul>
<li><p>TCP focuses on <strong>delivery</strong></p>
</li>
<li><p>HTTP focuses on <strong>communication rules</strong></p>
</li>
</ul>
<p>They work together, not against each other.</p>
<hr />
<h2 id="heading-common-beginner-confusion-is-http-same-as-tcp">Common Beginner Confusion: “Is HTTP Same as TCP?”</h2>
<p>No ❌<br />They are totally different.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>TCP</td><td>HTTP</td></tr>
</thead>
<tbody>
<tr>
<td>Transport protocol</td><td>Application protocol</td></tr>
<tr>
<td>Handles delivery</td><td>Handles request &amp; response</td></tr>
<tr>
<td>Works at lower level</td><td>Works at higher level</td></tr>
</tbody>
</table>
</div><p>One simple line to remember:</p>
<blockquote>
<p>HTTP talks, TCP carries the message.</p>
</blockquote>
<hr />
<h2 id="heading-final-summary">Final Summary</h2>
<ul>
<li><p>TCP is safe and reliable but slow</p>
</li>
<li><p>UDP is fast but risky</p>
</li>
<li><p>HTTP is application-level protocol</p>
</li>
<li><p>HTTP always uses TCP underneath</p>
</li>
</ul>
<p>Once you understand this, networking concepts becomes much easier.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding HTML Tags and Elements (Beginner Friendly)]]></title><description><![CDATA[When we open any website, what we actually see is not magic. Behind every webpage, there is HTML doing the basic work.

Think of HTML as the skeleton of a webpage. Just like our body needs bones to stand, a website needs HTML to exist.

Let’s underst...]]></description><link>https://tanmay-kushwaha.hashnode.dev/understanding-html-tags-and-elements-beginner-friendly</link><guid isPermaLink="true">https://tanmay-kushwaha.hashnode.dev/understanding-html-tags-and-elements-beginner-friendly</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[HTML5]]></category><category><![CDATA[HTML tags ]]></category><category><![CDATA[HTML]]></category><dc:creator><![CDATA[Tanmay Kushwaha]]></dc:creator><pubDate>Fri, 30 Jan 2026 10:17:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769809458031/31eed5c6-146a-4fa2-8b5b-48b41f819646.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<ul>
<li><p>When we open any website, what we actually see is not magic. Behind every webpage, there is <strong>HTML</strong> doing the basic work.</p>
</li>
<li><p>Think of HTML as the <strong>skeleton of a webpage</strong>. Just like our body needs bones to stand, a website needs HTML to exist.</p>
</li>
<li><p>Let’s understand HTML tags and elements step by step, in very simple words.</p>
</li>
</ul>
<hr />
<h2 id="heading-what-is-html-and-why-we-use-it">What is HTML and Why We Use It</h2>
<p>HTML means <strong>HyperText Markup Language</strong>.</p>
<p>In simple words, HTML tells the browser:</p>
<ul>
<li><p>this is a heading</p>
</li>
<li><p>this is a paragraph</p>
</li>
<li><p>this is an image</p>
</li>
<li><p>this is a button or link</p>
</li>
</ul>
<p>HTML is used to <strong>create structure</strong> of a webpage.<br />It does not add color, animation or logic. That work is done by CSS and JavaScript.</p>
<p>👉 Without HTML, there is no webpage at all.</p>
<hr />
<h2 id="heading-html-as-the-skeleton-of-a-webpage">HTML as the Skeleton of a Webpage</h2>
<p>A very common and easy example:</p>
<ul>
<li><p><strong>HTML</strong> → Skeleton (basic structure)</p>
</li>
<li><p><strong>CSS</strong> → Clothes (design, color, layout)</p>
</li>
<li><p><strong>JavaScript</strong> → Brain (thinking, logic, actions)</p>
</li>
</ul>
<p>Right now, we are only learning <strong>HTML</strong>, means the skeleton part.</p>
<hr />
<h2 id="heading-what-is-an-html-tag">What is an HTML Tag</h2>
<p>An <strong>HTML tag</strong> is used to give instruction to browser.</p>
<p>Tags are written inside <code>&lt; &gt;</code> brackets.</p>
<p>Example:</p>
<pre><code class="lang-plaintext">&lt;p&gt;Hello World&lt;/p&gt;
</code></pre>
<p>Here <code>&lt;p&gt;</code> is telling browser that the text inside is a <strong>paragraph</strong>.</p>
<p>So basically, tags tell <strong>what type of content</strong> it is.</p>
<hr />
<h2 id="heading-opening-tag-closing-tag-and-content">Opening Tag, Closing Tag and Content</h2>
<p>Most HTML tags have three parts.</p>
<p>Example:</p>
<pre><code class="lang-plaintext">&lt;p&gt;This is a paragraph&lt;/p&gt;
</code></pre>
<ul>
<li><p><code>&lt;p&gt;</code> → opening tag</p>
</li>
<li><p><code>This is a paragraph</code> → content</p>
</li>
<li><p><code>&lt;/p&gt;</code> → closing tag</p>
</li>
</ul>
<p>Closing tag always comes with a <strong>slash /</strong>.</p>
<p>This is very basic but very important.</p>
<hr />
<h2 id="heading-what-is-an-html-element">What is an HTML Element</h2>
<p>Many beginners get confused here, so listen carefully.</p>
<p>👉 <strong>HTML Element = opening tag + content + closing tag</strong></p>
<p>So this full line:</p>
<pre><code class="lang-plaintext">&lt;p&gt;This is a paragraph&lt;/p&gt;
</code></pre>
<p>is called <strong>one HTML element</strong>.</p>
<ul>
<li><p><code>&lt;p&gt;</code> alone is a <strong>tag</strong></p>
</li>
<li><p>whole thing is an <strong>element</strong></p>
</li>
</ul>
<h3 id="heading-easy-way-to-remember">Easy way to remember</h3>
<ul>
<li><p>Tag is like a box</p>
</li>
<li><p>Element is box + stuff inside it</p>
</li>
</ul>
<hr />
<h2 id="heading-self-closing-void-elements">Self-Closing (Void) Elements</h2>
<p>Some HTML elements do not have closing tag.</p>
<p>These are called <strong>self-closing elements</strong>.</p>
<p>Examples:</p>
<pre><code class="lang-plaintext">&lt;br&gt;
&lt;img src="image.jpg"&gt;
&lt;hr&gt;
</code></pre>
<p>Why no closing tag?<br />Because these elements <strong>do not have content inside</strong>.</p>
<ul>
<li><p><code>&lt;br&gt;</code> breaks the line</p>
</li>
<li><p><code>&lt;img&gt;</code> shows image</p>
</li>
<li><p><code>&lt;hr&gt;</code> shows a line</p>
</li>
</ul>
<hr />
<h2 id="heading-block-level-vs-inline-elements">Block-Level vs Inline Elements</h2>
<p>This topic is very important for layout.</p>
<h3 id="heading-block-level-elements">Block-Level Elements</h3>
<ul>
<li><p>Always start from new line</p>
</li>
<li><p>Take full width of screen</p>
</li>
</ul>
<p>Examples:</p>
<pre><code class="lang-plaintext">&lt;div&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;h1&gt;&lt;/h1&gt;
</code></pre>
<p>If you write two <code>&lt;p&gt;</code> tags, they will come <strong>one below another</strong>.</p>
<hr />
<h3 id="heading-inline-elements">Inline Elements</h3>
<ul>
<li><p>Stay in same line</p>
</li>
<li><p>Take only needed space</p>
</li>
</ul>
<p>Examples:</p>
<pre><code class="lang-plaintext">&lt;span&gt;&lt;/span&gt;
&lt;a&gt;&lt;/a&gt;
&lt;strong&gt;&lt;/strong&gt;
</code></pre>
<p>Inline elements do not break the line.</p>
<hr />
<h2 id="heading-commonly-used-html-tags">Commonly Used HTML Tags</h2>
<p>As beginner, you should focus on these tags first:</p>
<pre><code class="lang-plaintext">&lt;h1&gt; to &lt;h6&gt;   → headings
&lt;p&gt;            → paragraph
&lt;div&gt;          → block container
&lt;span&gt;         → inline container
&lt;img&gt;          → image
&lt;a&gt;            → link
&lt;br&gt;           → line break
</code></pre>
<p>No need to mug up all tags.<br />Practice slowly and daily.</p>
<hr />
<h2 id="heading-difference-between-tag-and-element">Difference Between Tag and Element</h2>
<p>Many people mix this, so very clear table:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Tag</td><td>Element</td></tr>
</thead>
<tbody>
<tr>
<td><code>&lt;p&gt;</code></td><td><code>&lt;p&gt;Hello&lt;/p&gt;</code></td></tr>
<tr>
<td>Only instruction</td><td>Complete structure</td></tr>
<tr>
<td>Part of code</td><td>Actual thing on page</td></tr>
</tbody>
</table>
</div><p>Remember this for <strong>interview and basics</strong>.</p>
<hr />
<h2 id="heading-inspect-html-in-browser-very-important">Inspect HTML in Browser (Very Important)</h2>
<p>One best habit for learners:</p>
<ul>
<li><p>Right click on any website</p>
</li>
<li><p>Click <strong>Inspect</strong></p>
</li>
<li><p>See the HTML code</p>
</li>
</ul>
<p>Slowly you will understand how real websites are made.</p>
<hr />
<h2 id="heading-diagram-ideas-for-blog">Diagram Ideas for Blog</h2>
<p>You can add diagrams like:</p>
<ul>
<li><p>HTML tag vs element breakdown</p>
</li>
<li><p>Block vs inline element layout</p>
</li>
</ul>
<p>Diagrams make learning more clear.</p>
<hr />
<h2 id="heading-final-words">Final Words</h2>
<p>HTML is simple if you think it as <strong>structure</strong>, not programming.<br />Once HTML is clear, CSS and JavaScript becomes much easy.</p>
<p>Practice daily, don’t rush.<br />HTML is the <strong>base of web development</strong>, so make it strong.</p>
]]></content:encoded></item><item><title><![CDATA[TCP Working: 3-Way Handshake & Reliable Communication]]></title><description><![CDATA[Introduction: What happens if data has no rules?
Think about this situation.
You send a message to your friend, but:

Some words reach late

Some words don’t reach at all

Some words come twice

And your friend never replies that they got the message...]]></description><link>https://tanmay-kushwaha.hashnode.dev/tcp-working-3-way-handshake-and-reliable-communication</link><guid isPermaLink="true">https://tanmay-kushwaha.hashnode.dev/tcp-working-3-way-handshake-and-reliable-communication</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[tcp/ip-model]]></category><category><![CDATA[TCP]]></category><category><![CDATA[3-way handshake]]></category><dc:creator><![CDATA[Tanmay Kushwaha]]></dc:creator><pubDate>Fri, 30 Jan 2026 09:49:28 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769766438480/d67be9d7-1edc-4544-889f-d91ddbe6824c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction-what-happens-if-data-has-no-rules">Introduction: What happens if data has no rules?</h2>
<p>Think about this situation.</p>
<p>You send a message to your friend, but:</p>
<ul>
<li><p>Some words reach late</p>
</li>
<li><p>Some words don’t reach at all</p>
</li>
<li><p>Some words come twice</p>
</li>
<li><p>And your friend never replies that they got the message</p>
</li>
</ul>
<p>Total confusion, right?</p>
<p>The internet would behave in the same way <strong>if there were no rules</strong>.</p>
<p>That’s why we have <strong>protocols</strong>. And one of the most important protocols on the internet is <strong>TCP</strong>.</p>
<hr />
<h2 id="heading-what-is-tcp-and-why-is-it-needed">What is TCP and why is it needed?</h2>
<p><strong>TCP (Transmission Control Protocol)</strong> is a set of rules that helps two devices talk to each other <strong>properly and safely</strong> over the internet.</p>
<p>Whenever you:</p>
<ul>
<li><p>Open a website</p>
</li>
<li><p>Log in to any app</p>
</li>
<li><p>Send data to a server</p>
</li>
</ul>
<p>TCP works in the background and makes sure that:</p>
<ul>
<li><p>Data reaches the right place</p>
</li>
<li><p>Data reaches in the right order</p>
</li>
<li><p>No data is missing in between</p>
</li>
</ul>
<p>That’s why many important services like <strong>HTTP, HTTPS, FTP, and Email</strong> use TCP.</p>
<hr />
<h2 id="heading-problems-tcp-is-designed-to-solve">Problems TCP is designed to solve</h2>
<p>The internet is not perfect. Many things can go wrong while sending data.</p>
<p>Some common problems are:</p>
<ul>
<li><p>❌ Data packets can get lost on the way</p>
</li>
<li><p>❌ Packets can arrive in the wrong order</p>
</li>
<li><p>❌ Same packet can arrive more than once</p>
</li>
<li><p>❌ Network speed can suddenly become slow or unstable</p>
</li>
</ul>
<p>TCP is designed to handle all these problems by using <strong>rules, tracking, and confirmation messages</strong>.</p>
<hr />
<h2 id="heading-what-is-the-tcp-3-way-handshake">What is the TCP 3-Way Handshake?</h2>
<p>Before sending actual data, TCP first creates a <strong>proper connection</strong> between client and server.</p>
<p>This process is called the <strong>TCP 3-Way Handshake</strong>.</p>
<p>You can understand this with a simple real-life example.</p>
<p>Imagine calling someone on the phone:</p>
<ol>
<li><p>📞 You: “Hello, kya mujhe sun sakte ho?”</p>
</li>
<li><p>📞 Other person: “ha, mujhe sunayi de raha. tumhe meri awaz aa rahi hai?”</p>
</li>
<li><p>📞 You: “ha, mai bhi tumhe sun skta hu.”</p>
</li>
</ol>
<p>Only after this confirmation, the real conversation starts.</p>
<p>TCP works in the same way.</p>
<hr />
<h2 id="heading-step-by-step-working-of-syn-syn-ack-and-ack">Step-by-step working of SYN, SYN-ACK, and ACK</h2>
<p>Let’s understand all three steps one by one, in easy words.</p>
<h3 id="heading-1-syn-synchronize">1️⃣ SYN (Synchronize)</h3>
<ul>
<li><p>The client wants to start a connection</p>
</li>
<li><p>It sends a <strong>SYN</strong> message to the server</p>
</li>
<li><p>Along with that, it sends a starting <strong>sequence number</strong></p>
</li>
</ul>
<p>Simple meaning:<br />👉 “I want to connect, and this is where my data counting will start.”</p>
<hr />
<h3 id="heading-2-syn-ack-synchronize-acknowledge">2️⃣ SYN-ACK (Synchronize + Acknowledge)</h3>
<ul>
<li><p>Server receives the SYN message</p>
</li>
<li><p>Server replies with <strong>SYN-ACK</strong></p>
</li>
<li><p>Server sends:</p>
<ul>
<li><p>Its own sequence number</p>
</li>
<li><p>Confirmation of the client’s sequence number</p>
</li>
</ul>
</li>
</ul>
<p>Simple meaning:<br />👉 “I got your request and I’m ready from my side too.”</p>
<hr />
<h3 id="heading-3-ack-acknowledge">3️⃣ ACK (Acknowledge)</h3>
<ul>
<li><p>Client receives the server response</p>
</li>
<li><p>Client sends an <strong>ACK</strong> message back</p>
</li>
</ul>
<p>Simple meaning:<br />👉 “I got your reply. Connection is ready now.”</p>
<p>After this step, the TCP connection is <strong>successfully established</strong>.</p>
<hr />
<h2 id="heading-how-data-transfer-works-in-tcp">How data transfer works in TCP</h2>
<p>Once the connection is ready, actual data transfer starts.</p>
<p>Important points to understand:</p>
<ul>
<li><p>Data is divided into <strong>small pieces called packets</strong></p>
</li>
<li><p>Each packet gets a <strong>sequence number</strong></p>
</li>
<li><p>Receiver sends <strong>ACK</strong> after receiving packets</p>
</li>
</ul>
<p>Example:</p>
<ul>
<li><p>Packet 1 → Sequence number 1</p>
</li>
<li><p>Packet 2 → Sequence number 2</p>
</li>
<li><p>Packet 3 → Sequence number 3</p>
</li>
</ul>
<p>If packet 2 does not reach, the receiver will wait and ask for it again.</p>
<hr />
<h2 id="heading-how-tcp-ensures-reliability-order-and-correctness">How TCP ensures reliability, order, and correctness</h2>
<p>TCP uses many techniques to make communication reliable.</p>
<h3 id="heading-sequence-numbers">✅ Sequence Numbers</h3>
<ul>
<li><p>Every packet has a number</p>
</li>
<li><p>Helps arrange packets in the correct order</p>
</li>
</ul>
<h3 id="heading-acknowledgements-acks">✅ Acknowledgements (ACKs)</h3>
<ul>
<li><p>Receiver confirms which packets are received</p>
</li>
<li><p>Sender knows what is delivered successfully</p>
</li>
</ul>
<h3 id="heading-retransmission">✅ Retransmission</h3>
<ul>
<li><p>If ACK is not received within time</p>
</li>
<li><p>TCP resends the missing packet</p>
</li>
</ul>
<h3 id="heading-flow-control">✅ Flow Control</h3>
<ul>
<li><p>Controls how fast data is sent</p>
</li>
<li><p>Prevents receiver from getting overloaded</p>
</li>
</ul>
<h3 id="heading-error-checking">✅ Error Checking</h3>
<ul>
<li><p>Uses checksum method</p>
</li>
<li><p>Detects corrupted data</p>
</li>
</ul>
<p>Because of all this, TCP is <strong>very reliable</strong>, but slightly slower compared to other protocols.</p>
<hr />
<h2 id="heading-how-tcp-handles-packet-loss">How TCP handles packet loss</h2>
<p>If any packet is lost during transmission:</p>
<ol>
<li><p>Receiver notices a missing sequence number</p>
</li>
<li><p>ACK is not sent for that packet</p>
</li>
<li><p>Sender waits for a fixed time</p>
</li>
<li><p>Sender retransmits the missing packet</p>
</li>
</ol>
<p>This process continues until the data is received correctly.</p>
<hr />
<h2 id="heading-how-a-tcp-connection-is-closed">How a TCP connection is closed</h2>
<p>Just like starting a connection, closing it also follows proper steps.</p>
<p>TCP uses <strong>FIN</strong> and <strong>ACK</strong> messages to close the connection safely.</p>
<h3 id="heading-connection-closing-steps">Connection closing steps:</h3>
<ol>
<li><p>Client sends <strong>FIN</strong> (I have finished sending data)</p>
</li>
<li><p>Server replies with <strong>ACK</strong></p>
</li>
<li><p>Server sends its own <strong>FIN</strong></p>
</li>
<li><p>Client sends final <strong>ACK</strong></p>
</li>
</ol>
<p>After this, the connection is fully closed without losing any data.</p>
<hr />
<h2 id="heading-tcp-connection-lifecycle">TCP connection lifecycle</h2>
<p>The full life of a TCP connection looks like this:</p>
<p><strong>Connection Establish → Data Transfer → Connection Close</strong></p>
<ol>
<li><p>3-Way Handshake</p>
</li>
<li><p>Reliable data transfer</p>
</li>
<li><p>Safe and proper connection termination</p>
</li>
</ol>
<hr />
<h2 id="heading-final-thoughts">Final Thoughts</h2>
<p>TCP works silently behind the scenes, but it plays a <strong>very important role</strong> in the internet.</p>
<p>It makes sure that:</p>
<ul>
<li><p>Data reaches correctly</p>
</li>
<li><p>Data reaches in order</p>
</li>
<li><p>Communication remains reliable</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[How A Browser Works: A Beginner-friendly Guide To Browser Internals]]></title><description><![CDATA[What happens after I type a URL and press Enter?
This is a very common doubt for beginners.
You open your browser, type www.google.com, and press Enter. Within seconds, the website opens on your screen.
But have you ever thought — what actually happe...]]></description><link>https://tanmay-kushwaha.hashnode.dev/how-a-browser-works-a-beginner-friendly-guide-to-browser-internals</link><guid isPermaLink="true">https://tanmay-kushwaha.hashnode.dev/how-a-browser-works-a-beginner-friendly-guide-to-browser-internals</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[Browsers]]></category><category><![CDATA[browser]]></category><dc:creator><![CDATA[Tanmay Kushwaha]]></dc:creator><pubDate>Thu, 29 Jan 2026 21:36:18 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769722409300/be953294-989a-4e9b-a43b-0c544836fe48.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-happens-after-i-type-a-url-and-press-enter">What happens after I type a URL and press Enter?</h2>
<p>This is a very common doubt for beginners.</p>
<p>You open your browser, type <a target="_blank" href="http://www.google.com"><code>www.google.com</code></a>, and press <strong>Enter</strong>. Within seconds, the website opens on your screen.</p>
<p>But have you ever thought — <strong>what actually happens inside the browser?</strong></p>
<p>A browser does not magically show websites. It follows a clear step-by-step process in the background.</p>
<p>You can think of the browser like a <strong>team of people</strong>, where each person has one job. When everyone does their work properly, the website appears on your screen.</p>
<p>In this article, we will understand <strong>how a browser works internally</strong>, in very easy language.</p>
<hr />
<h2 id="heading-what-is-a-browser-not-just-it-opens-websites">What is a browser (not just “it opens websites”)?</h2>
<p>A browser is a <strong>software</strong> that helps us access the internet.</p>
<p>Its main jobs are:</p>
<ul>
<li><p>Talk to servers on the internet</p>
</li>
<li><p>Download website files like HTML, CSS, and JavaScript</p>
</li>
<li><p>Understand those files</p>
</li>
<li><p>Convert them into a webpage</p>
</li>
<li><p>Show that webpage on your screen</p>
</li>
</ul>
<p>So instead of saying:</p>
<blockquote>
<p>“Browser opens websites”</p>
</blockquote>
<p>It is better to say:</p>
<blockquote>
<p><strong>A browser downloads, understands, and displays websites for users.</strong></p>
</blockquote>
<hr />
<h2 id="heading-main-parts-of-a-browser-high-level-idea">Main parts of a browser (high-level idea)</h2>
<p>A browser is not a single thing. It is made up of many small parts. Each part has its own job. When all these parts work together, a website loads properly on your screen.</p>
<p>At a high level, these are the main parts of a browser:</p>
<ol>
<li><p>User Interface</p>
</li>
<li><p>Browser Engine</p>
</li>
<li><p>Rendering Engine</p>
</li>
<li><p>Networking</p>
</li>
<li><p>JavaScript Interpreter</p>
</li>
<li><p>UI Backend</p>
</li>
<li><p>Disk / Storage APIs</p>
</li>
</ol>
<p>Don’t worry if these names feel confusing right now. Let’s understand them slowly, in simple words.</p>
<hr />
<h3 id="heading-1-user-interface">1. User Interface</h3>
<p>This is the part of the browser that we can see and use.</p>
<p>It includes things like:</p>
<ul>
<li><p>Address bar where we type the website name</p>
</li>
<li><p>Tabs</p>
</li>
<li><p>Back and Forward buttons</p>
</li>
<li><p>Refresh button</p>
</li>
<li><p>Bookmarks</p>
</li>
</ul>
<p>The user interface only helps us control the browser. It does not decide how the website content looks.</p>
<hr />
<h3 id="heading-2-browser-engine">2. Browser Engine</h3>
<p>The browser engine works like a <strong>manager</strong>.</p>
<p>Its job is to:</p>
<ul>
<li><p>Connect the user interface with the rendering engine</p>
</li>
<li><p>Decide what should happen and when</p>
</li>
<li><p>Control the overall working of the browser</p>
</li>
</ul>
<p>You can think of it as the part that keeps everything organised.</p>
<hr />
<h3 id="heading-3-rendering-engine">3. Rendering Engine</h3>
<p>The rendering engine is the part that actually <strong>shows the website</strong>.</p>
<p>It:</p>
<ul>
<li><p>Reads HTML and CSS</p>
</li>
<li><p>Understands the structure and styles</p>
</li>
<li><p>Converts code into visible content on the screen</p>
</li>
</ul>
<p>Without the rendering engine, you would never see a webpage.</p>
<hr />
<h3 id="heading-4-networking">4. Networking</h3>
<p>The networking part handles all internet communication.</p>
<p>It:</p>
<ul>
<li><p>Sends requests to website servers</p>
</li>
<li><p>Receives HTML, CSS, JavaScript, images, and other files</p>
</li>
<li><p>Manages HTTP and HTTPS connections</p>
</li>
</ul>
<p>In simple words, this part brings website data from the internet to your browser.</p>
<hr />
<h3 id="heading-5-javascript-interpreter">5. JavaScript Interpreter</h3>
<p>The JavaScript interpreter is responsible for running JavaScript code.</p>
<p>It:</p>
<ul>
<li><p>Executes JavaScript line by line</p>
</li>
<li><p>Handles clicks, form actions, and user events</p>
</li>
<li><p>Updates the webpage without reloading</p>
</li>
</ul>
<p>Whenever a website feels interactive, JavaScript is doing the work.</p>
<hr />
<h3 id="heading-6-ui-backend">6. UI Backend</h3>
<p>The UI backend helps the browser draw basic interface elements.</p>
<p>It:</p>
<ul>
<li><p>Draws buttons, input boxes, dropdowns</p>
</li>
<li><p>Uses the operating system’s UI features</p>
</li>
</ul>
<p>Because of this, browsers work smoothly on Windows, macOS, and Linux.</p>
<hr />
<h3 id="heading-7-disk-storage-apis">7. Disk / Storage APIs</h3>
<p>This part is used to store data on the user’s system.</p>
<p>It manages:</p>
<ul>
<li><p>Cache</p>
</li>
<li><p>Cookies</p>
</li>
<li><p>localStorage</p>
</li>
<li><p>sessionStorage</p>
</li>
</ul>
<p>This helps websites remember user information and load faster next time.</p>
<p>Right now, you don’t need to remember all these parts. Just understand that a browser is a <strong>collection of components</strong>, each doing its own small job.</p>
<hr />
<h2 id="heading-user-interface-ui">User Interface (UI)</h2>
<p>The User Interface is the part of the browser that <strong>we can see and use</strong>.</p>
<p>It includes:</p>
<ul>
<li><p>Address bar (URL bar)</p>
</li>
<li><p>Back and Forward buttons</p>
</li>
<li><p>Refresh button</p>
</li>
<li><p>Tabs</p>
</li>
<li><p>Bookmarks bar</p>
</li>
</ul>
<p>The UI does not decide how a website looks.</p>
<p>Its job is only to help users:</p>
<ul>
<li><p>Enter website addresses</p>
</li>
<li><p>Move between pages</p>
</li>
<li><p>Open and manage tabs</p>
</li>
</ul>
<hr />
<h2 id="heading-browser-engine-vs-rendering-engine-easy-difference">Browser Engine vs Rendering Engine (easy difference)</h2>
<p>Many beginners get confused between these two, so let’s keep it very simple.</p>
<h3 id="heading-browser-engine">Browser Engine</h3>
<ul>
<li><p>Works like a <strong>manager</strong></p>
</li>
<li><p>Controls the overall flow</p>
</li>
<li><p>Connects the User Interface with other browser parts</p>
</li>
</ul>
<h3 id="heading-rendering-engine">Rendering Engine</h3>
<ul>
<li><p>Works like an <strong>artist</strong> 🎨</p>
</li>
<li><p>Takes HTML and CSS</p>
</li>
<li><p>Converts them into a visible webpage</p>
</li>
</ul>
<p>Some engine names (just for knowledge):</p>
<ul>
<li><p>Chrome uses <strong>Blink</strong></p>
</li>
<li><p>Firefox uses <strong>Gecko</strong></p>
</li>
</ul>
<hr />
<h2 id="heading-networking-how-the-browser-gets-website-files">Networking: how the browser gets website files</h2>
<p>When you press <strong>Enter</strong> after typing a URL:</p>
<ol>
<li><p>Browser asks DNS: “Where is this website located?”</p>
</li>
<li><p>DNS gives the server’s IP address</p>
</li>
<li><p>Browser sends an HTTP or HTTPS request</p>
</li>
<li><p>Server sends back files like:</p>
<ul>
<li><p>HTML</p>
</li>
<li><p>CSS</p>
</li>
<li><p>JavaScript</p>
</li>
<li><p>Images</p>
</li>
</ul>
</li>
</ol>
<p>All this communication is handled by the <strong>Networking</strong> part of the browser.</p>
<hr />
<h2 id="heading-html-parsing-and-dom-creation">HTML parsing and DOM creation</h2>
<p>After downloading the HTML file, the browser starts reading it.</p>
<p>But the browser does not directly understand HTML text.</p>
<p>So it <strong>parses</strong> the HTML.</p>
<h3 id="heading-what-does-parsing-mean">What does parsing mean?</h3>
<p>Parsing means:</p>
<blockquote>
<p>Breaking something into smaller parts so it can be understood properly.</p>
</blockquote>
<h3 id="heading-dom-document-object-model">DOM (Document Object Model)</h3>
<ul>
<li><p>Browser reads HTML line by line</p>
</li>
<li><p>Converts it into a tree-like structure</p>
</li>
<li><p>This structure is called the <strong>DOM</strong></p>
</li>
</ul>
<p>Example:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>Hello<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>World<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
</code></pre>
<p>This becomes a tree like:</p>
<pre><code class="lang-plaintext">body
 ├─ h1
 └─ p
</code></pre>
<p>You can think of the DOM like a <strong>family tree</strong>, where each element is connected.</p>
<hr />
<h2 id="heading-css-parsing-and-cssom-creation">CSS parsing and CSSOM creation</h2>
<p>CSS is also processed separately.</p>
<p>The browser:</p>
<ul>
<li><p>Reads CSS rules</p>
</li>
<li><p>Understands selectors and styles</p>
</li>
<li><p>Builds another tree called <strong>CSSOM</strong></p>
</li>
</ul>
<p>CSSOM decides:</p>
<ul>
<li><p>Which element gets which style</p>
</li>
<li><p>What color to use</p>
</li>
<li><p>What font size and layout to apply</p>
</li>
</ul>
<p>In short:</p>
<ul>
<li><p>DOM = structure of the page</p>
</li>
<li><p>CSSOM = styling of the page</p>
</li>
</ul>
<hr />
<h2 id="heading-how-dom-and-cssom-work-together">How DOM and CSSOM work together</h2>
<p>Now the browser combines:</p>
<ul>
<li><p>DOM (page structure)</p>
</li>
<li><p>CSSOM (styling rules)</p>
</li>
</ul>
<p>Together, they form the <strong>Render Tree</strong>.</p>
<p>The Render Tree:</p>
<ul>
<li><p>Contains only visible elements</p>
</li>
<li><p>Has style information for each element</p>
</li>
</ul>
<p>Elements with <code>display: none</code> are not included here.</p>
<hr />
<h2 id="heading-layout-reflow-painting-and-display">Layout (reflow), painting, and display</h2>
<p>Once the Render Tree is ready, the browser starts drawing the page.</p>
<h3 id="heading-1-layout-reflow">1. Layout (Reflow)</h3>
<ul>
<li><p>Calculates size and position of every element</p>
</li>
<li><p>Decides where each box will appear on the screen</p>
</li>
</ul>
<h3 id="heading-2-painting">2. Painting</h3>
<ul>
<li><p>Applies colors</p>
</li>
<li><p>Draws text, borders, images</p>
</li>
</ul>
<h3 id="heading-3-display">3. Display</h3>
<ul>
<li>Final output appears as pixels on your screen 🖥️</li>
</ul>
<p>This whole process happens very fast.</p>
<hr />
<h2 id="heading-simple-idea-of-parsing-math-example">Simple idea of parsing (math example)</h2>
<p>Let’s take a small math example:</p>
<pre><code class="lang-plaintext">2 + 3 * 4
</code></pre>
<p>Your brain understands that:</p>
<ul>
<li><p><code>3 * 4</code> should be solved first</p>
</li>
<li><p>Then <code>2 + result</code></p>
</li>
</ul>
<p>This creates a logical structure in your mind.</p>
<p>HTML parsing works in a similar way — the browser understands meaning, not just text.</p>
<hr />
<h2 id="heading-complete-flow-from-url-to-screen">Complete flow: from URL to screen</h2>
<p>Here is the full journey:</p>
<ol>
<li><p>User types a URL</p>
</li>
<li><p>Browser sends a request</p>
</li>
<li><p>Server sends HTML, CSS, and JS</p>
</li>
<li><p>HTML is converted into DOM</p>
</li>
<li><p>CSS is converted into CSSOM</p>
</li>
<li><p>DOM and CSSOM create Render Tree</p>
</li>
<li><p>Layout (reflow) happens</p>
</li>
<li><p>Painting happens</p>
</li>
<li><p>Pixels appear on the screen</p>
</li>
</ol>
<hr />
<h2 id="heading-final-thoughts">Final thoughts</h2>
<p>Understanding how a browser works helps you become a <strong>better web developer</strong>.</p>
<p>It helps you:</p>
<ul>
<li><p>Write better HTML and CSS</p>
</li>
<li><p>Understand performance issues</p>
</li>
<li><p>Fix layout and rendering problems</p>
</li>
</ul>
<p>This topic is not about memorising terms.</p>
<p>It is about understanding <strong>what happens behind the scenes</strong>.</p>
<p>Keep learning and keep building 🚀</p>
]]></content:encoded></item><item><title><![CDATA[How Git Works Internally: Understanding the .git Folder, Objects, and Hashing]]></title><description><![CDATA[Most of us use Git daily.We type commands like git add, git commit, git push and our work gets saved.
But honestly speaking, many developers don’t know what Git actually does inside.
Git looks confusing only because we try to memorize commands instea...]]></description><link>https://tanmay-kushwaha.hashnode.dev/how-git-works-internally-understanding-the-git-folder-objects-and-hashing</link><guid isPermaLink="true">https://tanmay-kushwaha.hashnode.dev/how-git-works-internally-understanding-the-git-folder-objects-and-hashing</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[Git]]></category><dc:creator><![CDATA[Tanmay Kushwaha]]></dc:creator><pubDate>Thu, 29 Jan 2026 21:07:59 GMT</pubDate><content:encoded><![CDATA[<p>Most of us use Git daily.<br />We type commands like <code>git add</code>, <code>git commit</code>, <code>git push</code> and our work gets saved.</p>
<p>But honestly speaking, many developers don’t know <strong>what Git actually does inside</strong>.</p>
<p>Git looks confusing only because we try to <strong>memorize commands</strong> instead of understanding how it works.</p>
<hr />
<h2 id="heading-1-what-is-the-git-folder-and-why-it-exists">1️⃣ What Is the .git Folder and Why It Exists?</h2>
<p>When you run this command:</p>
<pre><code class="lang-plaintext">git init
</code></pre>
<p>Git creates a hidden folder called <code>.git</code>.</p>
<p>This folder is <strong>the brain of Git</strong>.</p>
<p>Important thing to understand:</p>
<ul>
<li><p>Your project files are outside</p>
</li>
<li><p>Git’s memory is inside <code>.git</code></p>
</li>
</ul>
<p>If you delete the <code>.git</code> folder:</p>
<ul>
<li><p>Your files will still be there</p>
</li>
<li><p>But Git history, commits, branches — everything is gone</p>
</li>
</ul>
<p>So you can say:</p>
<blockquote>
<p><strong>Files are your project<br />.git folder is Git</strong></p>
</blockquote>
<hr />
<h2 id="heading-2-inside-the-git-folder-easy-understanding">2️⃣ Inside the .git Folder (Easy Understanding)</h2>
<p>You don’t need to remember everything here, just the idea.</p>
<pre><code class="lang-plaintext">.git/
├── objects/
├── refs/
├── HEAD
├── index
</code></pre>
<h3 id="heading-main-things">Main things:</h3>
<ul>
<li><p><strong>objects/</strong> → Git stores all data here</p>
</li>
<li><p><strong>refs/</strong> → Branch pointers</p>
</li>
<li><p><strong>HEAD</strong> → Shows where you are currently</p>
</li>
<li><p><strong>index</strong> → Staging area</p>
</li>
</ul>
<p>Think of <code>.git</code> like Git’s <strong>store room + register</strong>.</p>
<hr />
<h2 id="heading-3-git-objects-blob-tree-commit-very-easy">3️⃣ Git Objects: Blob, Tree, Commit (Very Easy)</h2>
<p>Git stores everything as <strong>objects</strong>.<br />There are only <strong>three important objects</strong>.</p>
<hr />
<h3 id="heading-blob-file-data">🟦 Blob – File Data</h3>
<ul>
<li><p>Blob stores <strong>file content only</strong></p>
</li>
<li><p>It does NOT store file name or folder name</p>
</li>
</ul>
<p>Example:</p>
<pre><code class="lang-plaintext">Hello World
</code></pre>
<p>If two files have the same content, Git stores only <strong>one blob</strong>.</p>
<p>That’s why Git does not waste space.</p>
<hr />
<h3 id="heading-tree-folder-structure">🟨 Tree – Folder Structure</h3>
<ul>
<li><p>Tree represents a <strong>folder</strong></p>
</li>
<li><p>It connects:</p>
<ul>
<li><p>file names → blobs</p>
</li>
<li><p>folder names → other trees</p>
</li>
</ul>
</li>
</ul>
<p>Example:</p>
<pre><code class="lang-plaintext">project/
 ├── index.html
 └── app.js
</code></pre>
<p>Tree says:</p>
<ul>
<li><p><code>index.html</code> → this blob</p>
</li>
<li><p><code>app.js</code> → that blob</p>
</li>
</ul>
<p>So remember:</p>
<blockquote>
<p><strong>Tree = folder + structure</strong></p>
</blockquote>
<hr />
<h3 id="heading-commit-snapshot">🟥 Commit – Snapshot</h3>
<p>A commit contains:</p>
<ul>
<li><p>Reference to a tree</p>
</li>
<li><p>Reference to previous commit</p>
</li>
<li><p>Author name, time, message</p>
</li>
</ul>
<p>Important point:</p>
<blockquote>
<p><strong>A commit is a full snapshot, not just changes</strong></p>
</blockquote>
<p>This is where many people get confused.</p>
<hr />
<h2 id="heading-4-how-commit-tree-and-blob-are-connected">4️⃣ How Commit, Tree, and Blob Are Connected</h2>
<p>Think in this simple order:</p>
<pre><code class="lang-plaintext">Commit
  ↓
 Tree
  ↓
Blobs
</code></pre>
<p>Or like this:</p>
<pre><code class="lang-plaintext">Commit
 └── Tree (main folder)
      ├── Blob (file)
      ├── Blob (file)
      └── Tree (subfolder)
           └── Blob (file)
</code></pre>
<p>So:</p>
<ul>
<li><p>Commit points to a tree</p>
</li>
<li><p>Tree points to blobs</p>
</li>
</ul>
<hr />
<h2 id="heading-5-how-git-tracks-changes-simple-truth">5️⃣ How Git Tracks Changes (Simple Truth)</h2>
<p>Git does NOT track changes line by line.</p>
<p>Git works like this:</p>
<ul>
<li><p>Takes a snapshot of files</p>
</li>
<li><p>If file did not change → reuse old blob</p>
</li>
<li><p>If file changed → create new blob</p>
</li>
</ul>
<p>This makes Git:</p>
<ul>
<li><p>Fast</p>
</li>
<li><p>Reliable</p>
</li>
<li><p>Memory efficient</p>
</li>
</ul>
<hr />
<h2 id="heading-6-what-happens-inside-git-add">6️⃣ What Happens Inside <code>git add</code></h2>
<p>When you run:</p>
<pre><code class="lang-plaintext">git add file.txt
</code></pre>
<p>Internally Git does this:</p>
<ol>
<li><p>Reads file content</p>
</li>
<li><p>Creates a blob</p>
</li>
<li><p>Saves blob in <code>.git/objects</code></p>
</li>
<li><p>Updates <strong>index (staging area)</strong></p>
</li>
</ol>
<p>Important:</p>
<ul>
<li><p><code>git add</code> does NOT create a commit</p>
</li>
<li><p>It only prepares data</p>
</li>
</ul>
<p>Staging area means:</p>
<blockquote>
<p>“I want to save these changes next”</p>
</blockquote>
<hr />
<h2 id="heading-7-what-happens-inside-git-commit">7️⃣ What Happens Inside <code>git commit</code></h2>
<p>When you run:</p>
<pre><code class="lang-plaintext">git commit -m "message"
</code></pre>
<p>Git does:</p>
<ol>
<li><p>Reads staging area</p>
</li>
<li><p>Creates a tree</p>
</li>
<li><p>Creates a commit object</p>
</li>
<li><p>Updates branch</p>
</li>
<li><p>Moves HEAD to new commit</p>
</li>
</ol>
<p>Now your work is safely saved.</p>
<hr />
<h2 id="heading-8-how-git-uses-hashes-for-safety">8️⃣ How Git Uses Hashes for Safety</h2>
<p>Git uses <strong>hash values</strong> (SHA-1 / SHA-256).</p>
<p>Example:</p>
<pre><code class="lang-plaintext">e83c5163316f89bfbde7d9ab23ca2e25604af290
</code></pre>
<p>Hash is created from:</p>
<ul>
<li><p>Object content</p>
</li>
<li><p>Object type</p>
</li>
</ul>
<p>Why this is important:</p>
<ul>
<li><p>If content changes → hash changes</p>
</li>
<li><p>Duplicate data is avoided</p>
</li>
<li><p>Data corruption is detected</p>
</li>
<li><p>History cannot be changed easily</p>
</li>
</ul>
<p>This is why Git is very trustworthy.  </p>
<h1 id="heading-conclusion">Conclusion</h1>
<p>Git feels hard only until we understand how it works inside.<br />Once the basics are clear, everything starts making sense.</p>
<p>Now you understand:</p>
<ul>
<li><p>Why the <strong>.git folder</strong> is important</p>
</li>
<li><p>How <strong>blob, tree, and commit</strong> work</p>
</li>
<li><p>What really happens during <code>git add</code> and <code>git commit</code></p>
</li>
<li><p>How Git uses <strong>hashes</strong> to keep data safe</p>
</li>
</ul>
<p>If you want to learn or revise <strong>all basic Git commands</strong>, you can read my simple guide here:</p>
<h2 id="heading-git-for-beginners-simple-guide">[Git for Beginners: Simple Guide</h2>
<p>](https://tanmay-kushwaha.hashnode.dev/git-for-beginners-simple-guide)</p>
]]></content:encoded></item><item><title><![CDATA[Why Version Control Exists: The Pendrive Problem]]></title><description><![CDATA[Introduction
Let’s take a simple situation.
Three friends are working on a college project. One friend writes the main code, the second friend adds new features, and the third friend fixes bugs. To share the code, they use a pendrive.
One day, Friend...]]></description><link>https://tanmay-kushwaha.hashnode.dev/why-version-control-exists-the-pendrive-problem</link><guid isPermaLink="true">https://tanmay-kushwaha.hashnode.dev/why-version-control-exists-the-pendrive-problem</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[Git]]></category><category><![CDATA[PendriveProblem]]></category><dc:creator><![CDATA[Tanmay Kushwaha]]></dc:creator><pubDate>Wed, 28 Jan 2026 23:02:19 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769641016540/cabc1ab6-9cfd-4b2e-9971-ea87796239c5.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>Let’s take a simple situation.</p>
<p>Three friends are working on a college project. One friend writes the main code, the second friend adds new features, and the third friend fixes bugs. To share the code, they use a <strong>pendrive</strong>.</p>
<p>One day, Friend A copies his code to the pendrive. Next day, Friend B updates the code and saves it. Then Friend C also makes changes and copies his version. Now the pendrive has only <strong>one version</strong> of the code.</p>
<p>Nobody knows:</p>
<ul>
<li><p>Whose changes are included.</p>
</li>
<li><p>Whose work got overwritten.</p>
</li>
<li><p>Which version was actually correct.<br />  File names like:</p>
</li>
<li><p><code>project_final</code></p>
</li>
<li><p><code>project_final_v2</code></p>
</li>
<li><p><code>project_latest</code></p>
</li>
<li><p><code>project_latest_final</code></p>
</li>
</ul>
<p>And still… project doesn’t work.</p>
<p>This confusion is <strong>the main reason why version control exists</strong>.</p>
<p>Before Git and GitHub, developers used pendrives, emails, and folders to manage code. At that time, it felt normal. But slowly, problems started appearing—especially when more people worked together.</p>
<p>Let’s understand this problem properly.</p>
<hr />
<h2 id="heading-life-before-version-control">Life Before Version Control</h2>
<h3 id="heading-how-developers-shared-code-earlier">How developers shared code earlier</h3>
<p>Before version control systems, developers used very simple methods:</p>
<ul>
<li><p>Sharing code using <strong>pendrives</strong></p>
</li>
<li><p>Sending ZIP files through <strong>email</strong></p>
</li>
<li><p>Keeping multiple folders as backup</p>
</li>
<li><p>Manually copying code from one file to another</p>
</li>
</ul>
<p>For small work, it was okay.<br />But for real projects, it became a big mess.</p>
<hr />
<h2 id="heading-the-pendrive-analogy-in-software-development">The Pendrive Analogy in Software Development</h2>
<p>Let’s take a simple example.</p>
<h3 id="heading-scenario">Scenario</h3>
<ul>
<li><p>You and your 3 friends are building a website</p>
</li>
<li><p>One person has the main code</p>
</li>
<li><p>Everyone uses the <strong>same pendrive</strong></p>
</li>
</ul>
<h3 id="heading-what-usually-happens">What usually happens</h3>
<ol>
<li><p>Person A adds login feature</p>
</li>
<li><p>Person B changes homepage design</p>
</li>
<li><p>Person C fixes some bugs</p>
</li>
<li><p>Everyone saves files with same name</p>
</li>
<li><p>Someone overwrites someone else’s work</p>
</li>
</ol>
<p>Now comes the biggest question:</p>
<p>👉 <strong>Which code is correct?</strong></p>
<p>Nobody knows.</p>
<hr />
<h2 id="heading-folder-names-every-developer-has-used">Folder Names Every Developer Has Used 😄</h2>
<p>To avoid confusion, developers created folders like:</p>
<ul>
<li><p><code>final</code></p>
</li>
<li><p><code>final_v2</code></p>
</li>
<li><p><code>final_v3</code></p>
</li>
<li><p><code>latest</code></p>
</li>
<li><p><code>latest_final</code></p>
</li>
<li><p><code>latest_final_do_not_touch</code></p>
</li>
</ul>
<p>But instead of solving the problem, this created <strong>more confusion</strong>.</p>
<p>There was:</p>
<ul>
<li><p>No clear history</p>
</li>
<li><p>No tracking</p>
</li>
<li><p>No safety</p>
</li>
</ul>
<hr />
<h2 id="heading-problems-faced-before-version-control-systems">Problems Faced Before Version Control Systems</h2>
<h3 id="heading-1-code-gets-overwritten">1. Code Gets Overwritten</h3>
<p>One small mistake and someone’s hard work is gone.</p>
<p>No backup.<br />No undo button.</p>
<hr />
<h3 id="heading-2-code-is-lost-forever">2. Code Is Lost Forever</h3>
<p>Pendrive lost ❌<br />Email deleted ❌<br />Laptop crashed ❌</p>
<p>All code finished. Zero recovery.</p>
<hr />
<h3 id="heading-3-no-history-of-changes">3. No History of Changes</h3>
<p>Simple questions had no answers:</p>
<ul>
<li><p>Who changed this code?</p>
</li>
<li><p>When did this bug come?</p>
</li>
<li><p>Which version was working earlier?</p>
</li>
</ul>
<p>Everything was guesswork.</p>
<hr />
<h3 id="heading-4-no-way-to-go-back">4. No Way to Go Back</h3>
<p>If today’s code has a bug:</p>
<ul>
<li><p>You can’t easily go back to yesterday’s code</p>
</li>
<li><p>You must manually fix everything</p>
</li>
</ul>
<p>This wasted a lot of time.</p>
<hr />
<h2 id="heading-why-this-did-not-work-for-teams">Why This Did Not Work for Teams</h2>
<p>Pendrives and emails work only when:</p>
<ul>
<li><p>One person is working</p>
</li>
<li><p>Project is very small</p>
</li>
</ul>
<p>But real software teams have:</p>
<ul>
<li><p>Many developers</p>
</li>
<li><p>Daily changes</p>
</li>
<li><p>Deadlines</p>
</li>
</ul>
<p>Without version control:</p>
<ul>
<li><p>Work becomes slow</p>
</li>
<li><p>Bugs increase</p>
</li>
<li><p>Team coordination fails</p>
</li>
</ul>
<p>That’s why developers needed a <strong>better system</strong>.</p>
<hr />
<h2 id="heading-this-is-where-version-control-came">This Is Where Version Control Came</h2>
<p>Version control systems like <strong>Git</strong> solved these problems.</p>
<p>They give:</p>
<ul>
<li><p>Full history of code</p>
</li>
<li><p>Safe teamwork</p>
</li>
<li><p>No overwriting</p>
</li>
<li><p>Easy rollback</p>
</li>
<li><p>Clear record of changes</p>
</li>
</ul>
<p>Instead of sharing full files, developers now <strong>share only changes</strong>.</p>
<hr />
<h2 id="heading-pendrive-workflow-vs-version-control-workflow">Pendrive Workflow vs Version Control Workflow</h2>
<h3 id="heading-pendrive-based-workflow">Pendrive-Based Workflow ❌</h3>
<ul>
<li><p>One main copy</p>
</li>
<li><p>Manual sharing</p>
</li>
<li><p>High risk of loss</p>
</li>
<li><p>No history</p>
</li>
<li><p>No tracking</p>
</li>
</ul>
<h3 id="heading-version-control-workflow">Version Control Workflow ✅</h3>
<ul>
<li><p>Central repository</p>
</li>
<li><p>Everyone works separately</p>
</li>
<li><p>Changes are recorded</p>
</li>
<li><p>History is always safe</p>
</li>
<li><p>Easy teamwork</p>
</li>
</ul>
<hr />
<h2 id="heading-simple-real-life-example">Simple Real-Life Example</h2>
<p>Think of version control like <strong>Google Docs</strong>.</p>
<ul>
<li><p>Many people can work together</p>
</li>
<li><p>You can see who changed what</p>
</li>
<li><p>You can go back to old versions</p>
</li>
<li><p>Nothing is lost</p>
</li>
</ul>
<p>Git works the same way—but for <strong>code</strong>.</p>
<hr />
<h2 id="heading-why-version-control-is-must-today">Why Version Control Is Must Today</h2>
<p>In today’s software world:</p>
<ul>
<li><p>Teams work from different places</p>
</li>
<li><p>Code changes every day</p>
</li>
<li><p>Apps must never break</p>
</li>
</ul>
<p>Without version control:<br />👉 Modern software cannot be built.</p>
<p>That’s why:</p>
<ul>
<li><p>Every company uses Git</p>
</li>
<li><p>Every developer must learn it</p>
</li>
<li><p>Version control is compulsory</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Understanding Network Devices]]></title><description><![CDATA[Network Devices

Devices which helps us in communicating with other devices smoothly without any problem within a network.

It include various hardware tools – Routers, Switches, Modems & Hubs etc. play a very important role in connecting various dev...]]></description><link>https://tanmay-kushwaha.hashnode.dev/understanding-network-devices</link><guid isPermaLink="true">https://tanmay-kushwaha.hashnode.dev/understanding-network-devices</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[networking]]></category><category><![CDATA[modem]]></category><category><![CDATA[router]]></category><category><![CDATA[SWITCH]]></category><category><![CDATA[internet]]></category><category><![CDATA[firewall]]></category><dc:creator><![CDATA[Tanmay Kushwaha]]></dc:creator><pubDate>Wed, 28 Jan 2026 22:01:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769637410869/f2636c1d-f4c3-48a2-9b31-8ae2ec87e5d7.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-network-devices"><strong>Network Devices</strong></h1>
<ul>
<li><p>Devices which helps us in communicating with other devices smoothly without any problem within a network.</p>
</li>
<li><p>It include various hardware tools – Routers, Switches, Modems &amp; Hubs etc. play a very important role in connecting various devices such as computers, servers, mobiles &amp; other device allowing them to change information.</p>
</li>
<li><p>Each devices perform specific task like from routing data between networks to providing access to internet.</p>
</li>
</ul>
<h3 id="heading-many-people-use-internet-daily-but-dont-know-what-is-happening-behind-the-scenes">Many people use internet daily but don’t know what is happening behind the scenes.</h3>
<p>In reality, some <strong>hardware devices</strong> work together quietly to make everything possible.</p>
<p>Let’s understand this step by step, in very simple words.<br /><code>Internet →Modem → Router → Switch → Your Devices (Laptop, Mobile, Office Systems)</code>  </p>
<p>1️⃣ What is a Modem and How It Connects Internet?</p>
<h3 id="heading-simple-meaning">Simple Meaning</h3>
<p>A <strong>Modem</strong> is the device that <strong>connects your house or office to the internet company (ISP)</strong>.</p>
<p>Without modem, there is <strong>no internet at all</strong>.</p>
<h3 id="heading-what-modem-actually-does">What Modem Actually Does</h3>
<ul>
<li><p>Takes internet signal from ISP (fiber, cable, etc.)</p>
</li>
<li><p>Converts it into digital data your network can understand</p>
</li>
<li><p>Brings internet <strong>inside your building</strong></p>
</li>
</ul>
<h3 id="heading-easy-example">Easy Example</h3>
<p>👉 <strong>Post Office Gate</strong></p>
<p>Post office receives letters from outside cities and gives them to local area.<br />Same way, modem receives internet from outside world and gives it to your network.</p>
<h3 id="heading-important-point">Important Point</h3>
<ul>
<li><p>Modem does <strong>not</strong> manage devices</p>
</li>
<li><p>It only brings internet inside</p>
</li>
</ul>
<hr />
<h2 id="heading-2-what-is-a-router-and-what-does-it-do">2️⃣ What is a Router and What Does It Do?</h2>
<h3 id="heading-simple-meaning-1">Simple Meaning</h3>
<p>A <strong>Router</strong> decides <strong>which device should get which data</strong>.</p>
<p>If you have mobile, laptop, TV — router manages all of them.</p>
<h3 id="heading-routers-work">Router’s Work</h3>
<ul>
<li><p>Gives local IP address to devices</p>
</li>
<li><p>Knows which device asked for what</p>
</li>
<li><p>Sends correct data to correct device</p>
</li>
<li><p>Creates your <strong>local network</strong></p>
</li>
</ul>
<h3 id="heading-easy-example-1">Easy Example</h3>
<p>👉 <strong>Traffic Police</strong></p>
<p>Traffic police knows:</p>
<ul>
<li><p>Which road to send which vehicle</p>
</li>
<li><p>Prevents confusion and accidents</p>
</li>
</ul>
<p>Router works exactly like that.</p>
<h3 id="heading-router-vs-modem-very-important">Router vs Modem (Very Important)</h3>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Modem</td><td>Router</td></tr>
</thead>
<tbody>
<tr>
<td>Brings internet</td><td>Distributes internet</td></tr>
<tr>
<td>Talks to ISP</td><td>Talks to devices</td></tr>
<tr>
<td>One connection</td><td>Many connections</td></tr>
</tbody>
</table>
</div><hr />
<h2 id="heading-3-switch-vs-hub-how-devices-talk-inside-network">3️⃣ Switch vs Hub: How Devices Talk Inside Network</h2>
<h3 id="heading-what-is-a-hub-old-method">What is a Hub? (Old Method)</h3>
<p>A <strong>Hub</strong> sends data to <strong>all connected devices</strong>, even if they don’t need it.</p>
<h3 id="heading-hub-example">Hub Example</h3>
<p>👉 <strong>Someone shouting in a room</strong></p>
<p>Everyone hears it, even if message is not for them.</p>
<h3 id="heading-problems-with-hub">Problems with Hub</h3>
<ul>
<li><p>Very slow</p>
</li>
<li><p>Wastes data</p>
</li>
<li><p>Not secure</p>
</li>
</ul>
<hr />
<h3 id="heading-what-is-a-switch-used-today">What is a Switch? (Used Today)</h3>
<p>A <strong>Switch</strong> sends data <strong>only to the required device</strong>.</p>
<h3 id="heading-switch-example">Switch Example</h3>
<p>👉 <strong>Courier delivery boy</strong></p>
<p>Parcel is delivered to correct house, not to everyone.</p>
<h3 id="heading-why-switch-is-better">Why Switch is Better</h3>
<ul>
<li><p>Fast</p>
</li>
<li><p>Secure</p>
</li>
<li><p>Less data waste</p>
</li>
<li><p>Used everywhere today</p>
</li>
</ul>
<h3 id="heading-hub-vs-switch">Hub vs Switch</h3>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Hub</td><td>Switch</td></tr>
</thead>
<tbody>
<tr>
<td>Sends to all</td><td>Sends to specific device</td></tr>
<tr>
<td>Slow</td><td>Fast</td></tr>
<tr>
<td>No intelligence</td><td>Smart</td></tr>
</tbody>
</table>
</div><hr />
<h2 id="heading-4-what-is-a-firewall-and-why-it-is-important">4️⃣ What is a Firewall and Why It Is Important?</h2>
<h3 id="heading-simple-meaning-2">Simple Meaning</h3>
<p>A <strong>Firewall</strong> protects your network from <strong>wrong or dangerous traffic</strong>.</p>
<h3 id="heading-what-firewall-does">What Firewall Does</h3>
<ul>
<li><p>Blocks unwanted users</p>
</li>
<li><p>Allows safe traffic</p>
</li>
<li><p>Checks rules before allowing entry</p>
</li>
</ul>
<h3 id="heading-where-firewall-sits">Where Firewall Sits</h3>
<ul>
<li><p>Inside router</p>
</li>
<li><p>Or between router and servers</p>
</li>
</ul>
<h3 id="heading-easy-example-2">Easy Example</h3>
<p>👉 <strong>Security Guard at Gate</strong></p>
<ul>
<li><p>Checks ID</p>
</li>
<li><p>Allows only authorised people</p>
</li>
<li><p>Stops suspicious ones</p>
</li>
</ul>
<h3 id="heading-why-firewall-is-important-for-developers">Why Firewall is Important for Developers</h3>
<ul>
<li><p>Protects backend APIs</p>
</li>
<li><p>Stops hacking attempts</p>
</li>
<li><p>Keeps data safe</p>
</li>
</ul>
<hr />
<h2 id="heading-5-what-is-a-load-balancer-and-why-big-systems-need-it">5️⃣ What is a Load Balancer and Why Big Systems Need It?</h2>
<h3 id="heading-simple-meaning-3">Simple Meaning</h3>
<p>A <strong>Load Balancer</strong> divides traffic between <strong>multiple servers</strong>.</p>
<h3 id="heading-why-it-is-needed">Why It Is Needed</h3>
<p>If only one server handles everything:</p>
<ul>
<li>Server will slow down or crash</li>
</ul>
<p>Load balancer solves this.</p>
<h3 id="heading-easy-example-3">Easy Example</h3>
<p>👉 <strong>Toll Plaza</strong></p>
<p>Cars are sent to different counters so traffic keeps moving.</p>
<h3 id="heading-what-load-balancer-does">What Load Balancer Does</h3>
<ul>
<li><p>Shares user requests</p>
</li>
<li><p>Improves speed</p>
</li>
<li><p>Keeps system running even if one server fails</p>
</li>
</ul>
<h3 id="heading-used-in">Used In</h3>
<ul>
<li><p>Large websites</p>
</li>
<li><p>Cloud systems</p>
</li>
<li><p>Production backend</p>
</li>
</ul>
<hr />
<h2 id="heading-6-how-all-these-devices-work-together">6️⃣ How All These Devices Work Together</h2>
<p>When you open a website:</p>
<ol>
<li><p>Request leaves your device</p>
</li>
<li><p>Goes to <strong>Switch</strong></p>
</li>
<li><p>Reaches <strong>Router</strong></p>
</li>
<li><p>Router sends it to <strong>Modem</strong></p>
</li>
<li><p>Modem sends it to <strong>Internet</strong></p>
</li>
<li><p>Response comes back</p>
</li>
<li><p>Firewall checks safety</p>
</li>
<li><p>Load balancer sends request to a server</p>
</li>
<li><p>Server responds</p>
</li>
<li><p>You see the website</p>
</li>
</ol>
<p>All this happens in milliseconds.</p>
]]></content:encoded></item><item><title><![CDATA[Git for Beginners: Simple Guide]]></title><description><![CDATA[Introduction
Git is a version control system that developers use to manage their code. It helps you save your work, track changes, and work with others without confusion.
In very simple words:

Git keeps a record of your work so you can go back anyti...]]></description><link>https://tanmay-kushwaha.hashnode.dev/git-for-beginners-simple-guide</link><guid isPermaLink="true">https://tanmay-kushwaha.hashnode.dev/git-for-beginners-simple-guide</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[Git]]></category><category><![CDATA[version control]]></category><dc:creator><![CDATA[Tanmay Kushwaha]]></dc:creator><pubDate>Wed, 28 Jan 2026 21:11:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769634638787/759a6905-e02e-495a-b5fa-af0c83ebbad0.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>Git is a <strong>version control system</strong> that developers use to manage their code. It helps you save your work, track changes, and work with others without confusion.</p>
<p>In very simple words:</p>
<blockquote>
<p><strong>Git keeps a record of your work so you can go back anytime if something goes wrong.</strong></p>
</blockquote>
<p>You can think of Git like a smart notebook for your code that never forgets anything.</p>
<hr />
<h2 id="heading-what-is-git">What is Git?</h2>
<p>Git is a tool that helps you:</p>
<ul>
<li><p>Keep track of changes in files</p>
</li>
<li><p>Save your project history</p>
</li>
<li><p>Work with a team easily</p>
</li>
<li><p>Protect your code from getting lost</p>
</li>
</ul>
<p>Git was created by <strong>Linus Torvalds</strong>, the same person who created Linux.</p>
<h3 id="heading-why-git-is-called-distributed">Why Git is called Distributed</h3>
<p>In Git, every developer has a <strong>full copy</strong> of the project on their own computer. This means even if the internet is not working or the server is down, your code is still safe.</p>
<hr />
<h2 id="heading-why-git-is-used">Why Git is Used</h2>
<p>Git is widely used because:</p>
<p>✔ It tracks all changes clearly</p>
<p>✔ Many people can work together</p>
<p>✔ Old versions can be recovered</p>
<p>✔ New ideas can be tested safely</p>
<p>✔ It is free and trusted worldwide</p>
<hr />
<h2 id="heading-basic-git-terms">Basic Git Terms</h2>
<h3 id="heading-1-repository-repo">1. Repository (Repo)</h3>
<p>A repository is simply your <strong>project folder</strong> that Git is watching.</p>
<p>There are two types:</p>
<ul>
<li><p>Local repository (on your computer)</p>
</li>
<li><p>Remote repository (on GitHub or similar platforms)</p>
</li>
</ul>
<hr />
<h3 id="heading-2-commit">2. Commit</h3>
<p>A commit means <strong>saving your work</strong> in Git.</p>
<p>Every commit has a message so you know what was changed.</p>
<p>It is like pressing the save button and writing a small note.</p>
<hr />
<h3 id="heading-3-branch">3. Branch</h3>
<p>A branch is a <strong>separate line of work</strong>.</p>
<p>Default branch is called: <code>main</code></p>
<p>Branches are used to:</p>
<ul>
<li><p>Add new features</p>
</li>
<li><p>Fix bugs</p>
</li>
<li><p>Try something new without risk</p>
</li>
</ul>
<hr />
<h3 id="heading-4-head">4. HEAD</h3>
<p>HEAD tells Git:</p>
<blockquote>
<p>Which branch you are working on right now</p>
</blockquote>
<hr />
<h2 id="heading-git-folder-important-hidden-folder">.git Folder (Important Hidden Folder)</h2>
<p>When you run:</p>
<p>git init</p>
<p>Git creates a hidden folder called:</p>
<p>.git</p>
<p>This folder is the <strong>heart of Git</strong>.</p>
<h3 id="heading-what-does-git-contain">What does .git contain?</h3>
<ul>
<li><p>All commits</p>
</li>
<li><p>Branch information</p>
</li>
<li><p>Project settings</p>
</li>
<li><p>Complete history</p>
</li>
</ul>
<p>⚠️ <strong>Do not delete or edit this folder manually</strong>.</p>
<p>If you remove <code>.git</code>, Git will stop tracking your project.</p>
<h3 id="heading-simple-structure">Simple Structure</h3>
<p>.git</p>
<p>├── objects (stores commits)</p>
<p>├── refs (stores branches)</p>
<p>├── HEAD (current branch)</p>
<p>└── config (settings)</p>
<hr />
<h2 id="heading-git-working-areas">Git Working Areas</h2>
<p>Working Folder → Staging Area → Repository</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Area</td><td>Meaning</td></tr>
</thead>
<tbody>
<tr>
<td>Working Folder</td><td>Where you write or edit files</td></tr>
<tr>
<td>Staging Area</td><td>Files ready to be saved</td></tr>
<tr>
<td>Repository</td><td>Saved project history</td></tr>
</tbody>
</table>
</div><hr />
<h2 id="heading-common-git-commands">Common Git Commands</h2>
<h3 id="heading-1-git-init">1. git init</h3>
<p>This command starts Git in your project folder.</p>
<p>git init</p>
<p>After this, Git begins tracking your files.</p>
<hr />
<h3 id="heading-2-git-status">2. git status</h3>
<p>Shows the current state of your files.</p>
<p>git status</p>
<p>It tells you:</p>
<ul>
<li><p>Which files are new</p>
</li>
<li><p>Which files are changed</p>
</li>
<li><p>Which files are ready to commit</p>
</li>
</ul>
<hr />
<h3 id="heading-3-git-add">3. git add</h3>
<p>Moves files to the staging area.</p>
<p>git add file.txt</p>
<p>Add all files together:</p>
<p>git add .</p>
<hr />
<h3 id="heading-4-git-commit">4. git commit</h3>
<p>Saves your staged changes.</p>
<p>git commit -m "message"</p>
<p>Example:</p>
<p>git commit -m "Add login page"</p>
<hr />
<h3 id="heading-5-git-diff">5. git diff</h3>
<p>Shows the difference between old and new code.</p>
<p>git diff</p>
<p>This helps you check what exactly changed.</p>
<hr />
<h3 id="heading-6-git-log">6. git log</h3>
<p>Shows all previous commits.</p>
<p>git log</p>
<p>You can see who changed what and when.</p>
<hr />
<h3 id="heading-7-git-revert">7. git revert</h3>
<p>Used to undo a commit safely.</p>
<p>git revert commit_id</p>
<p>It creates a new commit that removes the changes.</p>
<hr />
<h3 id="heading-8-git-reset">8. git reset</h3>
<p>Moves your project back to an old commit.</p>
<p>git reset --hard commit_id</p>
<p>⚠️ This command can delete changes permanently, so use carefully.</p>
<hr />
<h2 id="heading-simple-git-workflow">Simple Git Workflow</h2>
<h3 id="heading-step-1-create-a-folder">Step 1: Create a folder</h3>
<p>mkdir project</p>
<p>cd project</p>
<h3 id="heading-step-2-start-git">Step 2: Start Git</h3>
<p>git init</p>
<h3 id="heading-step-3-create-a-file">Step 3: Create a file</h3>
<p>touch index.html</p>
<h3 id="heading-step-4-check-status">Step 4: Check status</h3>
<p>git status</p>
<h3 id="heading-step-5-add-file">Step 5: Add file</h3>
<p>git add index.html</p>
<h3 id="heading-step-6-save-your-work">Step 6: Save your work</h3>
<p>git commit -m "Add homepage"</p>
<h3 id="heading-step-7-check-history">Step 7: Check history</h3>
<p>git log</p>
]]></content:encoded></item><item><title><![CDATA[Beginner’s Guide to cURL: Talking to Servers from the Terminal]]></title><description><![CDATA[What is a Server?
It is a machine over the internet which gives the client a response according to whatever request he has made.

Example: When you search for Facebook on Google from your mobile or laptop, the request goes to the server and then it r...]]></description><link>https://tanmay-kushwaha.hashnode.dev/beginners-guide-to-curl-talking-to-servers-from-the-terminal</link><guid isPermaLink="true">https://tanmay-kushwaha.hashnode.dev/beginners-guide-to-curl-talking-to-servers-from-the-terminal</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[curl]]></category><dc:creator><![CDATA[Tanmay Kushwaha]]></dc:creator><pubDate>Wed, 28 Jan 2026 21:00:06 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769634288340/a3127440-2a6d-4d2a-8824-7bcd9e40acaa.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-what-is-a-server"><strong>What is a Server?</strong></h3>
<p>It is a machine over the internet which gives the client a response according to whatever request he has made.</p>
<ul>
<li><strong>Example:</strong> When you search for Facebook on Google from your mobile or laptop, the request goes to the server and then it responds according to the request.</li>
</ul>
<h3 id="heading-what-is-curl"><strong>What is cURL?</strong></h3>
<p><strong>cURL</strong> stands for <strong>Client URL</strong>. cURL is basically used when we send requests from the command line. It can be <strong>GET, POST, DELETE,</strong> or <strong>PUT</strong>.</p>
<ul>
<li><p><strong>IT Support:</strong> It supports many protocols like <strong>HTTP, HTTPS, FTP, SMTP, TELNET,</strong> etc. It supports almost all protocols.</p>
</li>
<li><p>It is used in the Terminal or Command Line.</p>
</li>
<li><p>It tells us what the server responds with.</p>
</li>
<li><p>It also helps in testing our server and API.</p>
</li>
</ul>
<hr />
<h2 id="heading-the-first-command"><strong>The First Command</strong></h2>
<p>To send a simple request and get a response from a server:</p>
<p><code>curl</code> <a target="_blank" href="http://www.google.com"><code>www.google.com</code></a></p>
<h2 id="heading-saving-a-response-to-a-file"><strong>Saving a Response to a File</strong></h2>
<p>If you want to save the response into a specific file, use the <code>-o</code> flag:</p>
<p><code>curl -o "google"</code> <a target="_blank" href="https://www.google.com"><code>https://www.google.com</code></a></p>
<ul>
<li><p>This command creates a file named "google".</p>
</li>
<li><p>To read the content stored in that file, use: <code>cat google</code>.</p>
</li>
</ul>
<h2 id="heading-checking-response-headers"><strong>Checking Response Headers</strong></h2>
<p>To check only the header of the response (the metadata), use the <code>-I</code> flag:</p>
<p><code>curl -I</code> <a target="_blank" href="https://www.google.com"><code>https://www.google.com</code></a></p>
<hr />
<h2 id="heading-other-requests-methods">Other Requests Methods</h2>
<p>If you want to use specific HTTP methods to interact with data, you can use the following commands:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Method</strong></td><td><strong>Purpose</strong></td><td><strong>Command Example</strong></td></tr>
</thead>
<tbody>
<tr>
<td><strong>GET</strong></td><td>Asking for data</td><td><code>curl --request GET</code> <a target="_blank" href="https://www.google.com"><code>https://www.google.com</code></a></td></tr>
<tr>
<td><strong>POST</strong></td><td>Sending data</td><td><code>curl -X POST</code> <a target="_blank" href="https://www.google.com"><code>https://www.google.com</code></a></td></tr>
<tr>
<td><strong>DELETE</strong></td><td>Deleting data</td><td><code>curl -X DELETE</code> <a target="_blank" href="https://www.google.com"><code>https://www.google.com</code></a></td></tr>
</tbody>
</table>
</div><h2 id="heading-additional-commands"><strong>Additional Commands</strong></h2>
<ul>
<li><p><strong>To check the header of the response:</strong> <code>curl -I</code> <a target="_blank" href="https://www.google.com"><code>https://www.google.com</code></a></p>
</li>
<li><p><strong>Help Menu:</strong> <code>curl --help</code> This is its own help menu that tells us some commands we can use with cURL.</p>
</li>
</ul>
<h2 id="heading-ia"> </h2>
<p><strong>Understanding the Response Status</strong></p>
<p>The server returns a status code to tell you the result of your request:</p>
<ul>
<li><p><strong>200:</strong> Everything is OK.</p>
</li>
<li><p><strong>201:</strong> Data is created.</p>
</li>
<li><p><strong>400:</strong> Bad request.</p>
</li>
<li><p><strong>401 / 403:</strong> Not allowed (Permission/Auth issues).</p>
</li>
<li><p><strong>404:</strong> Not found (Wrong URL).</p>
</li>
<li><p><strong>500:</strong> Server problem.</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Understanding DNS: Resolution and Records]]></title><description><![CDATA[Definition: Maps the Name of Site with an IP Address. Example*:* Like your friend name is mapped by his mobile number in Contact of your mobile. In simple words, it tells about should i talk to next.

Example: academy.networkchuck.com → IP Address: 1...]]></description><link>https://tanmay-kushwaha.hashnode.dev/understanding-dns-resolution-and-records</link><guid isPermaLink="true">https://tanmay-kushwaha.hashnode.dev/understanding-dns-resolution-and-records</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[dns]]></category><category><![CDATA[dns resolver]]></category><category><![CDATA[#DNS Resolution]]></category><dc:creator><![CDATA[Tanmay Kushwaha]]></dc:creator><pubDate>Wed, 28 Jan 2026 19:23:08 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769627858921/7abe1d75-a4bd-40fa-ad57-17e59c08d455.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Definition:</strong> Maps the <strong>Name of Site</strong> with an <strong>IP Address</strong>. Example*:* Like your friend name is mapped by his mobile number in Contact of your mobile. In simple words, it tells about should i talk to next.</p>
<ul>
<li><em>Example:</em> <code>academy.networkchuck.com</code> → IP Address: <code>142.250.190.46</code></li>
</ul>
<h3 id="heading-the-dns-resolution-process"><strong>The DNS Resolution Process</strong></h3>
<ol>
<li><p><strong>Browser Cache:</strong> The browser checks its own <strong>stub resolver (cache)</strong> to see if you have previously visited the site.</p>
</li>
<li><p><strong>Recursive Resolver:</strong> If not in the browser cache, it queries the <strong>Recursive DNS Server</strong> (e.g., Google DNS <code>8.8.8.8</code>). This server also checks its own cache first.</p>
</li>
<li><p><strong>Root Servers:</strong> If the recursive server doesn't have the answer, it goes to the <strong>Root Servers</strong>.</p>
<ul>
<li><p>There are <strong>13 Root Servers</strong> (with 1,865+ instances worldwide).</p>
</li>
<li><p>Root servers only know about <strong>Top Level Domains (TLD)</strong> like <code>.com</code>, <code>.net</code>, <code>.co</code>, etc.</p>
</li>
</ul>
</li>
<li><p><strong>TLD Nameservers:</strong> The Root server directs the query to the TLD server responsible for the specific extension (e.g., the <code>.com</code> server).</p>
</li>
<li><p><strong>Authoritative DNS:</strong> The TLD server provides the address for the <strong>Authoritative DNS</strong> (e.g., Hostinger, Cloudflare). These are responsible for the <strong>Second Level Domain</strong> (the actual website name).</p>
</li>
<li><p><strong>Final Response:</strong> The Authoritative DNS provides the final <strong>IP Address</strong>. This info travels back through the Recursive server to the <strong>Browser</strong>.</p>
<p> <strong>Common DNS Records</strong></p>
<p> | <strong>Record Type</strong> | <strong>Description</strong> |
 | --- | --- |
 | <strong>A Record</strong> | Maps <strong>Domain names</strong> to <strong>IPv4 Addresses</strong>. |
 | <strong>AAAA Record</strong> | Maps <strong>Domain names</strong> to <strong>IPv6 Addresses</strong>. |
 | <strong>NS Record</strong> | Tells which <strong>Authoritative DNS server</strong> is responsible for your second-level domain. |
 | <strong>MX Record</strong> | <strong>Mail Exchanger</strong>: Defines which mail server handles email for the domain. |
 | <strong>PTR Record</strong> | <strong>Reverse DNS</strong>: Maps an IP address back to a domain name (used for security). |
 | <strong>CNAME</strong> | <strong>Canonical Name</strong>: Points one domain name to another "real" or "target" domain name. |
 | <strong>TXT Record</strong> | Stores <strong>plain text</strong>. Used for domain ownership verification (e.g., Google Workspace, Microsoft 365). |</p>
<p> Additional Benefits of Txt Records:<br /> <strong>Email Security Records</strong></p>
<ul>
<li><p><strong>SPF (Sender Policy Framework):</strong> Specifies which mail servers are authorized to send email on behalf of your domain.</p>
</li>
<li><p><strong>DKIM (DomainKeys Identified Mail):</strong> Adds a <strong>digital signature</strong> to emails to ensure they haven't been tampered with and are safe.</p>
</li>
<li><p><strong>DMARC:</strong> Tells the receiving server <strong>what to do</strong> with an email if the SPF and DKIM checks fail (e.g., reject it or put it in spam).</p>
</li>
</ul>
</li>
</ol>
]]></content:encoded></item></channel></rss>