javascript

Best Practices for Writing Clean and Maintainable JavaScript Code

Best Practices for Writing Clean and Maintainable JavaScript Code

1. Meaningful Variable and Function Names:Tip: Use descriptive names that clearly indicate the purpose of the variable or function.Example: Copy code // Bad const x = calculate(5); // Good const totalPrice = calculatePrice(5); Enter fullscreen mode Exit fullscreen mode 2. Descriptive Comments:Tip: Write concise but meaningful comments to explain complex logic or intent. Comments should clarify why something is done, not what is being done (which should be clear from the code itself).Example: // Bad // Loops through the array array.forEach(item => doSomething(item)); // Good // Process each item to filter out non-active users array.forEach(item => filterActiveUsers(item)); Enter fullscreen mode…
Read More
Tim Berners-Lee : The Man Behind the Web

Tim Berners-Lee : The Man Behind the Web

The Man Behind the Web Sir Timothy John Berners-Lee was born on June 8, 1955, in London, England and is a British computer scientist credited with the invention of the World Wide Web. His work revolutionized the accessibility and sharing of information, thus making the internet an indispensable tool in life. Berners-Lee worked on the web in 1989 at CERN, which is the European Organization for Nuclear Research. His goal was to create a system to make it easy for scientists to share research papers and data effortlessly. This led to the creation of HTML, URL, and HTTP, which became…
Read More
How to use Llama3.2 to write daily logs in Notion based on your screen

How to use Llama3.2 to write daily logs in Notion based on your screen

Ever wished you had a personal AI assistant that could keep track of your daily work? With screenpipe & llama3.2, you can now automate the process of writing detailed logs based on your screen activity. Let's dive into how you can set this up using screenpipe's plugin system. What is screenpipe? screenpipe is an open-source tool that captures your screen and audio 24/7, extracts text using ocr, and allows you to build personalized ai-powered workflows. It's designed to be secure, with your data staying on your machine. Installing screenpipe (If you're not on macOS check these instructions) To build the…
Read More
Building a Website with Node.js and Express.js

Building a Website with Node.js and Express.js

This article divides deep into building websites with Node.js and Express.js. Express.js is an essential framework for creating robust and scalable web applications on top of Node.js, and today's focus will be on routing, middleware, template engines, and cookie sessions. Concept Highlights: app.use(callback) app.use(path, callback) GET, POST, PUT, DELETE Express Middleware Call the Next Middleware in the Stack Using Express Router Cookie Session Management Middleware Template Variables EJS 1. app.use(callback) The app.use(callback) method in Express.js is used to mount middleware functions. This middleware will run for every request made to your application, regardless of the HTTP method or URL. e.g.)…
Read More
I made a Component Library !

I made a Component Library !

After years of wondering, what to do in my life, I finally have reached to a notable conclusion, that I want to build a React component library, but how?The journey begins today itself with understanding what makes a component library invaluable to developers: it’s not just about functionality, but also about consistency, reusability, and elegance in design. Step 0: What make me different? There are many component libraries out there—Shadcn/UI, Material UI, Tailwind CSS—each bringing something valuable to the table. But what problem am I solving with my library? The answer lies in flexibility and instant feedback. Imagine the best…
Read More
Dockerizing a Next.js Application using a Standalone Build

Dockerizing a Next.js Application using a Standalone Build

Introduction Docker has gained popularity in recent years for enabling applications to be placed inside containers. These containers can be deployed to any environment and will work the same way in all of them, providing a uniform behavior regardless of the platform where the application runs. These containers use images, which are a copy or compressed snapshot of the application. By placing them within a container, they are displayed exactly as they are. This is one of those technologies that some were desperate for, while others don't realize they need it until they hear about it. For its part, Next.js…
Read More
NPM peerDependencies in Depth: A Comprehensive Introduction

NPM peerDependencies in Depth: A Comprehensive Introduction

As Javascript developers, we all know two different dependencies in our projects, dependencies and devDependencies, but what about peerDependencies? In this series, we will examine this less common dependency in Javascript. We will study what they are, what I need to know about as a library user, and what best practices are for library authors. What are dependencies in NPM Let's recap the different common types: dependencies: these are the tools used in your application; a good example is react, angular, and express. When your application is in production, the code of the libraries on dependencies will run under the…
Read More
Redux toolkit: React Thunk and React Saga.Learn from Vishal Tiwari.

Redux toolkit: React Thunk and React Saga.Learn from Vishal Tiwari.

React Thunk and React Saga are middleware libraries for handling side effects in React applications, especially for managing asynchronous operations like API calls. Both are commonly used with Redux but serve slightly different purposes and approaches. React Thunk 1. Overview: React Thunk is a middleware that allows you to write action creators that return functions instead of action objects. This is useful for handling asynchronous operations like API requests or complex synchronous logic (like conditional dispatching of actions). The returned function receives dispatch and getState as arguments, allowing you to dispatch other actions or access the current state within the…
Read More
A privacy focused online PDF Editor

A privacy focused online PDF Editor

Photo from Markus Spiske privpdf.com is an open-source project by Neural Nirvana aimed to prioritize privacy and safety of PDF documents.Almost every one of us has used the online PDF editor services to merge, split, edit, watermak PDF files. But doing it online comes with a risk of your document data being shared with third party servers, even stored without consent.That's why we created privpdf.com - a privacy focused in-browser PDF editor capable in doing everything current online providers are offering - all inside the browser with no data ever uploaded anywhere!The client-side processing enables the user to be assured…
Read More
Setting up Supabase Auth with Nuxt v3

Setting up Supabase Auth with Nuxt v3

Implementing authentication is something that you do on most projects, but still something that you may not remember how to do by memory because of how often you actually do it. Here is a quick how-to about implementing Supabase Auth with Nuxt v3. In this example, we will be using OTP, but it applies to every case. You will first want to start your project by going to Supabase's website. After creating a project in Supabase and starting your project on Nuxt, we want to then install the Supabase Nuxt package by doing: npx nuxi@latest module add supabase We will…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.