<?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 Pankaj Kumar Meena on Medium]]></title>
        <description><![CDATA[Stories by Pankaj Kumar Meena on Medium]]></description>
        <link>https://medium.com/@pankajkmeena12?source=rss-b8bb0af9cf96------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*d8MGpRuhBUeSLSE1ijiWOg.jpeg</url>
            <title>Stories by Pankaj Kumar Meena on Medium</title>
            <link>https://medium.com/@pankajkmeena12?source=rss-b8bb0af9cf96------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 02:49:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pankajkmeena12/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[IoT Fencing System: Smart Protection for Modern Agriculture & Property Security]]></title>
            <link>https://medium.com/@pankajkmeena12/iot-fencing-system-smart-protection-for-modern-agriculture-property-security-aeb03de319f4?source=rss-b8bb0af9cf96------2</link>
            <guid isPermaLink="false">https://medium.com/p/aeb03de319f4</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[agriculture]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[iot]]></category>
            <dc:creator><![CDATA[Pankaj Kumar Meena]]></dc:creator>
            <pubDate>Fri, 20 Feb 2026 02:41:31 GMT</pubDate>
            <atom:updated>2026-02-20T02:41:31.054Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s rapidly advancing technological world, the <strong>Internet of Things (IoT)</strong> is transforming industries at an incredible pace. From smart homes and wearable devices to industrial automation and agriculture, IoT is making systems smarter, safer, and more efficient. One of the most impactful applications of IoT in rural and agricultural environments is the <strong>IoT-based Fencing System</strong>.</p><p>Traditional fencing methods have been used for decades to protect farms, houses, warehouses, and restricted areas. However, they come with limitations — no real-time alerts, manual monitoring, vulnerability to damage, and lack of intelligent tracking. With IoT-enabled fencing systems, physical boundaries are no longer just barriers — they become intelligent security networks.</p><p>This blog explores IoT fencing technology, how it works, its components, benefits, challenges, real-world applications, and future potential.</p><h3>📌 What is IoT Fencing?</h3><p>An <strong>IoT Fencing System</strong> is a smart security solution that integrates sensors, microcontrollers, wireless communication, and cloud platforms to monitor and protect a defined boundary in real time.</p><p>Unlike traditional fences that only act as passive barriers, IoT fencing systems can:</p><ul><li>Detect intrusion attempts</li><li>Send instant alerts to mobile devices</li><li>Monitor fence health</li><li>Track animals or intruders</li><li>Trigger alarms automatically</li><li>Provide remote monitoring</li></ul><p>In simple terms, IoT fencing converts a physical fence into a smart, connected security system.</p><h3>🔍 Why IoT Fencing is Needed?</h3><p>Farmers, property owners, and industries face several challenges:</p><ul><li>Crop damage by wild animals</li><li>Theft of agricultural produce</li><li>Unauthorized entry into private property</li><li>Lack of night-time monitoring</li><li>High labor cost for security</li></ul><p>Traditional electric fencing helps to some extent but lacks intelligent control and remote visibility.</p><p>IoT fencing solves these problems by providing:</p><ul><li>Automation</li><li>Real-time notifications</li><li>Data tracking</li><li>Remote control</li><li>Cost efficiency in the long term</li></ul><h3>⚙️ Core Components of an IoT Fencing System</h3><p>A typical IoT fencing system consists of the following components:</p><h3>1️⃣ Microcontroller / Processor</h3><ul><li>Arduino</li><li>ESP8266</li><li>ESP32</li><li>Raspberry Pi</li></ul><p>These act as the brain of the system.</p><h3>2️⃣ Sensors</h3><p>Different types of sensors are used based on application:</p><ul><li>Motion Sensors (PIR)</li><li>Vibration Sensors</li><li>Infrared Sensors</li><li>Magnetic Sensors</li><li>Ultrasonic Sensors</li></ul><p>These detect movement or tampering near the fence.</p><h3>3️⃣ Communication Module</h3><ul><li>Wi-Fi</li><li>GSM / GPRS</li><li>LoRa</li><li>Zigbee</li><li>NB-IoT</li></ul><p>These modules send data to cloud servers or mobile applications.</p><h3>4️⃣ Power Source</h3><ul><li>Solar Panels</li><li>Rechargeable Batteries</li><li>Direct Electricity</li></ul><p>Solar-powered IoT fencing is especially useful in remote agricultural areas.</p><h3>5️⃣ Cloud Platform</h3><p>Cloud services store and analyze data. Users can:</p><ul><li>View live status</li><li>Check alerts</li><li>Monitor system health</li><li>Control fence remotely</li></ul><h3>🧠 How IoT Fencing Works</h3><p>The working process is simple yet intelligent:</p><ol><li>Sensors detect motion, vibration, or intrusion.</li><li>The microcontroller processes the signal.</li><li>If suspicious activity is detected:</li></ol><ul><li>Alarm is triggered.</li><li>Notification is sent to the user’s mobile app.</li></ul><ol><li>Data is stored in the cloud.</li><li>User can take action remotely.</li></ol><p>For example:</p><p>If a wild animal tries to enter farmland at night, the system detects movement and instantly sends a notification to the farmer’s smartphone.</p><h3>🌾 Applications of IoT Fencing</h3><h3>🟢 Agriculture Protection</h3><ul><li>Prevent crop damage from animals</li><li>Monitor livestock boundaries</li><li>Reduce human surveillance</li></ul><h3>🏠 Residential Security</h3><ul><li>Protect private properties</li><li>Detect unauthorized entry</li></ul><h3>🏭 Industrial &amp; Warehousing</h3><ul><li>Monitor restricted areas</li><li>Prevent theft</li><li>Improve perimeter security</li></ul><h3>🏞 Forest &amp; Wildlife Monitoring</h3><ul><li>Track animal movement</li><li>Prevent poaching</li></ul><h3>📊 Benefits of IoT Fencing</h3><h3>✅ Real-Time Monitoring</h3><p>Users receive instant alerts.</p><h3>✅ Remote Accessibility</h3><p>Control fence from anywhere using mobile app.</p><h3>✅ Cost-Effective in Long Term</h3><p>Reduces need for security guards.</p><h3>✅ Data Analytics</h3><p>Tracks intrusion patterns and activity history.</p><h3>✅ Energy Efficient</h3><p>Solar-powered systems reduce electricity cost.</p><h3>🚧 Challenges in IoT Fencing</h3><p>Despite its advantages, IoT fencing faces challenges:</p><ul><li>Internet connectivity issues in rural areas</li><li>Initial installation cost</li><li>Weather-related sensor damage</li><li>Cybersecurity risks</li></ul><p>Proper design and secure communication protocols are necessary.</p><h3>🔐 Security Considerations</h3><p>Since IoT systems are connected to networks, security is crucial:</p><ul><li>Encrypted communication</li><li>Strong authentication</li><li>Regular firmware updates</li><li>Secure cloud infrastructure</li></ul><p>Without cybersecurity measures, systems can be hacked.</p><h3>💡 Future of IoT Fencing</h3><p>The future of IoT fencing looks promising with:</p><ul><li>AI-based intrusion detection</li><li>Facial recognition integration</li><li>Drone surveillance support</li><li>Predictive maintenance</li><li>Smart analytics dashboards</li></ul><p>With 5G and advanced IoT networks, smart fencing systems will become faster and more reliable.</p><h3>🌍 Impact on Smart Agriculture</h3><p>IoT fencing plays a major role in <strong>Smart Farming</strong>:</p><ul><li>Protects crops</li><li>Reduces losses</li><li>Increases productivity</li><li>Improves farmer confidence</li></ul><p>It supports the global movement toward digital agriculture and sustainable farming.</p><h3>🛠 Example Project Idea (Student / Startup Level)</h3><p>You can build a simple IoT fencing project using:</p><ul><li>ESP32</li><li>PIR Sensor</li><li>GSM Module</li><li>Buzzer</li><li>Solar Panel</li><li>Mobile Notification App</li></ul><p>Basic Logic:</p><ul><li>Detect motion</li><li>Send SMS alert</li><li>Activate buzzer</li><li>Log data on cloud</li></ul><p>This is a strong project for engineering students and agri-tech startups.</p><h3>💰 Market Opportunity</h3><p>IoT fencing has strong business potential in:</p><ul><li>Agriculture technology startups</li><li>Rural security solutions</li><li>Smart city projects</li><li>Government infrastructure</li></ul><p>With increasing awareness, demand for smart fencing solutions is rising rapidly.</p><h3>📈 Why IoT Fencing is a Game-Changer</h3><p>Traditional fencing only blocks.</p><p>IoT fencing:</p><ul><li>Detects</li><li>Analyzes</li><li>Alerts</li><li>Records</li><li>Prevents</li></ul><p>It transforms passive protection into active intelligence.</p><h3>🏁 Conclusion</h3><p>IoT fencing represents the perfect blend of agriculture, security, and modern technology. It empowers farmers, protects properties, and improves safety through real-time intelligence.</p><p>In a world where automation and smart systems are shaping the future, IoT fencing is not just an innovation — it is a necessity.</p><p>As technology becomes more affordable and internet access expands, IoT fencing systems will become a standard security solution across rural and urban landscapes.</p><p>The future is smart. The future is connected.<br> And IoT fencing is leading the way. 🌐🌾</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aeb03de319f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Life Is Not a Race — It’s a Journey of Becoming]]></title>
            <link>https://medium.com/@pankajkmeena12/life-is-not-a-race-its-a-journey-of-becoming-8594ea1ce38b?source=rss-b8bb0af9cf96------2</link>
            <guid isPermaLink="false">https://medium.com/p/8594ea1ce38b</guid>
            <category><![CDATA[advice]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[life]]></category>
            <category><![CDATA[life-lessons]]></category>
            <dc:creator><![CDATA[Pankaj Kumar Meena]]></dc:creator>
            <pubDate>Wed, 18 Feb 2026 17:48:11 GMT</pubDate>
            <atom:updated>2026-02-18T17:48:11.009Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s fast-paced world, almost everyone feels like they are running. Running for success. Running for money. Running for validation. Running to prove something — to family, society, or even themselves. But somewhere in this race, we forget one simple truth:</p><p><strong>Life is not a competition. It is a journey of becoming.</strong></p><p>We often measure our lives using milestones — job titles, salary packages, cars, houses, relationships, followers, achievements. But what if life is not about collecting trophies? What if it’s about collecting experiences, lessons, growth, and self-awareness?</p><p>Let’s pause for a moment and reflect on what life truly means.</p><h3>🌄 Life Is Unpredictable — And That’s the Beauty</h3><p>No one has a perfectly straight path. Everyone faces setbacks. Failures. Rejections. Confusion. Uncertainty.</p><p>Sometimes you work hard and still don’t get results.<br> Sometimes you deserve something but don’t receive it.<br> Sometimes people misunderstand you despite your good intentions.</p><p>But here’s the powerful truth:</p><p><strong>Life doesn’t happen to you. It happens for you.</strong></p><p>Every rejection teaches resilience.<br> Every failure builds character.<br> Every delay develops patience.</p><p>The darkest nights often prepare us for the brightest mornings.</p><h3>💭 Comparison Is the Thief of Peace</h3><p>One of the biggest reasons people feel unhappy is comparison.</p><p>You open social media and see:</p><ul><li>Someone traveling abroad</li><li>Someone getting married</li><li>Someone buying a new car</li><li>Someone getting promoted</li></ul><p>And suddenly you feel behind.</p><p>But remember — social media shows highlights, not struggles. You see the result, not the process. You see the success, not the sleepless nights. You see the smile, not the anxiety.</p><p>Everyone has a different timeline.</p><p>A tree and a flower both grow — but at different speeds. That doesn’t make one better than the other.</p><p>Your journey is unique. And it deserves respect.</p><h3>🔥 Growth Comes From Discomfort</h3><p>Comfort feels safe. But growth never happens in comfort zones.</p><p>When you:</p><ul><li>Learn a new skill</li><li>Start something from zero</li><li>Face your fears</li><li>Take responsibility</li><li>Step outside familiarity</li></ul><p>You grow.</p><p>It may feel scary. It may feel uncertain. But discomfort is a sign that you are expanding.</p><p>Think about it:</p><ul><li>Muscles grow when they are stressed.</li><li>Mind grows when it is challenged.</li><li>Character grows when tested.</li></ul><p>If life feels hard right now, maybe it’s shaping you into someone stronger.</p><h3>🧠 Mindset Shapes Reality</h3><p>Two people can face the same situation and react completely differently.</p><p>One says: “Why is this happening to me?”<br> The other says: “What is this teaching me?”</p><p>The difference? Mindset.</p><p>Life is 10% what happens to you and 90% how you respond.</p><p>If you believe:</p><ul><li>You can learn → You will grow.</li><li>You can adapt → You will survive.</li><li>You can improve → You will succeed.</li></ul><p>Your mind is powerful. Feed it positive thoughts, discipline, and belief — not fear and doubt.</p><h3>❤️ Relationships Matter More Than Success</h3><p>At the end of life, people don’t regret not buying a bigger house. They regret:</p><ul><li>Not spending time with family</li><li>Not expressing love</li><li>Not forgiving</li><li>Not appreciating moments</li></ul><p>Success feels good. But connection feels meaningful.</p><p>Call your parents.<br> Talk to your siblings.<br> Spend time with friends.<br> Express gratitude.</p><p>Because one day, you will realize — moments were the real wealth.</p><h3>⏳ Time Is the Most Valuable Asset</h3><p>Money can be earned again.<br> Opportunities can return.<br> But time never comes back.</p><p>We often say, “I’ll do it later.”</p><p>But later is not guaranteed.</p><p>Start that project.<br> Learn that skill.<br> Say sorry.<br> Say thank you.<br> Take that step.</p><p>Small consistent actions today create big changes tomorrow.</p><h3>🌧 Hard Times Build Strong People</h3><p>Everyone wants success. But not everyone is ready for the struggle behind it.</p><p>Hard times:</p><ul><li>Test your patience</li><li>Reveal true friends</li><li>Expose weaknesses</li><li>Strengthen your character</li></ul><p>You don’t grow when everything is easy. You grow when you keep going despite difficulty.</p><p>Storms don’t last forever. But they teach you how to stand firm.</p><h3>🎯 Define Your Own Success</h3><p>Society defines success as:</p><ul><li>High salary</li><li>Big house</li><li>Fancy lifestyle</li></ul><p>But what if success is:</p><ul><li>Peace of mind</li><li>Financial stability</li><li>Doing what you love</li><li>Helping others</li><li>Being proud of yourself</li></ul><p>Success is personal. Define it for yourself.</p><p>Because chasing someone else’s dream will always feel empty.</p><h3>🌿 Balance Is the Key</h3><p>Life is not just about work.<br> Life is not just about money.<br> Life is not just about ambition.</p><p>It’s about balance.</p><p>Work hard.<br> But also rest.<br> Earn money.<br> But also enjoy moments.<br> Chase goals.<br> But also protect your mental health.</p><p>Burnout is real. And no achievement is worth losing yourself.</p><h3>💡 Self-Improvement Is a Lifelong Process</h3><p>Every day, ask yourself:</p><ul><li>What did I learn today?</li><li>How did I improve?</li><li>Where can I be better?</li></ul><p>Read books.<br>Learn skills.<br>Improve communication.<br>Build discipline.</p><p>You don’t need to be perfect.<br>You just need to be better than yesterday.</p><p>1% improvement daily equals massive growth yearly.</p><h3>🙏 Gratitude Changes Everything</h3><p>Instead of focusing on what you don’t have, appreciate what you do have.</p><p>You have:</p><ul><li>A body that works</li><li>A mind that thinks</li><li>Opportunities to learn</li><li>Time to grow</li></ul><p>Gratitude shifts perspective from scarcity to abundance.</p><p>When you appreciate life, life feels lighter.</p><h3>🌟 You Are Still Becoming</h3><p>No matter where you are in life:</p><ul><li>Struggling</li><li>Starting</li><li>Confused</li><li>Growing</li><li>Rebuilding</li><li>Winning</li></ul><p>You are still becoming.</p><p>You are not behind.<br>You are not late.<br>You are not incapable.</p><p>You are in progress.</p><p>And progress is powerful.</p><h3>🌅 Final Thoughts</h3><p>Life is not about being perfect.<br>It’s about being real.<br>It’s about learning.<br>It’s about evolving.<br>It’s about loving and being loved.</p><p>There will be ups and downs. Wins and losses. Joy and pain.</p><p>But through it all, remember:</p><p>You are stronger than you think.<br>You are capable of more than you imagine.<br>And this journey — with all its twists and turns — is shaping you into someone extraordinary.</p><p>So take a deep breath.<br>Trust the process.<br>Keep moving forward.</p><p>Because your story is still being written. ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8594ea1ce38b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Data Structures & Algorithms (DSA): The Backbone of a Strong Tech Career]]></title>
            <link>https://medium.com/@pankajkmeena12/data-structures-algorithms-dsa-the-backbone-of-a-strong-tech-career-d571eb036c1b?source=rss-b8bb0af9cf96------2</link>
            <guid isPermaLink="false">https://medium.com/p/d571eb036c1b</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[dsa-courses]]></category>
            <category><![CDATA[sorting-algorithms]]></category>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Pankaj Kumar Meena]]></dc:creator>
            <pubDate>Wed, 18 Feb 2026 17:40:02 GMT</pubDate>
            <atom:updated>2026-02-18T17:40:02.261Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re preparing for product-based companies, MNCs, or aiming to become a strong software engineer, <strong>Data Structures and Algorithms (DSA)</strong> is not optional — it’s essential.</p><p>Whether you’re a frontend developer, backend engineer, or full-stack developer, DSA strengthens your problem-solving mindset and helps you write efficient, scalable code.</p><p>Let’s understand DSA in a simple and practical way.</p><h3>📌 What is DSA?</h3><h3>🔹 Data Structures</h3><p>A <strong>Data Structure</strong> is a way to organize and store data efficiently so that it can be accessed and modified easily.</p><p>Examples:</p><ul><li>Array</li><li>Linked List</li><li>Stack</li><li>Queue</li><li>Tree</li><li>Graph</li><li>HashMap</li></ul><h3>🔹 Algorithms</h3><p>An <strong>Algorithm</strong> is a step-by-step procedure to solve a problem.</p><p>Examples:</p><ul><li>Sorting algorithms (Bubble Sort, Merge Sort, Quick Sort)</li><li>Searching algorithms (Binary Search)</li><li>Recursion</li><li>Dynamic Programming</li></ul><p>👉 In simple words:</p><blockquote><em>Data Structures store data.<br> Algorithms process data.</em></blockquote><h3>💡 Why is DSA Important?</h3><h3>1️⃣ Cracking Technical Interviews</h3><p>Companies like Google, Amazon, Microsoft, and other product-based companies heavily focus on DSA.</p><p>They test:</p><ul><li>Problem-solving ability</li><li>Logical thinking</li><li>Optimization skills</li><li>Time &amp; Space complexity understanding</li></ul><h3>2️⃣ Writing Efficient Code</h3><p>Without DSA knowledge:</p><ul><li>Your code may work</li><li>But it may not scale</li></ul><p>With DSA knowledge:</p><ul><li>You choose the right data structure</li><li>You reduce time complexity</li><li>You build optimized systems</li></ul><h3>3️⃣ Improves Thinking Ability</h3><p>DSA trains your brain to:</p><ul><li>Break big problems into small parts</li><li>Think in patterns</li><li>Optimize solutions</li></ul><h3>📊 Important DSA Topics (Roadmap)</h3><p>Here’s a beginner-to-advanced roadmap:</p><h3>🟢 Beginner Level</h3><ul><li>Time &amp; Space Complexity (Big O)</li><li>Arrays</li><li>Strings</li><li>Recursion</li><li>Basic Sorting</li><li>Binary Search</li></ul><h3>🟡 Intermediate Level</h3><ul><li>Linked List</li><li>Stack</li><li>Queue</li><li>Hashing</li><li>Two Pointer Technique</li><li>Sliding Window</li></ul><h3>🔵 Advanced Level</h3><ul><li>Trees</li><li>Binary Search Trees</li><li>Heaps</li><li>Graphs</li><li>Dynamic Programming</li><li>Greedy Algorithms</li><li>Backtracking</li><li>Tries</li></ul><h3>⏳ What is Time Complexity?</h3><p>Time complexity tells us how fast an algorithm runs.</p><p>Examples:</p><ul><li><strong>O(1)</strong> → Constant Time</li><li><strong>O(n)</strong> → Linear Time</li><li><strong>O(log n)</strong> → Logarithmic Time</li><li><strong>O(n²)</strong> → Quadratic Time</li></ul><p>👉 In interviews, optimizing from <strong>O(n²)</strong> to <strong>O(n log n)</strong> can make a huge difference.</p><h3>🛠 Best Platforms to Practice DSA</h3><ul><li>LeetCode</li><li>CodeStudio</li><li>GeeksforGeeks</li><li>CodeChef</li><li>HackerRank</li></ul><p>Practice strategy:</p><ul><li>Solve 2–3 problems daily</li><li>Focus on patterns</li><li>Revise mistakes</li><li>Don’t just see solutions — understand the</li></ul><h3>📅 90-Day DSA Preparation Plan</h3><h3>Month 1:</h3><ul><li>Arrays</li><li>Strings</li><li>Recursion</li><li>Basic Problems</li></ul><h3>Month 2:</h3><ul><li>Linked List</li><li>Stack</li><li>Queue</li><li>Binary Search</li><li>Hashing</li></ul><h3>Month 3:</h3><ul><li>Trees</li><li>Graphs</li><li>Dynamic Programming</li><li>Mixed Interview Questions</li></ul><h3>❌ Common Mistakes Students Make</h3><ul><li>Watching too many tutorials without practice</li><li>Memorizing solutions</li><li>Ignoring time complexity</li><li>Quitting after getting stuck</li></ul><p>Remember:</p><blockquote><em>Struggling with problems is part of the learning process.</em></blockquote><h3>🎯 Final Advice</h3><p>If you are not getting job calls despite applying, DSA might be the missing piece.</p><p>Companies want engineers who:</p><ul><li>Think logically</li><li>Optimize solutions</li><li>Solve unseen problems</li></ul><p>Start small. Stay consistent.<br> Even 2 hours daily for 6 months can change your career.</p><h3>🔥 Conclusion</h3><p>DSA is not just for interviews — it builds your thinking foundation.</p><p>If you want:</p><ul><li>High-paying jobs</li><li>Product-based company roles</li><li>Strong problem-solving skills</li></ul><p>Then start DSA today.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d571eb036c1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Why Next.js Is Dominating Modern Web Development in 2026]]></title>
            <link>https://medium.com/@pankajkmeena12/why-next-js-is-dominating-modern-web-development-in-2026-4c5f32699a74?source=rss-b8bb0af9cf96------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c5f32699a74</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Pankaj Kumar Meena]]></dc:creator>
            <pubDate>Thu, 12 Feb 2026 19:23:20 GMT</pubDate>
            <atom:updated>2026-02-12T19:23:20.478Z</atom:updated>
            <content:encoded><![CDATA[<p>For years, React has been the king of frontend development. But React alone is no longer enough. Modern applications need:</p><ul><li>⚡ Fast performance</li><li>🔍 SEO optimization</li><li>🌍 Server-side rendering</li><li>📦 API handling</li><li>🚀 Scalability</li></ul><p>And that’s where <strong>Next.js</strong> changes the game.</p><h3>🔥 The Problem With Traditional React Apps</h3><p>If you’ve built apps using Create React App or Vite, you know :</p><ul><li>Everything renders on the client</li><li>SEO is weak</li><li>First load can be slow</li><li>Manual routing setup</li><li>No built-in backend layer</li></ul><p>This works for dashboards. But not for :</p><ul><li>E-commerce</li><li>Blogs</li><li>SaaS platforms</li><li>Marketplaces</li><li>SEO-driven websites</li></ul><h3>⚡ What Makes Next.js Powerful?</h3><p>Next.js is not just a framework.</p><p>It’s a <strong>full-stack React framework</strong>.</p><h3>1️⃣ Hybrid Rendering (SSR + SSG + ISR)</h3><p>Next.js lets you choose :</p><ul><li><strong>SSR (Server-Side Rendering)</strong> → Dynamic pages</li><li><strong>SSG (Static Site Generation)</strong> → Blazing fast static pages</li><li><strong>ISR (Incremental Static Regeneration)</strong> → Update static pages without redeploy</li></ul><p>This flexibility is massive for performance.</p><h3>2️⃣ App Router &amp; Server Components</h3><p>The new App Router introduced :</p><ul><li>Layout-based routing</li><li>Nested routes</li><li>Streaming</li><li>React Server Components</li></ul><p>Server Components reduce:</p><ul><li>Bundle size</li><li>Client JavaScript</li><li>Hydration cost</li></ul><p>Which means:<br> 👉 Faster load time<br> 👉 Better Lighthouse score<br> 👉 Better SEO</p><h3>3️⃣ Built-in API Routes (Backend Inside Frontend)</h3><p>With Next.js, you don’t always need a separate backend.</p><p>You can create:</p><pre>// app/api/route.js<br>export async function GET() {<br>  return Response.json({ message: &quot;Hello World&quot; });<br>}</pre><p>Now your frontend and backend live together.</p><p>Perfect for :</p><ul><li>Authentication</li><li>Small SaaS apps</li><li>Prototypes</li><li>Admin dashboards</li></ul><h3>4️⃣ Edge Functions &amp; Performance</h3><p>Next.js supports :</p><ul><li>Edge Runtime</li><li>Middleware</li><li>Global deployment with Vercel</li></ul><p>Your app can run closer to users worldwide.</p><p>That’s real scalability.</p><h3>📊 Performance Comparison (React vs Next.js)</h3><p>Feature React (CRA/Vite) Next.js SEO❌ Weak✅ StrongSSR❌ No✅ Yes Routing Manual File-based API Separate backend Built in Performance Client heavy Optimized</p><p>Next.js solves real production problems.</p><h3>Real-World Use Cases</h3><p>Next.js is ideal for :</p><ul><li>E-commerce websites</li><li>Travel platforms</li><li>Blogs &amp; Media sites</li><li>SaaS dashboards</li><li>Portfolio websites</li><li>Marketplaces</li></ul><p>If you’re building something serious — Next.js is the better choice.</p><h3>🧠 When NOT to Use Next.js</h3><p>Be practical. Don’t use Next.js for:</p><ul><li>Small internal dashboards</li><li>Basic static landing pages</li><li>Simple React widgets</li></ul><p>Sometimes Vite + React is enough. Choose tools based on need, not hype.</p><h3>🎯 Final Thoughts</h3><p>Next.js is not just a trend. It represents the shift toward:</p><ul><li>Full-stack JavaScript</li><li>Performance-first architecture</li><li>Hybrid rendering models</li><li>Developer productivity</li></ul><p>If you’re preparing for product-based companies or building scalable projects, learning Next.js deeply gives you an edge.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c5f32699a74" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Travel Isn’t About Places, It’s About Perspective]]></title>
            <link>https://medium.com/@pankajkmeena12/travel-isnt-about-places-it-s-about-perspective-07908592874c?source=rss-b8bb0af9cf96------2</link>
            <guid isPermaLink="false">https://medium.com/p/07908592874c</guid>
            <category><![CDATA[travel]]></category>
            <category><![CDATA[tourism]]></category>
            <category><![CDATA[tours-and-travels]]></category>
            <category><![CDATA[tour]]></category>
            <category><![CDATA[the-culture-trip]]></category>
            <dc:creator><![CDATA[Pankaj Kumar Meena]]></dc:creator>
            <pubDate>Sun, 01 Feb 2026 11:26:27 GMT</pubDate>
            <atom:updated>2026-02-01T11:26:27.952Z</atom:updated>
            <content:encoded><![CDATA[<h3>A lesson I learned on the road with The Trip Culture</h3><p>Travel is often sold as a checklist.<br> Cities to cover.<br> Photos to post.<br> Hotels to review.</p><p>But the more I travel, the more I realise something uncomfortable and beautiful at the same time:</p><p><strong>Travel isn’t about where you go. It’s about how you start seeing the world differently.</strong></p><p>That’s the philosophy behind <strong>The Trip Culture</strong>.</p><h3>When Travel Stops Being a Vacation</h3><p>My first few trips were simple.<br> Book tickets. Pack bags. Come back with photos.</p><p>But one journey changed that.</p><p>I remember sitting in a quiet mountain village, phone battery at 2%, no network, no plan for the next day. For the first time, I wasn’t rushing to <em>capture</em> the moment — I was actually <em>living</em> it.</p><p>No reels.<br>No stories.<br>No pressure.</p><p>Just me, cold air, and a cup of chai.</p><p>That’s when travel stopped feeling like an escape and started feeling like <strong>education</strong>.</p><h3>What Travel Really Teaches You</h3><p>Travel teaches lessons no book can:</p><ul><li><strong>Patience</strong> — when buses are late and plans fail</li><li><strong>Humility</strong> — when you realise how little you actually need</li><li><strong>Empathy</strong> — when you meet lives completely different from yours</li><li><strong>Presence</strong> — when moments matter more than Wi-Fi</li></ul><p>You don’t just visit places.<br>Places visit you back.</p><p>They change how you think.<br>How you spend.<br>How you dream.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZpLbWXLdUjHT40ftwLC6qg.png" /></figure><h3>The Problem With “Perfect” Travel Online</h3><p>Let’s be honest.</p><p>Social media shows travel as:</p><ul><li>Luxury hotels</li><li>Perfect angles</li><li>Non-stop enjoyment</li></ul><p>What it hides:</p><ul><li>Missed trains</li><li>Unexpected weather</li><li>Lonely nights</li><li>Budget struggles</li></ul><p>At <a href="https://www.thetripculture.com/"><strong>The Trip Culture</strong></a>, we don’t believe in fake perfection.</p><p>We believe in <strong>real travel</strong> — the good, the messy, and the unforgettable.</p><p>Because that’s where growth happens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HwhXyeAelzqD_kpT79IPSg.png" /></figure><h3>Why The Trip Culture Exists</h3><p>The Trip Culture isn’t just a travel page.<br> It’s a mindset.</p><p>We exist for:</p><ul><li>People who travel to <strong>feel</strong>, not just post</li><li>Explorers who care about <strong>stories</strong>, not trends</li><li>Travelers who believe journeys change you</li></ul><p>We focus on:</p><ul><li>Authentic destinations</li><li>Real experiences</li><li>Honest travel guidance</li><li>Culture before luxury</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NnMpX8clm3PXNyPFOEDWDg.png" /></figure><p>If travel hasn’t changed you, you haven’t traveled deeply enough.</p><h3>Your Next Trip Might Change More Than Your Location</h3><p>You don’t need a foreign country to transform yourself.<br> Sometimes, all it takes is:</p><ul><li>A new road</li><li>A new conversation</li><li>A new way of looking at familiar places</li></ul><p>Travel doesn’t add stamps to your passport.<br> It removes limits from your thinking.</p><p>And that’s the culture we stand for.</p><h3>🌍 <strong>Follow the journey with The Trip Culture</strong><br> Where travel is not just about going somewhere — <br> <strong>it’s about becoming someone new.</strong></h3><p>📸 Instagram: <a href="https://www.instagram.com/thetrip_culture/"><strong>@thetripculture</strong></a><br> 🌐 Website: <a href="http://www.thetripculture.com/"><strong>www.thetripculture.com</strong></a><br> ✈️ Real stories | Hidden places | Authentic travel</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=07908592874c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Tag Manager with Next.js]]></title>
            <link>https://medium.com/@pankajkmeena12/google-tag-manager-with-next-js-0d4fa6ad9019?source=rss-b8bb0af9cf96------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d4fa6ad9019</guid>
            <dc:creator><![CDATA[Pankaj Kumar Meena]]></dc:creator>
            <pubDate>Fri, 11 Oct 2024 18:51:23 GMT</pubDate>
            <atom:updated>2024-10-11T18:51:23.081Z</atom:updated>
            <content:encoded><![CDATA[<p>How to track and manage your next.js application’s analytics without adding extra bulk to your code? In this blog post, I’ll guide you through the advantages of using Google Tag Manager with Next.js, showing you not just the “how” but also the “why.” We’ll cover setting it up step-by-step, optimizing your tracking strategies, and using these insights to enhance user experience and engagement. So let’s make your Next.js app not just functional but also analytically powerful!</p><h3>Google Tag Manager and Next.js</h3><p>The integration of the popular framework, Next.js, and Google’s Tag Manager (GTM) is something many developers come across.</p><p><strong>So what is </strong><a href="https://tagmanager.google.com/"><strong>Google Tag Manager</strong></a><strong>? </strong>GTM is a free tool from Google that website owners use to integrate and manage so-called tags (Google Tag Manager snippets of code or tracking pixels) on a website (or mobile app). This way, you can measure and track user interactions.</p><p>Want to know more? Read the <a href="https://caisy.io/blog/google-tag-manager-uses">full article</a> on what Google Tag Manager is used for.</p><p><strong>And what is </strong><a href="https://nextjs.org/"><strong>next.js</strong></a><strong>?</strong> It’s a React-based JavaScript framework developers use to build server-side rendering and static web applications. Popular <a href="https://caisy.io/blog/why-use-next-js">reasons for next.js</a> are that it improves the performance of React apps and provides SEO benefits. Next.js also offers features like pre-rendering, automatic code splitting and static exporting options that developers appreciate.</p><p>When it comes to client-side navigation in Next.js is, a request for a new page does not require a full page reload from the server. The Next.js Link component enables client-side navigation between two pages in the same Next.js app. It pre-fetches the linked page’s code in the background and swaps the old page with the new one on click. This leads to a seamless user experience mimicking a single-page application.</p><h3>Why use GTM with Next.js</h3><p>Integrating Google Tag Manager with Next.js helps you track what users do on your site. Knowing user behavior is key for any modern web app because it helps you understand your audience better and make <a href="https://caisy.io/blog/building-efficient-data-driven-applications">data-driven decisions</a>. GTM makes this task easier by letting you manage all your tracking codes centralized, without having to modify your project’s code directly.</p><p>Another big benefit is how well GTM works with Next.js, especially since Next.js handles page changes differently than traditional websites. Normally, GTM doesn’t catch these user movements because they don’t involve reloading the page. But by setting up GTM with a history change trigger, you can make sure every single page visit gets tracked, even those that happen without a page reload.</p><p>In the following sections, we’ll explore how to get GTM working perfectly with Next.js. We’ll go over how to set everything up, give you code snippets to use, where to add google tag manager code and show you how to track user moves effectively.</p><p>Working with another framework?</p><p>Here are the guides for implementing <a href="https://caisy.io/blog/svelte-applications-with-google-tag-manager">GTM with Svelte </a>and <a href="https://caisy.io/blog/google-tag-manager-with-nuxt.js">GTM with Nuxt.js</a>.</p><h3>Google Tag Manager Next.js Integration Guide</h3><p>Here begins the work! A step-by-step guide will make sure you get everything right when implementing GTM in your Next.js project.</p><p>Make sure you have installed up-to-date versions of Node.js and npm. Also, don’t forget to create your Google Tag Manager account and have your GTM Container ID ready.</p><h3>How to Add GTM Script to Your App</h3><p>Let’s begin with an important question: Where to add google tag manager code? Place the GTM script in a file that won’t be tree-shaken away. Add the Google Tag Manager code in both the &lt;head&gt; and &lt;body&gt; sections of your _document.js file:</p><pre>&lt;head&gt;<br>    {(process.env.NODE_ENV === &#39;production&#39;) &amp;&amp;<br>        &lt;script dangerouslySetInnerHTML={{<br>            __html: `(function (w, d, s, l, i) {<br>                    w[l] = w[l] || []; w[l].push({ &#39;gtm.start&#39;: new Date().getTime(), event: &#39;gtm.js&#39; });<br>                    var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != &#39;dataLayer&#39; ? &#39;&amp;l=&#39; + l : &#39;&#39;;<br>                    j.async = true; j.src = &#39;https://www.googletagmanager.com/gtm.js?id=&#39; + i + dl; f.parentNode.insertBefore(j, f);<br>                })(window, document, &#39;script&#39;, &#39;dataLayer&#39;, &#39;GTM-XXXXXX&#39;);`<br>        }}&gt;&lt;/script&gt;<br>    }<br>&lt;/head&gt;<br><br>&lt;body&gt;<br>    {(process.env.NODE_ENV === &#39;production&#39;) &amp;&amp;<br>        &lt;noscript dangerouslySetInnerHTML={{<br>            __html: `&lt;iframe src=&quot;https://www.googletagmanager.com/ns.html?id=GTM-XXXXX&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;display:none;visibility:hidden&quot;&gt;&lt;/iframe&gt;`<br>        }}&gt;&lt;/noscript&gt;<br>    }<br>&lt;/body&gt;ja</pre><h3>Client-Side Navigation Tracking in Next.js with GTM</h3><p>A common challenge when using Google Tag Manager with Next.js is that <a href="https://caisy.io/blog/google-tag-manager-analytics">Google Analytics</a> might not track page views during internal navigations. This issue arises because Next.js’s client-side routing doesn’t trigger the browser’s usual ‘load’ event that Google Analytics typically relies on for tracking.</p><p>To solve this, here’s how to set up this ‘history change’ trigger in GTM I talked about earlier:</p><ol><li>Open your GTM dashboard.</li><li>Go to ‘Triggers’, then click on ‘New’.</li><li>Select ‘Trigger Configuration’ and choose ‘History Change’.</li><li>Save your new trigger.</li></ol><p>This trigger will catch every instance of client-side navigation by listening for changes in the browser’s history.</p><p>Additionally, make sure your GTM is firing correctly with each page change. This might involve tweaking your Next.js _app.js file to manually push data to GTM upon route changes, using Next.js&#39;s router events. By adding a few lines of JavaScript, you can ensure that every navigation event, even those that don&#39;t reload the page, is captured and sent to Google Analytics.</p><h3>Optimizing Google Tag Manager Integration in Next.js</h3><p>After we covered the basics, in this section you’ll learn the advanced use of the Next.js Script component and strategic approaches to script loading. With these techniques you can ensure optimal performance and user experience.</p><h4>Utilizing the Next.js Script Component</h4><p><strong>Basic Setup:</strong> The Script component is a flexible tool in Next.js that facilitates better control over third-party script loading. To integrate GTM using the Script component:</p><pre>import Script from &#39;next/script&#39;;<br><br>function MyApp() {<br>  return (<br>    &lt;&gt;<br>      &lt;Script<br>        src=&quot;https://www.googletagmanager.com/gtm.js?id=GTM-XXXXXX&quot;<br>        strategy=&quot;afterInteractive&quot;<br>      /&gt;<br>      {/* Additional scripts and application components */}<br>    &lt;/&gt;<br>  );<br>}</pre><p>This example uses the afterInteractive strategy, which loads GTM after the page becomes interactive to avoid any impact on the critical rendering path.</p><p><strong>Advanced Loading Strategies</strong></p><ul><li><strong>beforeInteractive:</strong> Use this for critical scripts that need to load before the page becomes interactive, like early analytics or bot detection scripts.</li><li><strong>lazyOnload:</strong> Ideal for scripts that are not critical on initial load, such as chatbots or social media feeds, improving load times by executing scripts when the browser is idle.</li></ul><h3>Performance Optimization Tips</h3><p><strong>Deferring Non-Essential Scripts:</strong></p><p>To prevent non-essential scripts from blocking the main thread, use the lazyOnloadstrategy. This approach delays loading until it&#39;s absolutely necessary, which is crucial for maintaining fast, responsive interactions.</p><p><strong>Preconnect and DNS Prefetch:</strong></p><p>Speed up the connection to third-party domains by adding preconnect or dns-prefetch links in your Next.js &lt;Head&gt; component:</p><pre>&lt;Head&gt;<br>  &lt;link rel=&quot;preconnect&quot; href=&quot;https://www.googletagmanager.com&quot; /&gt;<br>  &lt;link rel=&quot;dns-prefetch&quot; href=&quot;https://www.googletagmanager.com&quot; /&gt;<br>&lt;/Head&gt;</pre><p>These hints help the browser to establish early connections, reducing the time to fetch the script when it’s needed.</p><h3>Practical Implementation and Handling Script Events</h3><p><strong>Implementing GTM with Event Handling:</strong></p><p>The Script component also supports event handlers such as onLoad and onError, which can be used to handle the loading status of the script:</p><pre>&lt;Script<br>  src=&quot;https://www.googletagmanager.com/gtm.js?id=GTM-XXXXXX&quot;<br>  strategy=&quot;afterInteractive&quot;<br>  onLoad={() =&gt; console.log(&#39;GTM script loaded successfully&#39;)}<br>  onError={(e) =&gt; console.error(&#39;Error loading GTM script&#39;, e)}<br>/&gt;</pre><p>These handlers ensure you can track the load status and catch any errors, providing more robust error handling for your scripts.</p><p>By strategically using the Script component and optimizing the loading of Google Tag Manager in Next.js, you can ensure your next.js-applications are rich in functionality AND optimized for performance. These techniques align with <a href="https://caisy.io/blog/web-development-trends-2024">best practices for modern web development</a>, providing a balance between powerful analytics and user-centric performance.</p><p>For a more detailed exploration of the Next.js Script component and additional optimization tips, visit the Next.js <a href="https://nextjs.org/docs/basic-features/script">Documentation on the Script Component.</a></p><h3>Advanced Integration Techniques for GTM with Next.js</h3><p>Integrating Google Tag Manager (GTM) with Next.js effectively also involves overcoming several common challenges. This section will dive deeper into thes key issues, offering solutions and best practices.</p><h3>Accurate Page View Tracking on Client-Side Navigations</h3><p>A challenge in Next.js applications is tracking page views during client-side navigation, as these do not trigger traditional page reloads. To capture these movements accurately:</p><ol><li><strong>Utilize Next.js Router Events with GTM:</strong></li></ol><pre>import { useEffect } from &#39;react&#39;;<br>import { useRouter } from &#39;next/router&#39;;</pre><pre>const usePageViewTracking = () =&gt; {<br>  const router = useRouter();<br>  useEffect(() =&gt; {<br>    const handleRouteChange = (url) =&gt; {<br>      window.dataLayer.push({<br>        event: &#39;page_view&#39;,<br>        page: url,<br>      });<br>    };</pre><pre>    router.events.on(&#39;routeChangeComplete&#39;, handleRouteChange);<br>    return () =&gt; {<br>      router.events.off(&#39;routeChangeComplete&#39;, handleRouteChange);<br>    };<br>  }, [router.events]);<br>};</pre><pre>export default usePageViewTracking;</pre><ol><li><strong>Utilize in App/Layout:</strong> Place the GA4Provider component within your app/layout.tsx to ensure it renders on every page, capturing all navigation events.</li></ol><h3>Resolving Google Analytics Tag Firing Issues</h3><p>Misfires in Google Analytics tags can lead to inaccurate data collection. Here’s how to solve common firing issues:</p><ol><li><strong>Ensure Single Implementation per Page:</strong> Make sure the GTM script is implemented once per page, typically in the _app.js for Next.js. Avoid duplications in _document.js or any layout components.</li><li><strong>Set Up a ‘History Change’ Trigger in GTM:</strong> Configure your GTM to include a ‘History Change’ trigger, which helps track client-side navigations effectively:</li></ol><pre>&lt;Script strategy=&quot;afterInteractive&quot;&gt;<br>  (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({&#39;gtm.start&#39;:<br>  new Date().getTime(),event:&#39;gtm.js&#39;});var f=d.getElementsByTagName(s)[0],<br>  j=d.createElement(s),dl=l!=&#39;dataLayer&#39;?&#39;&amp;l=&#39;+l:&#39;&#39;;j.async=true;j.src=<br>  &#39;https://www.googletagmanager.com/gtm.js?id=&#39;+i+dl;f.parentNode.insertBefore(j,f);<br>  })(window,document,&#39;script&#39;,&#39;dataLayer&#39;,&#39;GTM-XXXX&#39;);<br>&lt;/Script&gt;</pre><h3>Integrating GTM and Next.js 14 with App Router</h3><p>Integrating Google Tag Manager (GTM) into Next.js 14 applications, especially with the new App Router, requires a tailored approach to ensure every page navigation is tracked accurately. Here’s an updated method to integrate GTM effectively using client components and the latest Next.js features. Here’s a detailed guide on the <a href="https://caisy.io/blog/nextjs-app-router-guide">Next.js App Router</a>.</p><p><strong>Creating a Client Component for Universal Page Tracking</strong></p><p>In Next.js 14, leveraging the App Router allows for a more seamless integration of client-side tools like GTM. To set this up, create a client-side component that utilizes the usePathname hook from next/navigation. This hook provides the current path, enabling the tracking of page views as users navigate through your application:</p><pre>// components/GA4Provider.js<br>&quot;use client&quot;;</pre><pre>import { usePathname } from &quot;next/navigation&quot;;<br>import { useEffect } from &quot;react&quot;;</pre><pre>export const GA4Provider = () =&gt; {<br>  const pathname = usePathname();</pre><pre>  useEffect(() =&gt; {<br>    window.dataLayer = window.dataLayer || [];<br>    window.dataLayer.push({<br>      event: &quot;page_view&quot;,<br>      page: window.location.href,<br>    });<br>  }, [pathname]);</pre><pre>  return null;<br>};</pre><p><strong>Implementation in the App Layout</strong></p><p>Integrate the GA4Provider component within your app/layout.tsx to ensure it renders on every page load, effectively capturing every client-side navigation:</p><pre>// pages/app/layout.tsx<br>import GA4Provider from &#39;../components/GA4Provider&#39;;</pre><pre>const Layout = ({ children }) =&gt; {<br>  return (<br>    &lt;&gt;<br>      &lt;GA4Provider /&gt;<br>      {children}<br>    &lt;/&gt;<br>  );<br>};</pre><pre>export default Layout;</pre><p>This setup ensures that the GA4Provider component tracks all navigation changes across the site without additional configuration for each page or component.</p><h3>Advanced Analytics Component for Production Environments</h3><p>To handle environments dynamically and ensure analytics scripts only load in production, you can create an Analyticscomponent. This component will conditionally load the GTM script based on the environment, preventing analytics tracking during development:</p><pre>// components/Analytics.js<br>import Script from &#39;next/script&#39;;</pre><pre>const Analytics = () =&gt; {<br>  if (process.env.NODE_ENV === &#39;production&#39;) {<br>    return (<br>      &lt;Script<br>        src={`https://www.googletagmanager.com/gtag/js?id=${process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS}`}<br>        strategy=&#39;afterInteractive&#39;<br>      &gt;<br>        {`<br>          window.dataLayer = window.dataLayer || [];<br>          function gtag(){dataLayer.push(arguments);}<br>          gtag(&#39;js&#39;, new Date());<br>          gtag(&#39;config&#39;, &#39;${process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS}&#39;);<br>        `}<br>      &lt;/Script&gt;<br>    );<br>  }<br>  return null;<br>};</pre><pre>export default Analytics;</pre><p>This component uses Next.js’s Script component with the afterInteractive strategy. This way, the analytics script does not impact the initial load performance.</p><h3>Using the @next/third-parties Library</h3><p>The @next/third-parties library can be a valuable addition to your Next.js project for managing third-party scripts like GTM. It helps streamline the integration process and ensures better performance by handling script loading efficiently.</p><p><strong>Integrating @next/third-parties for GTM</strong></p><p>Here’s how you can utilize the @next/third-parties library to integrate GTM:</p><ol><li>Install the Library:</li></ol><pre>npm install @next/third-parties</pre><ol><li>Use the Library to Load GTM:</li></ol><pre>import { ThirdParty } from &#39;@next/third-parties&#39;;<br>import { useEffect } from &#39;react&#39;;<br>import { useRouter } from &#39;next/router&#39;;</pre><pre>const GTM = () =&gt; {<br>  const router = useRouter();</pre><pre>  useEffect(() =&gt; {<br>    const handleRouteChange = (url) =&gt; {<br>      window.dataLayer = window.dataLayer || [];<br>      window.dataLayer.push({<br>        event: &#39;page_view&#39;,<br>        page: url,<br>      });<br>    };</pre><pre>    router.events.on(&#39;routeChangeComplete&#39;, handleRouteChange);<br>    return () =&gt; {<br>      router.events.off(&#39;routeChangeComplete&#39;, handleRouteChange);<br>    };<br>  }, [router.events]);</pre><pre>  return (<br>    &lt;ThirdParty<br>      src={`https://www.googletagmanager.com/gtm.js?id=${process.env.NEXT_PUBLIC_GOOGLE_TAG_MANAGER}`}<br>      strategy=&quot;afterInteractive&quot;<br>    /&gt;<br>  );<br>};</pre><pre>export default GTM;</pre><p>The @next/third-parties library makes handling third-party scripts easy. It helps your scripts load at the perfect time without slowing down your site.</p><h3>Debugging GTM Implementation in Next.js</h3><p>Here’s how you can effectively debug and optimize your setup:</p><h4>Using GTM Preview Mode and GA Debugger</h4><p><strong>GTM Preview Mode</strong> is an essential tool for debugging. It lets you test tags, triggers, and variables in real-time without affecting the live environment. To use it, simply activate Preview Mode in your GTM dashboard and navigate your site to see how tags are firing. This mode has been enhanced to work without third-party cookies, which means it now functions seamlessly across all modern browsers, including those that block such cookies by default​​.</p><p><strong>Google Analytics Debugger</strong>, available as a Chrome extension, is another great tool that logs detailed information about GA events, helping you pinpoint discrepancies or configuration issues​​.</p><h4>Leveraging Browser Developer Tools</h4><p>Browser tools like Chrome DevTools are invaluable for debugging GTM:</p><ul><li><strong>Console</strong>: Check for JavaScript errors or warnings that might affect GTM.</li><li><strong>Network</strong>: Ensure tracking data is sent correctly to Google Analytics or other endpoints.</li><li><strong>Elements</strong>: Verify the correct placement and execution of GTM container code.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d4fa6ad9019" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Transpose a two dimensional (2D) array in JavaScript]]></title>
            <link>https://medium.com/@pankajkmeena12/transpose-a-two-dimensional-2d-array-in-javascript-e4e1bd4c4137?source=rss-b8bb0af9cf96------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4e1bd4c4137</guid>
            <dc:creator><![CDATA[Pankaj Kumar Meena]]></dc:creator>
            <pubDate>Wed, 24 Jan 2024 02:03:20 GMT</pubDate>
            <atom:updated>2024-01-24T02:06:35.398Z</atom:updated>
            <content:encoded><![CDATA[<p>Given a 2D array (matrix) and the task is to get the transpose of the matrix using <a href="https://www.geeksforgeeks.org/javascript/">JavaScript</a>.</p><p>We can do this by using the following methods:</p><ul><li><strong>Uses the </strong><a href="https://www.geeksforgeeks.org/javascript-array-map-method/"><strong>array.map()</strong></a></li><li><strong>Using the nested loop</strong></li><li><strong>Using </strong><a href="https://www.geeksforgeeks.org/javascript-array-reduce-method/"><strong>reduce() Method</strong></a></li></ul><h3>Approach 1: Uses the <a href="https://www.geeksforgeeks.org/javascript-array-map-method/">array.map()</a></h3><ul><li>Store a 2D array into a variable.</li><li>Display the 2D array (matrix) content.</li><li>Call map() method which provides a callback function single time for every element in an array, maintaining the order and returns a new array (transpose of the original array) from the results.</li></ul><p><strong>Example: </strong>This example uses the <a href="https://www.geeksforgeeks.org/javascript-array-map-method/"><strong>array.map()</strong></a> method to get the transpose of the array.</p><pre>let array = [<br>  [1, 1, 1],<br>  [2, 2, 2],<br>  [3, 3, 3],<br>];<br>console.log(&quot;[ [ &quot; + array[0] + &quot; ] ], [ [ &quot; + array[1] + &quot; ] ], [ [ &quot; + array[2] + &quot; ] ]&quot;);<br>function transpose(mat) {<br>  for (let i = 0; i &lt; mat.length; i++) {<br>    for (let j = 0; j &lt; i; j++) {<br>      const tmp = mat[i][j];<br>      mat[i][j] = mat[j][i];<br>      mat[j][i] = tmp;<br>    }<br>  }<br>}<br>function arrayTranspose() {<br>  array = array[0].map((col, i) =&gt; array.map((row) =&gt; row[i]));<br>  console.log(&quot;[ [ &quot; + array[0] + &quot; ] ], [ [ &quot; + array[1] + &quot; ] ], [ [ &quot; + array[2] + &quot; ] ]&quot;);<br>}<br>arrayTranspose();</pre><p><strong>Output</strong></p><pre>[ [ 1,1,1 ] ], [ [ 2,2,2 ] ], [ [ 3,3,3 ] ]<br>[ [ 1,2,3 ] ], [ [ 1,2,3 ] ], [ [ 1,2,3 ] ]</pre><h3>Approach 2: Using the nested loop</h3><ul><li>Store a 2D array into a variable.</li><li>Replace every element in the array with its mirror image with respect to the diagonal of the array.</li></ul><p><strong>Example: </strong>This example creates a function that replaces every element with its mirror image to get the transpose of the array.</p><pre>let array = [<br> [1, 1, 1],<br> [2, 2, 2],<br> [3, 3, 3],<br>];<br>console.log(&quot;[ [ &quot; + array[0] <br> + &quot; ] ], [ [ &quot; + array[1] <br> + &quot; ] ], [ [ &quot; + array[2] <br> + &quot; ] ]&quot;);<br>function transpose(mat) {<br> for (let i = 0; i &lt; mat.length; i++) {<br> for (let j = 0; j &lt; i; j++) {<br> const tmp = mat[i][j];<br> mat[i][j] = mat[j][i];<br> mat[j][i] = tmp;<br> }<br> }<br>}<br>function arrayTranspose() {<br> transpose(array);<br> console.log(&quot;[ [ &quot; + array[0] <br> + &quot; ] ], [ [ &quot; + array[1] <br> + &quot; ] ], [ [ &quot; + array[2] <br> + &quot; ] ]&quot;);<br>}<br>arrayTranspose();</pre><p>Output:</p><pre>[ [ 1,1,1 ] ], [ [ 2,2,2 ] ], [ [ 3,3,3 ] ]<br>[ [ 1,2,3 ] ], [ [ 1,2,3 ] ], [ [ 1,2,3 ] ]</pre><h3>Approach 3: Using <a href="https://www.geeksforgeeks.org/javascript-array-reduce-method/">reduce() Method</a></h3><p>We can use reduce() method and map() for transposing the array.</p><p><strong>Example:</strong></p><pre>let array = [<br> [1, 1, 1],<br> [2, 2, 2],<br> [3, 3, 3],<br>];<br>let newArr = array.reduce((prev, next) =&gt; <br> next.map((item, i) =&gt;<br> (prev[i] || []).concat(next[i])<br>), []); <br>console.log(newArr);</pre><p>output:</p><pre>[ [ 1, 2, 3 ], [ 1, 2, 3 ], [ 1, 2, 3 ] ]</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4e1bd4c4137" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to set up Bun on a Windows Computer]]></title>
            <link>https://medium.com/@pankajkmeena12/how-to-set-up-bun-on-a-windows-computer-1cd2b3a4b207?source=rss-b8bb0af9cf96------2</link>
            <guid isPermaLink="false">https://medium.com/p/1cd2b3a4b207</guid>
            <dc:creator><![CDATA[Pankaj Kumar Meena]]></dc:creator>
            <pubDate>Mon, 08 Jan 2024 16:03:48 GMT</pubDate>
            <atom:updated>2024-01-08T16:03:48.354Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Every day it feels like the JavaScript ecosystem undergoes changes. The introduction of Bun is just further proof of that and boy is it powerful.</p><p>But, what is Bun?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/242/0*h_pnJqRejT-tCShx.png" /></figure><blockquote>Bun is a fast all-in-one JavaScript runtime</blockquote><p>Source: <a href="https://bun.sh/">https://bun.sh/</a></p><p>What makes it “all-in-one” though? Well, let’s just head one line down for their personal description of what makes it stand out amongst the competition.</p><blockquote>Bundle, transpile, install and run JavaScript &amp; TypeScript projects — all in Bun. Bun is a new JavaScript runtime with a native bundler, transpiler, task runner and npm client built-in.</blockquote><p>That is a ton of functionality baked (heh) into one runtime. One of the things that caught my eye was that it also automatically transpiles files. That means you can just use Typescript and JSX with <strong>no setup</strong> needed.</p><p>That sort of functionality truly does feel like it should be the norm. These tools are tried-and-tested and them <strong>just</strong> working feels right.</p><p>However, I tend to use my Windows computer a lot because I tend to game on the side. For convenience’s sake, I also do a lot of coding on my Windows computer (where applicable). So I decided to give Bun a shot whilst on my Windows computer.</p><p>Let’s dive right in on how to set it up.</p><h3>Setting up WSL</h3><p>In order for us to install certain functionalities we need to set up a Linux distribution on our Windows machine. Thankfully, the developers at Microsoft have created something called the Windows Subsystem for Linux (WSL)</p><blockquote>The Windows Subsystem for Linux lets developers run a GNU/Linux environment — including most command-line tools, utilities, and applications — directly on Windows, unmodified, without the overhead of a traditional virtual machine or dualboot setup.</blockquote><p>If you want more info <a href="https://learn.microsoft.com/en-us/windows/wsl/">check out the full docs</a>.</p><p>This is exactly what we’re looking for to set up Bun.</p><p>Open up the Windows Powershell (with admin privileges) and run the following command:</p><pre>Bash/Shell</pre><pre>wsl --install</pre><p>You’ll probably get a line of messages similar to this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/0*LyHhF8vZDLyjlHY3.png" /></figure><p>Awesome! Let’s restart our machine.</p><p>After restarting the terminal will automatically attempt to run some commands. However, you may get the following error:</p><pre>Bash/Shell</pre><pre>Installing, this may take a few minutes...<br>WslRegisterDistribution failed with error 0x80370102<br>Error: 0x80370102 The virtual machine could not be started because a required feature is not installed</pre><p>In this case, virtualization may not be enabled on your PC. How to enable this can vary from processor to processor so I just did a quick google search. In my case, I had an AMD Ryzen, so I had to reboot and enable SVM in my BIOS settings.</p><p>After enabling open up another terminal and run the following command to re-install the Linux distribution. If it previously worked you can skip this step.</p><pre>Bash/Shell</pre><pre>wsl --install -b Ubuntu</pre><p>This will install and ask you to create a UNIX user account.</p><h4>Installing Docker Desktop</h4><p>It’s <strong>recommended</strong> to use Docker Desktop with WSL. Let’s go ahead and get that set up.</p><p><a href="https://www.docker.com/products/docker-desktop/">https://www.docker.com/products/docker-desktop/</a></p><p>Download the executable and install Docker Desktop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/0*BeNsQNO3IpzG7plN.png" /></figure><p>This will require a logout. Afterward, head into settings and make sure Use the WSL 2-based engine is enabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/0*gv0N8meigx6J-UaR.png" /></figure><p>In Resources, under WSL Integration make sure your installed distro is enabled as well.</p><p>For more detailed instructions and troubleshooting <a href="https://learn.microsoft.com/en-us/windows/wsl/tutorials/wsl-containers">check out the WSL docs</a>.</p><h3>Using Bun on Windows</h3><p>That was quite a bit of prep just to use Bun. Grab a coffee and come back so we can continue!</p><h4>Installing Bun</h4><p>Open up the Ubuntu (just search up Ubuntu from the Start menu and it should appear if it was installed correctly) instance and install unzip.</p><pre>Bash/Shell</pre><pre>sudo apt install unzip</pre><p>And install bun</p><pre>Bash/Shell</pre><pre>curl https://bun.sh/install | bash</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*zfS5Z40uKwz7cPqq.png" /></figure><p>One more step. We have to add a few lines manually to our .bashrc</p><p>Now you have full access to the bun commands! Restart the Ubuntu terminal and run</p><pre>Bash/Shell</pre><pre>bun --version</pre><p>This should confirm if it was correctly installed or not.</p><h4>Testing out Bun</h4><p>I’ll be using Vscode to simplify the process but it’s not necessary. Vscode has an extension available to integrate it with WSL easily.</p><p>Here are their docs for more info:</p><p><a href="https://code.visualstudio.com/docs/remote/wsl">https://code.visualstudio.com/docs/remote/wsl</a></p><p>Under extensions just look up WSL to install the respective extension</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/274/0*7Vg6LnuTVaHOS1J2.png" /></figure><p>Awesome!</p><p>To test this out create a folder with the name http.js and add the following lines to the file (note this is straight from the docs):</p><pre>JavaScript</pre><pre>export default {<br>	port: 3000,<br>	fetch(request) {<br>		return new Response(&#39;Welcome to Bun!&#39;);<br>	},<br>};</pre><p>Open the folder with vscode. In the bottom left of the vscode screen you should see a button with two arrows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/34/0*WI7eSfFWrn-mPonH.png" /></figure><p>Click it and select the option to re-open the folder with WSL. Your terminal should now be connected to the Ubuntu instance. From here run:</p><pre>bun run http.js</pre><p>At <a href="http://localhost:3000/">http://localhost:3000</a> you’ll now see the executed file!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/257/0*-_m_e9fkY2Xbat2W.png" /></figure><h3>Wrapping it up</h3><p>That was quite the setup but now we can do more complex things with Bun. In the next article, I’ll go over how to set up a more complex project.</p><p>Do note that Bun is still in Beta so you may encounter some issues! They have an active discord so I recommend checking them out if you run into any problems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1cd2b3a4b207" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Searching Algorithms in JavaScript!]]></title>
            <link>https://medium.com/@pankajkmeena12/searching-algorithms-in-javascript-b10f896fb1aa?source=rss-b8bb0af9cf96------2</link>
            <guid isPermaLink="false">https://medium.com/p/b10f896fb1aa</guid>
            <dc:creator><![CDATA[Pankaj Kumar Meena]]></dc:creator>
            <pubDate>Fri, 13 Oct 2023 08:30:01 GMT</pubDate>
            <atom:updated>2023-10-13T08:30:42.452Z</atom:updated>
            <content:encoded><![CDATA[<p>🚀 Mastering Searching Algorithms in JavaScript! 📊</p><p>Are you a developer looking to boost your problem-solving skills? 💡 Dive into the world of searching algorithms in JavaScript! 🔍</p><p>🔎 Searching algorithms play a pivotal role in data retrieval and analysis, making them an indispensable tool for every programmer. From finding an item in an array to searching through large datasets, these algorithms are the key to efficient and optimized solutions.</p><p>Benefits: 🌟 Efficiency: Searching algorithms help you find data quickly, even in vast collections. 🌟 Optimization: Improve the performance of your applications by choosing the right search algorithm. 🌟 Problem Solving: Enhance your critical thinking and problem-solving skills. 🌟 Real-World Application: Used in web search engines, recommendation systems, and more.</p><p>Here’s a simple example in JavaScript — Binary Search:</p><pre>function binarySearch(arr, target) {<br> let left = 0;<br> let right = arr.length - 1;<br>while (left &lt;= right) {<br> const mid = Math.floor((left + right) / 2);<br> if (arr[mid] === target) return mid;<br> if (arr[mid] &lt; target) left = mid + 1;<br> else right = mid - 1;<br> }<br> return -1; // Target not found<br>}</pre><p>Ready to level up your coding skills? 🚀 Start your journey with searching algorithms! Explore their variations like binary search, linear search, and more. Mastering these techniques will set you apart as a problem solver and help you tackle real-world challenges. 🌐</p><p>Got a favorite searching algorithm or a success story? Share it in the comments below! 👇</p><p>#JavaScript #SearchingAlgorithms #ProblemSolving #WebDevelopment #CodingSkills #LinkedInLearning</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b10f896fb1aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ISRO’s Leap into Digital Outreach: Launching the Space Blog.]]></title>
            <link>https://medium.com/@pankajkmeena12/isros-leap-into-digital-outreach-launching-the-space-blog-5fb0388f96e?source=rss-b8bb0af9cf96------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fb0388f96e</guid>
            <dc:creator><![CDATA[Pankaj Kumar Meena]]></dc:creator>
            <pubDate>Thu, 24 Aug 2023 06:28:48 GMT</pubDate>
            <atom:updated>2023-08-24T06:28:48.666Z</atom:updated>
            <content:encoded><![CDATA[<p>In an exciting development, the Indian Space Research Organisation (ISRO) has taken a digital leap by launching its official space-themed blog. This move showcases ISRO’s commitment to enhancing public engagement and sharing valuable insights into its remarkable space missions, scientific advancements, and technological innovations.</p><p>The blog, a new addition to ISRO’s communication repertoire, aims to bridge the gap between the space agency and the curious minds of the general public. With its user-friendly interface and informative content, the blog promises to be a treasure trove for space enthusiasts, students, and researchers alike.</p><p>Through this blog, ISRO plans to provide readers with in-depth articles on a wide range of topics. From explaining the intricacies of satellite orbits to detailing the fascinating journey of India’s Mars Orbiter Mission (Mangalyaan), the blog will cater to both the layperson and the space aficionado. Additionally, behind-the-scenes insights into the preparation and execution of space launches are expected to be a highlight.</p><p>One of the primary goals of the blog is to inspire and educate the younger generation. ISRO aims to nurture an interest in space science and technology among students, fostering a spirit of inquiry and innovation. Engaging articles, infographics, and interactive content will serve as valuable educational resources for schools and colleges.</p><p>Furthermore, the blog will serve as a platform for ISRO scientists and researchers to share their experiences, challenges, and triumphs. By offering a glimpse into the human side of space exploration, ISRO aims to create a sense of connection and inspiration among its readers.</p><p>The launch of ISRO’s official blog marks a significant step in the agency’s outreach efforts. As the world looks to the skies with renewed enthusiasm, this digital initiative promises to make the wonders of space more accessible to everyone.</p><p>In conclusion, ISRO’s decision to create a space-themed blog demonstrates its dedication to fostering a deeper understanding of space science and exploration. By leveraging the power of digital communication, the Indian space agency is set to inspire, educate, and captivate a global audience, propelling the spirit of discovery ever forward.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fb0388f96e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>