<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by bishwa jung shah on Medium]]></title>
        <description><![CDATA[Stories by bishwa jung shah on Medium]]></description>
        <link>https://medium.com/@shahbishwa21?source=rss-7ddcbe48defb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*UI5i2S_iVDvb6JDKWbZYBg.jpeg</url>
            <title>Stories by bishwa jung shah on Medium</title>
            <link>https://medium.com/@shahbishwa21?source=rss-7ddcbe48defb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 10:58:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shahbishwa21/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AI Made Me a Better Programmer… and a Worse One Too]]></title>
            <link>https://medium.com/@shahbishwa21/ai-made-me-a-better-programmer-and-a-worse-one-too-f6337bfc8e5f?source=rss-7ddcbe48defb------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6337bfc8e5f</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[bishwa jung shah]]></dc:creator>
            <pubDate>Fri, 29 May 2026 04:30:42 GMT</pubDate>
            <atom:updated>2026-05-29T04:30:42.105Z</atom:updated>
            <content:encoded><![CDATA[<p>I started coding in 2021. At that time AI coding tools did not exist.</p><p>Then when my code broke I was on my own.</p><p>I had to search through Stack Overflow threads and watch outdated YouTube tutorials.</p><p>I hoped that someone who had the error as me had posted about it.</p><p>I was pretty good at coding.</p><p>I was good at building logic.</p><p>I enjoyed solving problems on my own.</p><p>Debugging was painful at times. It was also rewarding.</p><p>Then AI happened.</p><p>At first I thought AI coding tools were just overhyped.</p><p>I thought they were another tech trend that people would talk about and then forget.</p><p>I was wrong.</p><p>Now I use AI every day.</p><p>I use it to write code.</p><p>I use it to debug.</p><p>I use it to explain concepts.</p><p>Sometimes I even use it to structure features.</p><p>It feels like I have a programmer.</p><p>My job is to review the code and hit commit push.</p><p>This leads to a question:</p><p>Am I becoming lazy or just more productive?</p><p><strong>The Productivity Boost Feels Illegal</strong></p><p>The first time AI solved a bug I had been fighting for 3 hours I felt betrayed.</p><p>I pasted the error into an AI tool. Hit enter.</p><p>Suddenly I got an explanation, fixed code, optimization suggestions and cleaner architecture ideas.</p><p>All of this happened in 15 seconds.</p><p>Meanwhile I was opening 27 Stack Overflow tabs.</p><p>Since then my workflow has completely changed.</p><p>I stopped memorizing syntax.</p><p>I stopped wasting energy writing boilerplate code.</p><p>I started building projects faster.</p><p>For freelancers and indie developers speed matters.</p><p>Clients do not care if you manually suffered through every line of code.</p><p>They care if the product works.</p><p>AI helped me finish projects quicker.</p><p>AI helped me learn stacks faster.</p><p>AI helped me debug smarter.</p><p>AI helped me prototype ideas instantly.</p><p>AI helped me stop getting stuck on issues.</p><p>In ways AI made me a more effective developer.</p><p>Being effective and being skilled are not always the same thing.</p><p><strong>The Side Nobody Talks About</strong></p><p>One day I realized something embarrassing.</p><p>I was accepting AI-generated code without understanding it.</p><p>Not because I could not understand it. Because I was too lazy to.</p><p>That realization hit hard.</p><p>AI changes your relationship with problem-solving.</p><p>Before AI, when I hit a bug I had to sit there and think deeply.</p><p>Now I just throw the error into AI. Ask it to fix it.</p><p>Most of the time it works.</p><p>That is the part.</p><p>The convenience becomes addictive.</p><p>My brain gets used to skipping the struggle.</p><p>Struggle is where most real learning happens.</p><p><strong>AI Made Me Faster.. Less Patient</strong></p><p>This is the weirdest side effect nobody prepared me for.</p><p>AI lowered my tolerance for difficulty.</p><p>If something takes than 10 minutes my brain wants AI assistance.</p><p>I used to enjoy figuring things out</p><p>Now I catch myself searching for shortcuts before I even attempt the problem.</p><p>That is not intelligence.</p><p>That is dependency wearing a productivity costume.</p><p><strong>Maybe This Is What Programming Is Becoming</strong></p><blockquote>Here is the uncomfortable truth:</blockquote><p>Programming is changing.</p><p>Developers are moving from people who write every line of code to people who direct systems.</p><p>Whether we like it or not AI is becoming part of the workflow.</p><p>The developers who completely reject AI might fall behind.</p><p>The developers who rely on it blindly might become fragile.</p><p>The sweet spot is somewhere in the middle.</p><p>AI should be an assistant, a teacher, a brainstorming partner and a debugging companion.</p><p>Not a replacement for my brain.</p><p>When AI fails and it does I still need real programming instincts.</p><p>I still need logic, taste, experience and engineering judgment.</p><p>AI can generate code. It cannot think like a great engineer.</p><p><strong>The Real Skill Now</strong></p><p>I do not think the best programmers in the future will be the people who memorize the syntax.</p><p>I think they will be the people who ask questions verify outputs carefully understand systems deeply think critically and adapt quickly.</p><p>AI rewards clarity.</p><p>Bad developers using AI create messes faster.</p><p>Good developers using AI become efficient.</p><p><strong>Did AI Make Me Better or Worse?</strong></p><p>Honestly both.</p><p>AI made me faster more productive more experimental and more confident trying technologies.</p><p>It also made me impatient, mentally lazy sometimes and overly dependent, during difficult problems.</p><p>I still do not fully know whether that is a thing or a bad thing.</p><p>Maybe it depends on how I use these tools.</p><p>If I use AI carefully it becomes a superpower.</p><p>If I use it blindly it becomes intellectual junk food.</p><p>I am still figuring out which side I am drifting toward.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6337bfc8e5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Find Jobs in Nepal Online (Smarter & Faster)]]></title>
            <link>https://medium.com/@shahbishwa21/how-to-find-jobs-in-nepal-online-smarter-faster-9e58ba32f065?source=rss-7ddcbe48defb------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e58ba32f065</guid>
            <dc:creator><![CDATA[bishwa jung shah]]></dc:creator>
            <pubDate>Sat, 03 Jan 2026 13:27:28 GMT</pubDate>
            <atom:updated>2026-05-29T04:32:34.229Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve ever searched <strong>jobs in Nepal</strong>, <strong>job vacancies in Kathmandu</strong>, or <strong>internship opportunities Nepal</strong> on Google, you already know how frustrating the process can be. Multiple job portals, outdated listings, and endless scrolling all for the same results.</p><p>That’s exactly why <strong>JobKhoj</strong> exists.</p><p><a href="http://kamkhoj.com/">http://kamkhoj.com/</a></p><h4>What Nepali Job Seekers Search for on Google</h4><p>Most people in Nepal look for jobs using simple, direct searches like:</p><ul><li>jobs in Nepal</li><li>job vacancies in Kathmandu</li><li>IT jobs in Nepal</li><li>internship opportunities Nepal</li><li>jobs for freshers in Nepal</li><li>best job portals Nepal</li><li>work from home jobs Nepal</li></ul><p>The problem isn’t the lack of jobs it’s the lack of a <strong>single place</strong> where all these opportunities are easy to find.</p><h4>JobKhoj: One Search, Multiple Job Portals</h4><p><strong>JobKhoj</strong> is a job search aggregator built for Nepal.<br>It collects publicly available job listings from multiple trusted Nepali job portals and shows them in one simple, searchable platform.</p><p>No account required.<br>No payment needed.<br>No fake or expired listings.</p><p>You search once and apply directly on the original job portal.</p><p>👉 <a href="http://kamkhoj.com/">http://kamkhoj.com/</a></p><h4>Why JobKhoj Works the Way People Search</h4><h4>Jobs in Nepal</h4><p>Browse opportunities from across the country including full-time jobs, part-time roles, internships, and fresher-level positions.</p><h4>Jobs in Kathmandu and Other Cities</h4><p>Filter jobs by location such as Kathmandu, Pokhara, Lalitpur, and other major cities in Nepal.</p><h4>IT Jobs and Professional Roles</h4><p>Find tech, finance, engineering, healthcare, and administrative jobs easily through keyword-based search.</p><h4>Internship Opportunities</h4><p>Perfect for students and fresh graduates looking for internships and entry-level roles.</p><h4>Latest Job Vacancies</h4><p>JobKhoj focuses on recently published job listings so users don’t waste time applying to expired positions.</p><h4>Save Time, Skip the Tab-Hopping</h4><p>Instead of visiting multiple job portals every day, JobKhoj brings them together in one place. Each job listing redirects you to the original source, keeping the process transparent and reliable.</p><p>This means:</p><ul><li>Faster job discovery</li><li>Less confusion</li><li>More time to focus on applications</li></ul><h4>Who Should Use JobKhoj?</h4><ul><li>Fresh graduates searching for their first job</li><li>Students looking for internships in Nepal</li><li>Professionals exploring new career opportunities</li><li>Anyone searching for jobs online in Nepal</li></ul><h4>Final Thoughts</h4><p>Job searching in Nepal doesn’t have to be complicated.<br>With <strong>JobKhoj</strong>, you can search smarter, faster, and with clarity — all from one platform.</p><p>Start your job search today:<br>👉 <a href="http://kamkhoj.com/">http://kamkhoj.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e58ba32f065" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Level Up Your Web Development: Essential Chrome DevTools Features You Need to Know]]></title>
            <link>https://medium.com/@shahbishwa21/level-up-your-web-development-essential-chrome-devtools-features-you-need-to-know-130231dcf754?source=rss-7ddcbe48defb------2</link>
            <guid isPermaLink="false">https://medium.com/p/130231dcf754</guid>
            <category><![CDATA[chrome-dev-tools]]></category>
            <dc:creator><![CDATA[bishwa jung shah]]></dc:creator>
            <pubDate>Tue, 10 Jun 2025 07:29:50 GMT</pubDate>
            <atom:updated>2025-06-10T07:29:50.471Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Level Up Your Web Development: Essential Chrome DevTools Features You Need to Know" src="https://cdn-images-1.medium.com/max/800/0*y9yDNcCRBqmmSm-X" /></figure><p>Chrome DevTools is an indispensable toolkit for any web developer. Beyond the basic inspection of HTML and CSS, it houses a wealth of powerful features designed to streamline your workflow, debug effectively, and optimize your web applications. Let’s explore some key DevTools functionalities that can significantly enhance your development process.</p><ol><li>Craft Perfect Styles with the CSS Shadow Editor</li></ol><p>Manually tweaking box-shadow properties in CSS can be a tedious process of trial and error. The CSS Shadow Editor in the Styles pane provides a visual interface to create and modify box shadows with ease. Select an element with a box-shadow applied, and you’ll often see a shadow icon next to the property. Clicking this icon opens the editor, allowing you to adjust the shadow’s color, horizontal and vertical offset, blur radius, and spread radius using intuitive controls. You can also toggle the inset property visually. This real-time visual feedback dramatically speeds up the process of achieving the desired shadow effect.</p><p>2. Debug Smarter with Logpoints and Conditional Breakpoints</p><p>Traditional console.log statements are useful, but they can clutter your code. Logpoints offer a cleaner alternative. Instead of inserting console.log(), you can right-click on a line number in the Sources panel and select “Add logpoint…”. This allows you to inject messages into the Console without modifying your code.</p><p>Conditional Breakpoints take your debugging to the next level. Instead of pausing execution every time a breakpoint is hit, you can set a condition. The debugger will only pause when that specific condition is true. To set a conditional breakpoint, right-click on a line number and select “Add conditional breakpoint…”. Enter a JavaScript expression; the execution will halt only when that expression evaluates to true. This is incredibly helpful for debugging complex loops or specific scenarios.</p><p>3. Optimize Performance with the Coverage Tab</p><p>Website performance is crucial, and unnecessary code bloat can significantly impact loading times. The Coverage tab helps you identify unused CSS and JavaScript. Open it from the Command Menu (Ctrl+Shift+P or Cmd+Shift+P) and click the reload button to start recording. As you interact with your website, the Coverage tab will show you which parts of your CSS and JS files are actually being executed. Unused code is highlighted in red. This information empowers you to remove dead code, split large files, or consider lazy-loading strategies to improve your site’s performance.</p><p>4. Pinpoint DOM Modifications with “Break On”</p><p>Sometimes, tracking down which script is modifying a specific DOM element can be challenging, especially when dealing with large codebases or third-party libraries. The “Break On” feature allows you to set breakpoints that trigger when specific types of DOM modifications occur. Right-click on an element in the Elements panel, hover over “Break On,” and you’ll see options like:</p><p>Attribute Modified: Triggers when an attribute of the selected element changes. Subtree Modified: Triggers when a child node is added or removed from the selected element. Node Removed: Triggers when the selected element is removed from the DOM. This feature helps you quickly pinpoint the JavaScript code responsible for unexpected DOM changes.</p><p>5. Maintain Focus with “Emulate a Focused Page”</p><p>Have you ever tried to debug an animation or a dropdown menu that disappears as soon as you switch focus to DevTools? The “Emulate focused page” option in the Rendering tab solves this issue. When enabled, the browser window will behave as if it’s always in focus, even when DevTools is open and active. This is particularly useful for inspecting interactive elements that rely on the focus state.</p><p>6. Fine-Tune Rendering with the Rendering Tab</p><p>The Rendering tab offers a suite of tools to analyze and optimize your website’s rendering performance and accessibility:</p><p>Show layer borders: Visualize the different composited layers on your page, which can help understand how the browser is rendering and identify potential performance issues related to excessive layer creation. Highlight potential scroll bottlenecks: Identify regions of the page that might be contributing to janky scrolling. Emulate CSS media feature prefers-color-scheme: Preview how your website looks with different user preferences for light and dark color schemes. Emulate vision deficiencies: Simulate various vision impairments like blurred vision or different types of color blindness to ensure your design is accessible to a wider audience. 7. Get a Bird’s-Eye View of Your Styles with CSS Overview</p><p>Maintaining consistency and identifying potential issues in your CSS can be challenging in large projects. The CSS Overview panel provides a comprehensive report of the CSS used on your website. It analyzes aspects like the number of unique colors and fonts, unused declarations, media queries, and potential accessibility issues like low contrast ratios. This overview helps you identify areas for optimization, ensure design consistency, and improve the maintainability of your stylesheets.</p><p>7. Capture Element-Specific Screenshots</p><p>Need to quickly grab a screenshot of a specific section of your webpage without capturing the entire viewport? Right-click on any element in the Elements panel, and you’ll find the “Capture node screenshot” option. This handy feature saves you the trouble of cropping and editing full-page screenshots when you only need a specific element. You can also capture a full-page screenshot from the Command Menu.</p><p>8. Easily Copy Console Output</p><p>Sharing console logs or keeping a record of debugging sessions can be useful. The Chrome DevTools Console makes this easy with the Copy console functionality. You can usually find a “Copy” button or a right-click option to copy the entire content of the console to your clipboard with a single click.</p><p>9. Master Animations with the CSS Animations Inspector</p><p>Debugging and fine-tuning CSS animations can be tricky. The dedicated CSS Animations Inspector provides a visual representation of your animations and transitions. When an element with an active animation or transition is selected, the Animations tab (often found in the bottom drawer or as a separate tab) will display a timeline. You can inspect the animation’s keyframes, adjust the timing and easing, replay the animation, slow it down, or even scrub through the timeline to analyze its different stages. This tool significantly simplifies the process of creating smooth and engaging animations.</p><p>10. Test Loading Performance with Network Throttling</p><p>Your website’s loading performance can vary significantly depending on the user’s network connection. The Network Throttling feature in the Network tab allows you to simulate different network speeds, from fast broadband to slow 3G. By throttling the network, you can observe how your website performs under less-than-ideal conditions and identify areas for optimization to ensure a good user experience for everyone.</p><p>11. Force Breakpoints with the debugger Keyword</p><p>Sometimes, you need to pause the execution of your JavaScript code at a specific point during runtime. While you can set breakpoints using the DevTools interface, you can also directly embed the debugger; keyword in your JavaScript code. When the browser encounters this statement, it will automatically pause execution, effectively acting as a breakpoint. This can be particularly useful for quickly pausing code in specific scenarios without having to manually set a breakpoint in the DevTools.</p><p>12. Automate Repetitive Tasks with Snippets</p><p>If you frequently run the same JavaScript code in the Console for debugging or testing purposes, Snippets can save you a lot of time. Located in the Sources panel, Snippets allow you to save and execute reusable JavaScript code. You can create new snippets, write your code, and then run them with a simple right-click or by pressing Ctrl+Enter (Cmd+Enter on macOS). This is a great way to automate repetitive tasks like clearing the console, logging specific information, or testing small pieces of functionality.</p><p>13. Optimize Reloading with Reload Variants</p><p>The browser’s reload functionality has more depth than just a simple refresh. Long-clicking (or right-clicking) the reload button in the Chrome address bar reveals several options:</p><p>Normal Reload: Refreshes the page using cached resources where possible. Hard Reload: Forces the browser to bypass the cache and fetch all resources from the server. Empty Cache and Hard Reload: Clears the browser’s cache for the current page and then performs a hard reload, ensuring you get the absolute latest version of all assets. Understanding these different reload variants can be crucial for troubleshooting caching issues and ensuring you’re always working with the latest version of your code and assets.</p><p>By mastering these Chrome DevTools features, you can significantly enhance your web development efficiency, debug more effectively, and build better-performing and more accessible web applications. Explore these tools and discover how they can transform your workflow!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=130231dcf754" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Pagination System in Next.js using sadcn]]></title>
            <link>https://medium.com/@shahbishwa21/building-a-pagination-system-in-next-js-using-sadcn-b7a3e79cf1e2?source=rss-7ddcbe48defb------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7a3e79cf1e2</guid>
            <category><![CDATA[pagination-in-react]]></category>
            <category><![CDATA[pagination]]></category>
            <category><![CDATA[pagination-using-sadcn]]></category>
            <dc:creator><![CDATA[bishwa jung shah]]></dc:creator>
            <pubDate>Fri, 07 Feb 2025 12:09:11 GMT</pubDate>
            <atom:updated>2025-02-07T14:09:02.455Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/290/1*IqNFOsPyq705qouVXjSU9w.png" /></figure><p>This guide shows how to create a simple pagination system in Next.js using a dummy JSON dataset. It’s designed for users with no backend experience, offering an easy setup for implementing pagination without complex server-side configurations.</p><blockquote>Note: This demo assumes you already have a Next.js project set up and are looking to gain experience in implementing a pagination system.</blockquote><p><strong>Step 1: Setting Up the Backend API for Pagination</strong></p><p>We will create a simple API endpoint in our Next.js project that fetches paginated data from the<strong> DummyJSON API.</strong></p><h4>File Structure</h4><pre>/app<br>  /api<br>    /pagination<br>      route.ts</pre><p>API Implementation (api/pagination/route.ts)</p><pre>import axios from &quot;axios&quot;;<br>export async function GET(request: Request) {<br>  try {<br>    const { searchParams } = new URL(request.url);<br>    const page = parseInt(searchParams.get(&quot;page&quot;) || &quot;1&quot;);<br>    const limit = parseInt(searchParams.get(&quot;limit&quot;) || &quot;10&quot;);<br>// Fetch all data from DummyJSON API<br>    const response = await axios.get(&quot;https://dummyjson.com/products?limit=0&quot;);<br>    const products = response.data.products;<br>    // Calculate total pages<br>    const totalProducts = products.length;<br>    const totalPages = Math.ceil(totalProducts / limit);<br>    // Paginate the products<br>    const startIndex = (page - 1) * limit;<br>    const paginatedData = products.slice(startIndex, startIndex + limit);<br>    return new Response(<br>      JSON.stringify({<br>        data: paginatedData,<br>        current_data_length: paginatedData.length,<br>        current_page: page,<br>        total_page: totalPages,<br>      }),<br>      { status: 200, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; } }<br>    );<br>  } catch (error) {<br>    console.error(&quot;Error:&quot;, error);<br>    return new Response(<br>      JSON.stringify({ error: &quot;Something went wrong&quot; }),<br>      { status: 500, headers: { &quot;Content-Type&quot;: &quot;application/json&quot; } }<br>    );<br>  }<br>}</pre><p>This API fetches product data, calculates total pages, and returns paginated results based on query parameters.</p><p><strong>Step 2: Creating the Pagination Wrapper Component</strong></p><p>We will build a reusable <strong>PaginationWrapper</strong> component using Shadcn&#39;s pagination utilities.</p><blockquote>note: you have to install the pagination, button ,skeleton and card from sadcn website</blockquote><p>PaginationWrapper (components/PaginationWrapper.tsx)</p><pre>import React from &quot;react&quot;;<br>import {<br>  Pagination,<br>  PaginationContent,<br>  PaginationItem,<br>  PaginationLink,<br>  PaginationPrevious,<br>  PaginationNext,<br>  PaginationEllipsis,<br>} from &quot;@/components/ui/pagination&quot;;<br>interface PaginationWrapperProps {<br>  totalPages: number;<br>  currentPage: number;<br>  onPageChange: (page: number) =&gt; void;<br>  disabled?: boolean;<br>}<br>const PaginationWrapper: React.FC&lt;PaginationWrapperProps&gt; = ({<br>  totalPages,<br>  currentPage,<br>  onPageChange,<br>  disabled = false,<br>}) =&gt; {<br>  const getPages = () =&gt; {<br>    const pages = [];<br>    for (let i = 1; i &lt;= totalPages; i++) {<br>      pages.push(i);<br>    }<br>    return pages;<br>  };<br>  return (<br>    &lt;Pagination&gt;<br>      &lt;PaginationContent&gt;<br>        &lt;PaginationPrevious<br>          onClick={() =&gt; {<br>            if (!disabled &amp;&amp; currentPage &gt; 1) onPageChange(currentPage - 1);<br>          }}<br>        /&gt;<br>        {getPages().map((page) =&gt;<br>          Math.abs(page - currentPage) &lt; 2 || page === 1 || page === totalPages ? (<br>            &lt;PaginationItem key={page}&gt;<br>              &lt;PaginationLink<br>                isActive={page === currentPage}<br>                onClick={() =&gt; onPageChange(page)}<br>              &gt;<br>                {page}<br>              &lt;/PaginationLink&gt;<br>            &lt;/PaginationItem&gt;<br>          ) : (<br>            page === currentPage + 2 &amp;&amp; &lt;PaginationEllipsis key={page} /&gt;<br>          )<br>        )}<br>        &lt;PaginationNext<br>          onClick={() =&gt; {<br>            if (!disabled &amp;&amp; currentPage &lt; totalPages) onPageChange(currentPage + 1);<br>          }}<br>        /&gt;<br>      &lt;/PaginationContent&gt;<br>    &lt;/Pagination&gt;<br>  );<br>};<br>export default PaginationWrapper;</pre><p>This component handles pagination logic and displays the appropriate page numbers, next, and previous buttons.</p><p><strong>Step 3: Building the Product List Component with Pagination</strong></p><p>Next, we will create a <strong>Product Pagination</strong> component that fetches paginated data from the backend API and displays it with a pagination control.</p><p><strong>Product Pagination Component (</strong><strong>components/ProductPagination.tsx)</strong></p><pre>&quot;use client&quot;;<br>import { useState, useEffect } from &quot;react&quot;;<br>import { useRouter, useSearchParams } from &quot;next/navigation&quot;;<br>import { Card, CardContent, CardHeader, CardTitle } from &quot;@/components/ui/card&quot;;<br>import { Skeleton } from &quot;@/components/ui/skeleton&quot;;<br>import Image from &quot;next/image&quot;;<br>import PaginationWrapper from &quot;./PaginationWrapper&quot;;<br>interface Product {<br>  id: number;<br>  title: string;<br>  description: string;<br>  price: number;<br>  thumbnail: string;<br>}<br>interface ApiResponse {<br>  data: Product[];<br>  current_data_length: number;<br>  current_page: number;<br>  total_page: number;<br>}<br>export default function ProductPagination() {<br>  const [products, setProducts] = useState&lt;Product[]&gt;([]);<br>  const [currentPage, setCurrentPage] = useState(1);<br>  const [totalPages, setTotalPages] = useState(0);<br>  const [isLoading, setIsLoading] = useState(true);<br>  const searchParams = useSearchParams();<br>  const router = useRouter();<br>  const fetchProducts = async (page: number) =&gt; {<br>    setIsLoading(true);<br>    try {<br>      const response = await fetch(`/api/pagination?page=${page}&amp;limit=10`);<br>      const data: ApiResponse = await response.json();<br>      setProducts(data.data);<br>      setCurrentPage(data.current_page);<br>      setTotalPages(data.total_page);<br>    } catch (error) {<br>      console.error(&quot;Error fetching products:&quot;, error);<br>    } finally {<br>      setIsLoading(false);<br>    }<br>  };<br>  useEffect(() =&gt; {<br>    const page = Number(searchParams.get(&quot;page&quot;)) || 1;<br>    fetchProducts(page);<br>  }, [searchParams]);<br>  const handlePageChange = (page: number) =&gt; {<br>    router.push(`?page=${page}`);<br>  }; // for simple i have just push you can optimize as you want<br>  return (<br>    &lt;div className=&quot;container mx-auto p-4&quot;&gt;<br>      &lt;h1 className=&quot;text-2xl font-bold mb-4&quot;&gt;Product List&lt;/h1&gt;<br>      &lt;div className=&quot;grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4&quot;&gt;<br>        {isLoading<br>          ? Array(10)<br>              .fill(0)<br>              .map((_, index) =&gt; (<br>                &lt;Card key={index} className=&quot;w-full&quot;&gt;<br>                  &lt;CardHeader&gt;<br>                    &lt;Skeleton className=&quot;h-4 w-[250px]&quot; /&gt;<br>                  &lt;/CardHeader&gt;<br>                  &lt;CardContent&gt;<br>                    &lt;Skeleton className=&quot;h-4 w-[200px] mb-2&quot; /&gt;<br>                    &lt;Skeleton className=&quot;h-4 w-[150px]&quot; /&gt;<br>                  &lt;/CardContent&gt;<br>                &lt;/Card&gt;<br>              ))<br>          : products.map((product) =&gt; (<br>              &lt;Card key={product.id} className=&quot;w-full&quot;&gt;<br>                &lt;CardHeader&gt;<br>                  &lt;CardTitle&gt;{product.title}&lt;/CardTitle&gt;<br>                &lt;/CardHeader&gt;<br>                &lt;CardContent&gt;<br>                  &lt;p className=&quot;text-sm text-gray-500 mb-2&quot;&gt;{product.description}&lt;/p&gt;<br>                  &lt;p className=&quot;font-bold&quot;&gt;${product.price.toFixed(2)}&lt;/p&gt;<br>                  &lt;Image<br>                    src={product.thumbnail || &quot;/placeholder.svg&quot;}<br>                    alt={product.title}<br>                    width={250}<br>                    height={160}<br>                    className=&quot;mt-2 w-full h-40 object-cover rounded-md&quot;<br>                  /&gt;<br>                &lt;/CardContent&gt;<br>              &lt;/Card&gt;<br>            ))}<br>      &lt;/div&gt;<br>      &lt;div className=&quot;flex justify-center mt-4&quot;&gt;<br>        &lt;PaginationWrapper<br>          totalPages={totalPages}<br>          currentPage={currentPage}<br>          onPageChange={handlePageChange}<br>          disabled={isLoading}<br>        /&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p><strong>Step 4: Rendering the Product Pagination Component</strong></p><p>Finally, integrate the <strong><em>ProductPagination</em> </strong>component in your <strong>Next.js</strong> page.</p><pre>import ProductPagination from &quot;./components/ProductPagination&quot;;<br>export default function Home() {<br>  return (<br>    &lt;main className=&quot;min-h-screen bg-background&quot;&gt;<br>      &lt;ProductPagination /&gt;<br>    &lt;/main&gt;<br>  );<br>}</pre><h4>Conclusion</h4><p>In this tutorial, we built a full-fledged pagination system in <strong>Next.js</strong>. We used Shadcn’s Pagination component for the UI and created a custom backend API for fetching paginated data. This approach ensures a seamless and scalable user experience.</p><p>Feel free to customize the styles and pagination logic according to your needs. Happy coding!</p><p>In short I have write a raw code <a href="https://gist.github.com/beesou777/b3ffe42a43376ffdde131ba950082949">here</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7a3e79cf1e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding the Difference Between robots.txt and X-Robots-Tag: Which One to Use for SEO?]]></title>
            <link>https://medium.com/@shahbishwa21/understanding-the-difference-between-robots-txt-and-x-robots-tag-which-one-to-use-for-seo-778f016d3f54?source=rss-7ddcbe48defb------2</link>
            <guid isPermaLink="false">https://medium.com/p/778f016d3f54</guid>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[robotstxt]]></category>
            <dc:creator><![CDATA[bishwa jung shah]]></dc:creator>
            <pubDate>Fri, 22 Nov 2024 07:36:33 GMT</pubDate>
            <atom:updated>2024-11-22T07:36:33.040Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="what is robot.txt and x-robots-tag" src="https://cdn-images-1.medium.com/max/311/0*RnMJYNeqpWJ57YG_" /></figure><p>If you’re working on optimizing your website for search engines, you’ve probably heard of robots.txt and X-Robots-Tag. These two tools help control how search engines crawl and index your content, but they work in different ways. Knowing when to use each one can make a big difference in your site&#39;s visibility and SEO performance.</p><h3>What is robots.txt?</h3><p>The robots.txt file is a simple text file that lives on your website&#39;s server. It tells search engine crawlers which pages or sections of your site they can and can’t crawl. This is great for preventing search engines from indexing certain parts of your site that don’t need to be in search results, like login pages or admin sections.</p><p>Here’s a basic example of a robots.txt file:</p><pre>User-agent: *<br>Disallow: /private/</pre><p>This would tell all search engines not to crawl any page under the /private/ directory.</p><h3>What is the X-Robots-Tag?</h3><p>The X-Robots-Tag is an HTTP header that gives you more control over how search engines handle specific content on your site. Unlike robots.txt, which is used to control crawling behavior, the X-Robots-Tag lets you control how individual resources (like images or PDFs) are indexed, followed, or displayed in search results.</p><p>For example, you can use the X-Robots-Tag to tell search engines not to index a PDF file or not to follow links in an image. Here’s what the HTTP header might look like:</p><pre>X-Robots-Tag: noindex, nofollow</pre><p>This tells search engines not to index the content or follow any links within the resource.</p><h3>Key Differences Between robots.txt and X-Robots-Tag</h3><p>While both tools help you manage how search engines interact with your site, they differ in several ways:</p><ol><li><strong>Location</strong></li></ol><ul><li><strong>robots.txt</strong>: This is a separate text file placed at the root of your website (e.g., example.com/robots.txt).</li><li><strong>X-Robots-Tag</strong>: This is set in the HTTP headers of specific resources, such as web pages or media files.</li></ul><p>2<strong>. Syntax</strong></p><ul><li><strong>robots.txt</strong>: The syntax is simple and human-readable, using directives to allow or block search engines from crawling specific URLs.</li><li><strong>X-Robots-Tag</strong>: The directives are added as HTTP headers, which gives you more control over how individual resources are handled.</li></ul><p>3. <strong>Flexibility</strong></p><ul><li><strong>robots.txt</strong>: You can specify different rules for different search engines (called &quot;user-agents&quot;), giving you flexibility in how you manage crawlers.</li><li><strong>X-Robots-Tag</strong>: It’s more specific. You can apply rules to individual resources like PDFs or images, but it doesn&#39;t allow for as much control over which crawlers to block.</li></ul><p>4.<strong> Support</strong></p><ul><li><strong>robots.txt</strong>: This is a well-known standard and is widely respected by almost all search engines.</li><li><strong>X-Robots-Tag</strong>: While not a standardized header, major search engines like Google and Bing recognize and follow these rules.</li></ul><h3>When to Use robots.txt vs. X-Robots-Tag</h3><ul><li><strong>Use </strong><strong>robots.txt</strong> when you want to block crawlers from accessing specific pages or directories on your site. It’s useful for things like blocking search engines from crawling login pages, staging sites, or any content that shouldn&#39;t be in search results.</li><li><strong>Use </strong><strong>X-Robots-Tag</strong> when you need more control over individual files or resources. For example, you might want to prevent a PDF from being indexed, stop an image from appearing in search results, or prevent links from being followed in certain content.</li></ul><h3>Conclusion</h3><p>Both robots.txt and X-Robots-Tag are powerful tools for managing how search engines interact with your site. While robots.txt is great for blocking entire sections of your site from being crawled, the X-Robots-Tag offers more granular control over specific resources. Depending on your needs, you might use one or both to ensure your site is crawled and indexed exactly the way you want.</p><p>By understanding how and when to use these tools, you can fine-tune your website’s SEO and improve its visibility in search engine results.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=778f016d3f54" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 10 Web Development Projects to Build in 2026]]></title>
            <link>https://medium.com/@shahbishwa21/top-10-trending-web-development-projects-to-build-in-2025-45574251e7bd?source=rss-7ddcbe48defb------2</link>
            <guid isPermaLink="false">https://medium.com/p/45574251e7bd</guid>
            <dc:creator><![CDATA[bishwa jung shah]]></dc:creator>
            <pubDate>Wed, 20 Nov 2024 11:03:11 GMT</pubDate>
            <atom:updated>2025-12-26T04:59:29.764Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Trending Web Development Projects" src="https://cdn-images-1.medium.com/max/782/0*y9Iyq-zTo2LMvLjn" /></figure><p>Web development is constantly evolving, and staying ahead means working on projects that not only sharpen your skills but are also aligned with current industry trends. Whether you’re a beginner or an experienced developer, building these projects can enhance your portfolio, showcase your expertise, and help you stay relevant.</p><p>In this article, we’ve curated <strong>10 trending web development projects</strong> for 2024, arranged from beginner-friendly to advanced. Each project comes with implementation steps and the skills you’ll develop along the way.</p><h3>1. AI-Powered Recipe Finder</h3><p><strong>Why build this?</strong> Combine AI capabilities with user convenience by creating a recipe finder that generates meal ideas based on ingredients entered by users.</p><p><strong>Skills you’ll practice:</strong></p><ul><li>API integration</li><li>Text parsing and filtering</li><li>Dynamic data rendering</li></ul><p><strong>Implementation steps:</strong></p><ol><li>Create a user interface for ingredient input.</li><li>Fetch recipe data from an API (e.g., Spoonacular).</li><li>Implement filtering based on dietary preferences.</li><li>Add AI-generated recipe suggestions using GPT-based APIs.</li><li>Include a favorites list for saved recipes.</li></ol><h3>2. Live Weather Dashboard with Geolocation</h3><p><strong>Why build this?</strong> A real-time weather app helps you practice geolocation, API handling, and responsive design.</p><p><strong>Skills you’ll practice:</strong></p><ul><li>Fetching real-time data</li><li>Geolocation API</li><li>Responsive UI design</li></ul><p><strong>Implementation steps:</strong></p><ol><li>Use the Geolocation API to fetch the user’s location.</li><li>Integrate a weather API (e.g., OpenWeatherMap) to fetch weather data.</li><li>Design a clean, responsive dashboard for weather visualization.</li><li>Add daily and weekly forecasts.</li><li>Include weather-related tips based on conditions.</li></ol><h3>3. Chatbot with Sentiment Analysis</h3><p><strong>Why build this?</strong> Build an intelligent chatbot that understands user sentiment — perfect for learning natural language processing (NLP).</p><p><strong>Skills you’ll practice:</strong></p><ul><li>AI API integration (e.g., OpenAI or Google Dialogflow)</li><li>NLP basics</li><li>Real-time user interactions</li></ul><p><strong>Implementation steps:</strong></p><ol><li>Create a chat interface.</li><li>Integrate an NLP API for sentiment analysis.</li><li>Respond to user queries based on sentiment.</li><li>Add customizable chatbot responses.</li><li>Save chat history for user review.</li></ol><h3>4. Portfolio Website with 3D Animations</h3><p><strong>Why build this?</strong> Showcase your work with cutting-edge 3D animations using libraries like Three.js.</p><p><strong>Skills you’ll practice:</strong></p><ul><li>3D rendering (Three.js)</li><li>Animation techniques</li><li>Portfolio design</li></ul><p><strong>Implementation steps:</strong></p><ol><li>Design a visually appealing portfolio layout.</li><li>Add 3D models and animations using Three.js.</li><li>Implement smooth scrolling and interactive elements.</li><li>Optimize animations for performance.</li><li>Add a dark mode toggle for a modern touch.</li></ol><h3>5. Social Media Analytics Dashboard</h3><p><strong>Why build this?</strong> Track social media performance and visualize metrics — ideal for practicing data visualization.</p><p><strong>Skills you’ll practice:</strong></p><ul><li>Chart libraries (Chart.js, D3.js)</li><li>API handling</li><li>Data analysis</li></ul><p><strong>Implementation steps:</strong></p><ol><li>Fetch data from social media APIs (e.g., Twitter, Instagram).</li><li>Create charts to display metrics like followers, engagement, and impressions.</li><li>Implement data filtering by date and platform.</li><li>Add export functionality for reports.</li><li>Design an intuitive dashboard interface.</li></ol><h3>6. E-Commerce Site with Payment Integration</h3><p><strong>Why build this?</strong> Learn the foundations of online commerce by building an e-commerce site with payment processing.</p><p><strong>Skills you’ll practice:</strong></p><ul><li>Payment gateway integration (Stripe, PayPal)</li><li>State management</li><li>Secure user authentication</li></ul><p><strong>Implementation steps:</strong></p><ol><li>Create product listing and detail pages.</li><li>Implement a shopping cart system.</li><li>Add user authentication for checkout.</li><li>Integrate a payment gateway for transactions.</li><li>Optimize for mobile users.</li></ol><h3>7. Virtual Event Management System</h3><p><strong>Why build this?</strong> Enable users to create, join, and manage virtual <a href="https://www.eventeir.ai/">events </a>— timely and relevant in today’s remote-first world.</p><p><strong>Skills you’ll practice:</strong></p><ul><li>Event scheduling</li><li>Real-time updates</li><li>Notification systems</li></ul><p><strong>Implementation steps:</strong></p><ol><li>Create an event creation and management interface.</li><li>Implement calendar integration for event scheduling.</li><li>Add live chat functionality during events.</li><li>Send reminders via email or push notifications.</li><li>Include event analytics for organizers.</li></ol><h3>8. AI-Powered Resume Builder</h3><p><strong>Why build this?</strong> Automate resume creation with AI — great for working on form handling and PDF generation.</p><p><strong>Skills you’ll practice:</strong></p><ul><li>Form validation</li><li>Template generation</li><li>PDF creation (e.g., jsPDF)</li></ul><p><strong>Implementation steps:</strong></p><ol><li>Build a form for user input (e.g., name, skills, experience).</li><li>Use AI to suggest skills and phrasing.</li><li>Generate a formatted resume as a PDF.</li><li>Add templates for different industries.</li><li>Implement export and share options.</li></ol><h3>9. Real-Time Collaboration Tool</h3><p><strong>Why build this?</strong> Create a tool for collaborative editing — a challenging project for real-time communication.</p><p><strong>Skills you’ll practice:</strong></p><ul><li>WebSocket communication</li><li>Real-time data synchronization</li><li>Conflict resolution algorithms</li></ul><p><strong>Implementation steps:</strong></p><ol><li>Create a text editor interface.</li><li>Set up a WebSocket server for real-time updates.</li><li>Implement user roles (editor, viewer).</li><li>Add conflict handling for simultaneous edits.</li><li>Save document history and version control.</li></ol><h3>10. Blockchain-Based Voting System</h3><p><strong>Why build this?</strong> Work with blockchain technology to build a secure and transparent voting application.</p><p><strong>Skills you’ll practice:</strong></p><ul><li>Blockchain basics</li><li>Smart contract development</li><li>Data security</li></ul><p><strong>Implementation steps:</strong></p><ol><li>Set up a blockchain network (e.g., Ethereum, Polygon).</li><li>Develop smart contracts for voting.</li><li>Create a user-friendly voting interface.</li><li>Add vote verification and results visualization.</li><li>Ensure the system is tamper-proof and scalable.</li></ol><h3>Getting Started Tips</h3><ul><li>Break each project into smaller, manageable tasks.</li><li>Start with a simple version and iterate to add features.</li><li>Use version control (e.g., Git) for tracking changes.</li><li>Focus on testing your code at every stage.</li><li>Document your process — it’s great for showcasing your work.</li></ul><h3>Conclusion</h3><p>These trending web development projects not only align with current technologies but also enhance your skill set in meaningful ways. Choose a project that excites you, start with the basics, and build it step by step. The journey of building these projects will help you grow as a developer and keep your skills industry-ready.</p><p>Ready to start? Let’s code! 🚀</p><p>connect with me :<br>- <a href="https://github.com/beesou777">https://github.com/beesou777</a><br>- <a href="https://www.linkedin.com/in/beesou-shah/">https://www.linkedin.com/in/beesou-shah/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45574251e7bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Proxy Object in JavaScript]]></title>
            <link>https://medium.com/@shahbishwa21/proxy-object-in-javascript-4bee7b065bac?source=rss-7ddcbe48defb------2</link>
            <guid isPermaLink="false">https://medium.com/p/4bee7b065bac</guid>
            <category><![CDATA[proxy-object]]></category>
            <category><![CDATA[js]]></category>
            <category><![CDATA[proxy]]></category>
            <dc:creator><![CDATA[bishwa jung shah]]></dc:creator>
            <pubDate>Mon, 16 Sep 2024 01:43:05 GMT</pubDate>
            <atom:updated>2024-09-16T07:00:58.021Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*CKEDBtql0_nJy6kO.png" /></figure><p>So I was surfing a internet and found somethings new topic i haven’t used .So let get going .</p><h4>What is Proxy objects ?</h4><p>In simple term is an object that can be used in place of the original object. This can include operation such as property lookup , assignment, enumeration and so on . It is especially useful for creating libraries , framework and advance patterns like data binding and validation.</p><h4>How to use a proxy ?</h4><p>Since proxy is created using the proxy constructor . So usually it takes two arguments i.e Target and Handler <br>1. <strong>Target : </strong>The object you want to proxy.</p><p>2. <strong>Handler</strong> : An object that defines which operations to intercept and how to redefine them.</p><p>So lets talk about the basic usage:</p><pre>const target = {<br>  message: &quot;Hello, world!&quot;<br>};<br><br>const handler = {<br>  get(target, prop, receiver) {<br>    console.log(`Getting ${prop}`);<br>    return prop in target ? target[prop] : `Property ${prop} does not exist`;<br>  },<br>  set(target, prop, value) {<br>    console.log(`Setting ${prop} to ${value}`);<br>    target[prop] = value;<br>    return true; // Indicate that the assignment was successful<br>  }<br>};<br><br>const proxy = new Proxy(target, handler);<br><br>console.log(proxy.message); // Logs &quot;Getting message&quot; and &quot;Hello, world!&quot;<br>proxy.message = &quot;Hello, Proxy!&quot;; // Logs &quot;Setting message to Hello, Proxy!&quot;<br>console.log(proxy.message); // Logs &quot;Getting message&quot; and &quot;Hello, Proxy!&quot;</pre><p>So above was a basic example and i have listed some real world example where proxy object can be really helpful</p><ol><li>Validation:</li></ol><p>You can use proxies to validate data before it is set on an object. For example, let’s create a proxy that ensures properties are strings and that their length does not exceed a certain limit:</p><pre>const validator = {<br>  set(target, prop, value) {<br>    if (typeof value !== &#39;string&#39;) {<br>      throw new TypeError(&#39;Value must be a string&#39;);<br>    }<br>    if (value.length &gt; 10) {<br>      throw new RangeError(&#39;Value length must not exceed 10 characters&#39;);<br>    }<br>    target[prop] = value;<br>    return true;<br>  }<br>};<br><br>const user = new Proxy({}, validator);<br><br>user.name = &#39;Alice&#39;; // Works fine<br>console.log(user.name);<br><br>user.name = &#39;This name is too long&#39;; // Throws RangeError: Value length must not exceed 10 characters</pre><p>2. Logging and Debugging</p><p>Proxies can be used to automatically log interactions with an object, which can be useful for debugging or monitoring:</p><pre>const logHandler = {<br>  get(target, prop, receiver) {<br>    console.log(`Getting ${prop}`);<br>    return Reflect.get(...arguments);<br>  },<br>  set(target, prop, value) {<br>    console.log(`Setting ${prop} to ${value}`);<br>    return Reflect.set(...arguments);<br>  }<br>};<br><br>const loggedObject = new Proxy({}, logHandler);<br><br>loggedObject.a = 1; // Logs: Setting a to 1<br>console.log(loggedObject.a); // Logs: Getting a</pre><p>3. Data binding</p><p>In frameworks like Vue.js, proxies are used to create reactive data bindings. Here’s a simplified example of how you might use a proxy for such a purpose:</p><pre>function createReactiveObject(target, onChange) {<br>  return new Proxy(target, {<br>    set(target, prop, value) {<br>      const result = Reflect.set(target, prop, value);<br>      onChange(prop, value);<br>      return result;<br>    }<br>  });<br>}<br><br>const state = createReactiveObject({ count: 0 }, (prop, value) =&gt; {<br>  console.log(`Property ${prop} changed to ${value}`);<br>});<br><br>state.count = 1; // Logs: Property count changed to 1</pre><p>4. Mocking Objects for Testing</p><p>Proxies can be useful for creating mocks in tests. For example, you might use a proxy to simulate a complex API response:</p><pre>const apiMock = new Proxy({}, {<br>  get(target, prop) {<br>    if (prop === &#39;fetchData&#39;) {<br>      return () =&gt; Promise.resolve({ data: &#39;mocked data&#39; });<br>    }<br>    return () =&gt; Promise.reject(new Error(&#39;Not implemented&#39;));<br>  }<br>});<br><br>apiMock.fetchData().then(response =&gt; console.log(response.data)); // Output: mocked data</pre><p>So above was some of the real world scenario where you can you the proxy object .</p><p>you can check more <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy">here</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bee7b065bac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Lexical Scope and Closures in JavaScript]]></title>
            <link>https://medium.com/@shahbishwa21/understanding-lexical-scope-and-closures-in-javascript-ae16b050f47c?source=rss-7ddcbe48defb------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae16b050f47c</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[closure-in-javascript]]></category>
            <category><![CDATA[closures-functions]]></category>
            <category><![CDATA[lexical-environment]]></category>
            <category><![CDATA[lexical-scope]]></category>
            <dc:creator><![CDATA[bishwa jung shah]]></dc:creator>
            <pubDate>Tue, 27 Aug 2024 07:00:43 GMT</pubDate>
            <atom:updated>2024-08-27T07:25:16.491Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="lexical and clousure" src="https://cdn-images-1.medium.com/max/1024/1*ZUn-74GyLzXQBdTUVFK50g.png" /></figure><p>Today, we will explore the concepts of lexical scope and closures in JavaScript and how they work together to provide powerful functionality.</p><h4>Lexical Scope</h4><p>Lexical scope refers to how variable scope is determined by the structure of the code. A variable’s scope is defined by where it is declared, and it is accessible within that scope and any nested scopes</p><pre>var globalVar = &#39;Global&#39;;<br><br>var outerFunction = function() {<br>    var outerVar = &#39;Outer&#39;;<br><br>    console.log(&quot;Global and Outer variables accessible (outer function):&quot;, globalVar, outerVar);<br><br>    var innerFunction = function() {<br>        var innerVar = &#39;Inner&#39;;<br>        console.log(&quot;Global, Outer, and Inner variables accessible (inner function):&quot;, globalVar, outerVar, innerVar);<br>    };<br><br>    innerFunction(); // Call inner function<br>    return;<br>};<br><br>outerFunction(); // Call outer function<br>console.log(&quot;Only Global variable accessible (global scope):&quot;, globalVar);</pre><p><strong>Explanation:</strong></p><ul><li><strong>outerFunction</strong> has access to both globalVar and outerVar because outerVar is declared within outerFunction and is therefore accessible in its nested scopes.</li><li><strong>innerFunction</strong> can access globalVar, outerVar, and innerVar because it is nested within outerFunction, which contains outerVar, and innerVar is within its own scope.</li><li>Outside of outerFunction, only globalVar is accessible because outerVar and innerVar are scoped within their respective functions.</li></ul><h4>Closures</h4><p>Closures are like little packages that store their own special environment. When you create a function inside another function, the inner function remembers and can still use the variables from the outer function, even after the outer function has finished running. It’s like the inner function keeps a copy of the outer function’s “workspace” so it can keep working with those variables.</p><pre>function createFieldValidator(fieldName) {<br>    // Encapsulate the validation rules and state within the closure<br>    let isValid = true;<br>    let errorMessage = &#39;&#39;;<br><br>    return {<br>        validate: function(value) {<br>            // Custom validation logic for the field<br>            if (value.trim() === &#39;&#39;) {<br>                isValid = false;<br>                errorMessage = `${fieldName} cannot be empty.`;<br>            } else if (value.length &lt; 5) {<br>                isValid = false;<br>                errorMessage = `${fieldName} must be at least 5 characters long.`;<br>            } else {<br>                isValid = true;<br>                errorMessage = &#39;&#39;;<br>            }<br>            return isValid;<br>        },<br>        getError: function() {<br>            return errorMessage;<br>        }<br>    };<br>}<br><br>// Create validators for different fields<br>const usernameValidator = createFieldValidator(&#39;Username&#39;);<br>const passwordValidator = createFieldValidator(&#39;Password&#39;);<br><br>// Validate inputs<br>const username = &#39;John&#39;;<br>const password = &#39;1234&#39;;<br><br>if (!usernameValidator.validate(username)) {<br>    console.log(usernameValidator.getError()); // Output: Username must be at least 5 characters long.<br>}<br><br>if (!passwordValidator.validate(password)) {<br>    console.log(passwordValidator.getError()); // Output: Password must be at least 5 characters long.<br>}</pre><h3>Explanation:</h3><ol><li><strong>createFieldValidator Function</strong>:</li></ol><ul><li>This function creates a closure that encapsulates the validation logic for a specific field.</li><li>It maintains its own state (isValid and errorMessage) and provides methods to validate the input and retrieve the error message.</li></ul><p><strong>2 . Validation Logic</strong>:</p><ul><li>The validate method checks the input value against certain criteria (e.g., non-empty and minimum length).</li><li>The getError method returns the error message if validation fails.</li></ul><p><strong>3 . Field-Specific Validators</strong>:</p><ul><li>usernameValidator and passwordValidator are instances of field validators, each with its own validation rules and state.</li><li>They validate their respective inputs independently, demonstrating how closures can encapsulate and manage state for different contexts.</li></ul><h4>Combining Lexical Scope and Closures</h4><p>To illustrate both concepts, consider a real-world scenario where we create a shopping cart system. In this system, each cart can maintain its own list of items, allowing for functionality like adding and removing items while preserving the cart’s state across different operations.</p><p>Here’s how you can achieve this using both lexical scope and closures:</p><pre>function createCart() {<br>    let items = [];<br><br>    return {<br>        addItem:function(item){<br>            items.push(item);<br>        },<br>        getItems:function(){<br>            return items;<br>        },<br>        removeItem:function(item){<br>            let index = items.indexOf(item);<br>            items.splice(index,1);<br>        }<br>    }<br>}<br><br>const cart = createCart();<br>cart.addItem(&#39;apple&#39;);  // add &#39;apple&#39;<br>cart.addItem(&#39;banana&#39;); // add &#39;banana&#39;<br>cart.addItem(&#39;orange&#39;); // add &#39;orange&#39;<br>cart.addItem(&#39;mango&#39;); // add &#39;mango&#39;<br>console.log(cart.getItems()) // [ &#39;apple&#39;, &#39;banana&#39;, &#39;orange&#39;, &#39;mango&#39; ]<br>cart.removeItem(&#39;apple&#39;) // remove &#39;apple&#39;<br>console.log(cart.getItems()) //[ &#39;banana&#39;, &#39;orange&#39;, &#39;mango&#39; ]</pre><p>In this example, we’ve implemented a shopping cart system that demonstrates the concepts of lexical scope and closures in JavaScript:</p><ul><li>The createCart function defines a local variable items, which holds the list of items in the cart.</li><li>The functions addItem, getItems, and removeItem are defined within createCart, and they have access to the items array because of lexical scoping.</li><li>The returned object from createCart contains methods that form closures. These methods maintain access to the items array even after createCart has finished executing.</li><li>This means that addItem, getItems, and removeItem can modify and retrieve the items array, demonstrating how closures capture and preserve their surrounding state.</li></ul><h4>Key Takeaways</h4><ul><li><strong>Lexical Scope</strong>: Determines the visibility of variables based on the physical placement of code. Variables are accessible in their own scope and any nested scopes.</li><li><strong>Closures</strong>: Functions that maintain access to their lexical scope even after their outer function has completed. They allow encapsulation of private data and functionality.</li></ul><p>Here are one two example :</p><pre>// Write a function makeCounter that returns an object with two methods: increment and getValue. The increment method should increase the count by 1, and getValue should return the current count. How would you implement this using closures?<br><br>function makeCounter(){<br>    let counter = 0<br>    return {<br>        increment:function(){<br>            return counter++<br>        },<br>        getValue:function(){<br>            return counter<br>        }<br>    }<br>}<br>const counter = makeCounter()<br><br>counter.increment() // increment to 1<br>counter.increment() // increment to 2<br>counter.increment()// increment to 3<br><br>console.log(counter.getValue()) // 3<br><br>// Create a closure that simulates a simple bank account with methods to deposit, withdraw, and check balance. How would you implement this?<br>  <br>function bankSystem(){<br>    let balance = 0<br><br>    return {<br>        deposit:function(amount){<br>            console.log(&quot;successfully deposit&quot;,amount)<br>            balance += amount<br>            return balance<br>        },<br>        withdraw:function(amount){<br>            if(balance &gt;= amount){<br>                console.log(&quot;successfully withdraw&quot;,amount)<br>                balance -= amount<br>                return balance<br>            }else{<br>                console.log(&quot;inssuffent amount&quot;)<br>            }<br>        },<br>        checkBalance:function(){<br>            console.log(&quot;your current balance&quot;,balance)<br>            return balance<br>        }<br>    }<br>}<br><br>const bank = bankSystem()<br><br>bank.withdraw(300) //inssuffent amount<br>bank.deposit(500) // successfully deposit 500<br>bank.deposit(500) // successfully deposit 500<br>bank.deposit(500) // successfully deposit 500<br>bank.checkBalance() // your current balance 1500<br>bank.withdraw(300) // successfully withdraw 300<br>bank.withdraw(300) // successfully withdraw 300<br>bank.checkBalance() // your current balance 900</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae16b050f47c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automate Daily Commits with GitHub Actions]]></title>
            <link>https://medium.com/@shahbishwa21/automate-daily-commits-with-random-content-using-github-actions-804736759c1d?source=rss-7ddcbe48defb------2</link>
            <guid isPermaLink="false">https://medium.com/p/804736759c1d</guid>
            <category><![CDATA[commit]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[workflow-automation]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[bishwa jung shah]]></dc:creator>
            <pubDate>Sun, 25 Aug 2024 10:04:29 GMT</pubDate>
            <atom:updated>2024-08-25T14:53:32.857Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="github greenery layout" src="https://cdn-images-1.medium.com/max/880/0*eN12ur0POphzZbZg.png" /></figure><p>Hello, Medium readers!</p><p>Today I’m excited to share a fun and practical way to automate daily commits to your GitHub repository using GitHub Actions. This process will not only keep your repository active but also add greenery to your profile 😆, all with minimal effort. Let’s dive into how you can set this up!</p><h4>Why Automate Commits?</h4><p>Automating commits might seem quirky, but it’s actually pretty useful! It keeps your GitHub repo active, lets you test GitHub Actions, and adds a bit of fun. While some might say it’s cheating, I just think it’s a clever way to keep my GitHub updated — even if I’m not around (Into this world 😆).</p><h4>What We’re Going to Achieve</h4><p>In this article, we’ll set up a GitHub Action that:</p><ol><li>Runs every day based on midnight UTC (you can run it every 5–8 min as well with regulating cron).</li><li>Creates or updates a file with a random number or with a fixed message.</li><li>Commits these changes to the repository automatically.</li></ol><p>By the end, you’ll have a repository that gets updated every day(or every 7 to 8 min if cron is set to 1 min) without you lifting a finger!(In a cheating way I guess 😆).</p><h3>Setting Up GitHub Actions</h3><p>First, we need to set up a GitHub Actions workflow in our repository. Here’s a step-by-step guide to get you started:</p><h3>1. Create a New Repository</h3><p>If you haven’t already, create a new repository on GitHub. You can name it something like DailyCommits or anything that suits your fancy.</p><h3>2. Add a Workflow File</h3><p>In your repository, create a directory called .github with a subdirectory named workflows. Inside this folder, create a file named daily_commit.yml. This file will contain our GitHub Actions workflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/207/1*IbUzyQkprSmADRpJ-4hBbg.png" /></figure><blockquote>Note : do not add commit_number.md it will generate it self</blockquote><h3>3. Define the Workflow</h3><p>Here’s the content for daily_commit.yml (any name you want):</p><pre>name: Bishwa&#39;s Daily Commit<br><br>on:<br>  schedule:<br>    - cron: &#39;0 0 * * *&#39;  # Every day at midnight UTC to runs every 7-8 min set cron to &#39;*/1 * * * *&#39;<br><br>jobs:<br>  commit:<br>    runs-on: ubuntu-latest<br><br>    steps:<br>    - name: Checkout repository<br>      uses: actions/checkout@v2<br>      with:<br>        ref: main <br><br>    - name: Create file and commit<br>      run: |<br>        FILE=&quot;commit_number.md&quot;<br>        if [ ! -f &quot;$FILE&quot; ]; then<br>          echo &quot;Hello, my name is bishwa shah&quot; &gt; &quot;$FILE&quot;<br>          echo &quot;commit number: 1&quot; &gt;&gt; &quot;$FILE&quot;<br>        else<br>          CURRENT_COUNT=$(grep -oP &#39;commit number: \K\d+&#39; &quot;$FILE&quot;)<br>          if [ -z &quot;$CURRENT_COUNT&quot; ]; then<br>            CURRENT_COUNT=0<br>          fi<br>          NEXT_COUNT=$((CURRENT_COUNT + 1))<br>          sed -i &quot;/commit number: /c\commit number: $NEXT_COUNT&quot; &quot;$FILE&quot;<br>        fi<br>        git config --global user.name &quot;beesou777&quot;<br>        git config --global user.email &quot;sbeesou@gmail.com&quot;<br>        git add &quot;$FILE&quot;<br>        git commit -m &quot;Hello, my name is bishwa shah nice to meet you&quot;<br>        git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/beesou777/mean-commit.git<br>      env:<br>        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}<br></pre><blockquote>note : make sure to change the my details with your</blockquote><h3>4. Explanation</h3><ul><li><strong>Schedule</strong>: The cron: &#39;0 0 * * *&#39; line means the action will run daily at midnight UTC. This frequency can be adjusted based on your needs.</li><li><strong>Generate commit_number</strong>: This script will create a md file with this name and commit here or just increase number.</li><li><strong>Commit and Push</strong>: It commits the changes and pushes them to your repository. The GITHUB_TOKEN ensures that the action has the necessary permissions to push changes.</li></ul><h3>5. Set Up Permissions</h3><p>Ensure that the GitHub Actions bot has the necessary permissions to commit to your repository. Go to your repository’s <strong>Settings</strong> &gt; <strong>Actions</strong> &gt; <strong>General</strong>, and make sure it has the right permissions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*qdP4EarqVM0Q9htgoT3XYw.png" /></figure><h3>Final Thoughts</h3><p>Automating daily commits might seem like a niche use case, but it’s a great way to keep your repository active and explore GitHub Actions’ capabilities. Whether you’re doing it for fun or for practical purposes, it’s a fantastic learning opportunity.</p><p>I hope you found this article helpful! If you have any questions or run into issues, feel free to leave a comment. Happy coding!</p><p>live link — <a href="https://github.com/beesou777/mean-commit">mean-commit</a></p><p>follow me on <a href="https://github.com/beesou777">github</a> and connect with me on <a href="https://www.linkedin.com/in/bishwa777/">linkedin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=804736759c1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Destructuring Arrays in JavaScript: A Deep Dive]]></title>
            <link>https://medium.com/@shahbishwa21/destructuring-arrays-in-javascript-a-deep-dive-8aaa555fb71b?source=rss-7ddcbe48defb------2</link>
            <guid isPermaLink="false">https://medium.com/p/8aaa555fb71b</guid>
            <category><![CDATA[js]]></category>
            <category><![CDATA[destructuring]]></category>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[bishwa jung shah]]></dc:creator>
            <pubDate>Thu, 22 Aug 2024 18:44:30 GMT</pubDate>
            <atom:updated>2024-08-22T18:44:30.884Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="what is array aestructuring in javascript" src="https://cdn-images-1.medium.com/max/640/0*25Ltjw-upJ4IfddD.jpg" /></figure><h4>Introduction</h4><p>Did you know how destructure works in arrays behind in JavaScript? This feature is quite powerful and can simplify how you access and work with array elements. Let’s dive into how it works.</p><h4>1. Arrays as Objects</h4><p>In JavaScript, arrays are not just lists of values; they are actually objects under the hood. This means that the JavaScript engine uses object-like structures to handle arrays.</p><ul><li><strong>Internal Representation</strong>: Each item in an array is mapped internally to an object where the index acts as the key, and the item itself is the value. For example:</li></ul><pre>const array = [&quot;apple&quot;, &quot;banana&quot;, &quot;cherry&quot;];</pre><p>Internally, this can be visualized as:</p><pre>{0: &quot;apple&quot;, 1: &quot;banana&quot;, 2: &quot;cherry&quot;}</pre><h4>2. How Destructuring Works</h4><p>Destructuring arrays allows you to extract multiple values from an array and assign them to variables in a single line. This works similarly to object destructuring because arrays are objects.</p><ul><li><strong>Basic Array Destructuring</strong>:</li></ul><pre>const [first, second, third] = [&quot;apple&quot;, &quot;banana&quot;, &quot;cherry&quot;];<br>console.log(first);  // &quot;apple&quot;<br>console.log(second); // &quot;banana&quot;<br>console.log(third); // &quot;cherry&quot;</pre><h4>3. Practical Uses of Destructuring Arrays</h4><p>Destructuring is particularly useful in various scenarios. Here are some examples:</p><ul><li><strong>Accessing Specific Elements</strong>: Suppose you have an array with elements and you want to extract specific items by index.</li></ul><pre>const fruits = [&quot;apple&quot;, &quot;banana&quot;, &quot;cherry&quot;, &quot;date&quot;, &quot;elderberry&quot;];<br>const [firstFruit, , , fourthFruit] = fruits;<br>console.log(firstFruit);  // &quot;apple&quot;<br>console.log(fourthFruit); // &quot;date&quot;</pre><p>Here, we skip the second and third elements by leaving gaps with commas.</p><ul><li><strong>Using Destructuring with Default Values</strong>: If you’re not sure if a certain index will exist, you can set default values.</li></ul><pre>const numbers = [1, 2];<br>const [first, second, third = 3] = numbers;<br>console.log(first);  // 1<br>console.log(second); // 2<br>console.log(third); // 3 (default value)</pre><p>If the array does not have a value for the third variable, it will use the default value of 3.</p><h4>4. Advanced Destructuring Example</h4><p>Destructuring can be particularly handy when working with large arrays or extracting data from nested arrays.</p><ul><li><strong>Example with Nested Arrays</strong>:</li></ul><pre>const data = [1, [2, 3], 4];<br>const [first, [second, third], fourth] = data;<br>console.log(first);  // 1<br>console.log(second); // 2<br>console.log(third);  // 3<br>console.log(fourth); // 4</pre><p>Here, we destructure data to directly access nested values.</p><h4>5. Why Destructuring is Useful</h4><p>You might wonder why not just use traditional indexing to access array elements, like:</p><pre>const price = data[2];</pre><p>Destructuring is useful because it makes your code more readable and concise. It’s especially handy when dealing with multiple values or when extracting values from arrays returned by functions or APIs.</p><ul><li><strong>Function Return Values</strong>:</li></ul><pre>function getDetails() {<br>  return [&quot;John&quot;, &quot;Doe&quot;, 30];<br>}<br><br>const [firstName, lastName, age] = getDetails();<br>console.log(firstName); // &quot;John&quot;<br>console.log(lastName);  // &quot;Doe&quot;<br>console.log(age);       // 30</pre><p>Here, destructuring makes it clear what each value represents and avoids multiple lines of code.</p><h4>Conclusion</h4><p>Destructuring arrays in JavaScript is a powerful feature that can make your code cleaner and easier to read. By understanding how arrays are internally represented as objects and using destructuring effectively, you can simplify your code and handle array data more efficiently. Give it a try in your projects and see how it can improve your coding experience!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8aaa555fb71b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>