<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Shan Asif</title>
    <description>The latest articles on Forem by Shan Asif (@codewithshan).</description>
    <link>https://forem.com/codewithshan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F367483%2Fdfe66f1c-3d70-4d4e-b05c-501b6c9a20b4.jpg</url>
      <title>Forem: Shan Asif</title>
      <link>https://forem.com/codewithshan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/codewithshan"/>
    <language>en</language>
    <item>
      <title>Avoid storing files in the Database: Here is what you should do.</title>
      <dc:creator>Shan Asif</dc:creator>
      <pubDate>Fri, 04 Jul 2025 03:35:40 +0000</pubDate>
      <link>https://forem.com/codewithshan/avoid-storing-files-in-the-database-here-is-what-you-should-do-3b39</link>
      <guid>https://forem.com/codewithshan/avoid-storing-files-in-the-database-here-is-what-you-should-do-3b39</guid>
      <description>&lt;p&gt;If you're storing entire .jpg, .png, or .pdf files directly in your database...&lt;/p&gt;

&lt;p&gt;You might want to &lt;strong&gt;pause&lt;/strong&gt;. 🛑&lt;/p&gt;

&lt;p&gt;Storing full files as BLOBs or Base64 in your DB can:&lt;/p&gt;

&lt;p&gt;→ Slow down performance &lt;/p&gt;

&lt;p&gt;→ Inflate database backups &lt;/p&gt;

&lt;p&gt;→ Make scaling a nightmare &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s a better way?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Store only file metadata in your database like:&lt;/p&gt;

&lt;p&gt;→ filename, &lt;/p&gt;

&lt;p&gt;→ mimetype&lt;/p&gt;

&lt;p&gt;→ size&lt;/p&gt;

&lt;p&gt;→ key (if exists)&lt;/p&gt;

&lt;p&gt;→ and most importantly, the file URL/path (For Quick Lookups)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Then store the actual files in:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;→ Object storage (S3, Firebase Storage, Digital Ocean Droplet etc.)&lt;/p&gt;

&lt;p&gt;→ Your own secure file server&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This pattern:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;→ Improves security&lt;/p&gt;

&lt;p&gt;→ Speeds up performance&lt;/p&gt;

&lt;p&gt;→ Makes file management modular and scalable&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bonus:&lt;/strong&gt; Always store the MIME type (image/jpeg, image/png, application/pdf, etc) in the database instead of plain extensions like PDF, PNG. &lt;/p&gt;

</description>
      <category>webdev</category>
    </item>
    <item>
      <title>Step-by-Step Guide to Running DeepSeek R1 AI Locally</title>
      <dc:creator>Shan Asif</dc:creator>
      <pubDate>Sat, 25 Jan 2025 15:48:00 +0000</pubDate>
      <link>https://forem.com/codewithshan/step-by-step-guide-to-running-deepseek-r1-ai-locally-2e4g</link>
      <guid>https://forem.com/codewithshan/step-by-step-guide-to-running-deepseek-r1-ai-locally-2e4g</guid>
      <description>&lt;p&gt;Imagine having a smart assistant that works entirely on your computer—keeping your data private, saving money, and working even without the internet. That’s &lt;strong&gt;DeepSeek R1&lt;/strong&gt;, a powerful AI tool similar to ChatGPT(OpenAI o1) or Claude but designed to run directly on your machine. Follow this simple guide to get started in minutes!&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Why Run DeepSeek R1 on Your Computer?&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;100% Private&lt;/strong&gt;: Your data never leaves your device.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Free Forever&lt;/strong&gt;: No hidden fees or subscriptions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Works Offline&lt;/strong&gt;: No internet? No problem!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Customizable&lt;/strong&gt;: Choose the version that fits your computer’s power.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What You’ll Need&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Computer Specs&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; I tested 14b and 32b on a Mac mini m4 pro base model (14b works great, but 32b was not working).&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 1: Install Ollama (Your AI Assistant Tool)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Ollama is free software that lets you run AI models like DeepSeek R1.&lt;/p&gt;

&lt;p&gt;Here’s how to get it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Go to &lt;a href="https://ollama.com/download" rel="noopener noreferrer"&gt;Ollama’s website&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Download the version for your computer (Windows, Mac, or Linux).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install it like any normal app—just follow the prompts!&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Check if it works&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open your computer’s terminal (Don’t panic! It’s just a text command tool).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Type ollama list and press Enter. If you see no errors, you’re good!&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 2: Download Your DeepSeek R1 Model&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;DeepSeek R1 comes in different sizes. &lt;strong&gt;Start small&lt;/strong&gt; if you’re unsure!&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open your terminal again.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Copy and paste one of these commands based on your computer’s power:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Models:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;1.5B&lt;/strong&gt; (Basic laptops) ollama run deepseek-r1:1.5b&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;8B&lt;/strong&gt; (Most users ✅) ollama run deepseek-r1:8b&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;14B+&lt;/strong&gt; (Powerful computers) ollama run deepseek-r1:14b&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Wait for the download to finish—this might take a few minutes.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 3: Pick the Right Model for Your Computer&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Got a regular laptop?&lt;/strong&gt; Stick with 1.5B or 8B.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Powerful gaming PC or Mac?&lt;/strong&gt; Try 14B or higher for smarter responses.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Not sure?&lt;/strong&gt; Start with 8B—you can always switch later!&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 4: Get a Friendly Chat Interface (No Coding!)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Chatbox&lt;/strong&gt; turns the AI into a simple chat window.&lt;/p&gt;

&lt;p&gt;Here’s how:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Download Chatbox from chatboxai.app&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install it, then open the app.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go to &lt;strong&gt;Settings&lt;/strong&gt; → &lt;strong&gt;Model Provider&lt;/strong&gt; → Choose &lt;strong&gt;Ollama&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the “API Host” box, type: &lt;a href="http://127.0.0.1:11434" rel="noopener noreferrer"&gt;http://127.0.0.1:11434&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select “DeepSeek R1” from the menu—you’re ready to chat!&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; I have also downloaded a few other models like llama3.2 and codellama:13b. You can easily do that through ollama.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 5: Test Your AI Assistant&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Try questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;“How do I make a chocolate cake?”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“Write a birthday email for my boss.”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;“Explain gravity like I’m 5 years old.”&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Slow responses?&lt;/strong&gt; Switch to a smaller model in Ollama.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Pro Tips for Better Results&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Close other apps&lt;/strong&gt; (like games or video editors) while using DeepSeek R1.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;For Mac/Linux users&lt;/strong&gt;: Update your system software for best performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Stuck?&lt;/strong&gt; Restart Ollama by typing ollama serve in your terminal.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What Can DeepSeek R1 Do?&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Write code, stories, or emails&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Solve math problems&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Answer trivia questions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Help brainstorm ideas&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Final Thoughts&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;DeepSeek R1 puts cutting-edge AI directly on your computer—no internet or fees required. Whether you’re a student, writer, or just curious, this guide helps you start safely and simply. Experiment with smaller models first, and upgrade as you get comfortable. Happy exploring! 🚀&lt;/p&gt;

&lt;p&gt;Share with others if you found this guide helpful!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>deepseek</category>
      <category>llm</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Session vs Cookie</title>
      <dc:creator>Shan Asif</dc:creator>
      <pubDate>Fri, 20 Dec 2024 08:12:49 +0000</pubDate>
      <link>https://forem.com/codewithshan/session-vs-cookie-2kim</link>
      <guid>https://forem.com/codewithshan/session-vs-cookie-2kim</guid>
      <description>&lt;p&gt;Sessions and cookies are both used to store information about users, but they have different characteristics and purposes:&lt;/p&gt;

&lt;h2&gt;
  
  
  Cookie:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Where it's stored:&lt;/strong&gt; On the user's browser.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Purpose:&lt;/strong&gt; To remember information about the user, such as login details or preferences, across different browsing sessions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lifetime:&lt;/strong&gt; Can persist for a long time, depending on how they are set up (until they expire or are deleted).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use case:&lt;/strong&gt; Often used for tracking, remembering login status, or storing user preferences.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;

&lt;p&gt;When you visit an online store and it remembers your login details or your preferences (like language settings), that's done using cookies.&lt;/p&gt;

&lt;p&gt;You might close the browser and come back later, and the website still remembers you because the cookie is still there.&lt;/p&gt;

&lt;h2&gt;
  
  
  Session:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Where it's stored:&lt;/strong&gt; On the server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Purpose:&lt;/strong&gt; To keep track of a user's activity while they are visiting a website.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lifetime:&lt;/strong&gt; Typically lasts only as long as the user's visit to the website. It ends when the user closes the browser or logs out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use case:&lt;/strong&gt; Often used for maintaining a user's state and information while they navigate a site, like keeping items in a shopping cart.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;

&lt;p&gt;When you add items to a shopping cart on an e-commerce site, that information is stored in a session. If you leave the site or close your browser, the cart might be empty when you return.&lt;/p&gt;

&lt;p&gt;The information is kept on the website's server and disappears when you leave or log out.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Session and Cookies Often Work Together:&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Session Management:
&lt;/h3&gt;

&lt;p&gt;When you visit a website, a session is created on the server to keep track of your activities and data during your visit. This session is identified by a unique session ID. This session ID is sent to the user's browser as a cookie.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Using Cookies to Store Session IDs:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;To link your browser to this session on the server, the server typically sends a cookie to your browser with the session ID.&lt;/li&gt;
&lt;li&gt;Your browser stores this cookie, and every time you make a request to the server (like clicking a link or submitting a form), it sends the cookie back to the server.&lt;/li&gt;
&lt;li&gt;This way, the server knows which session belongs to you and can provide the correct data and experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Persistence Across Visits:
&lt;/h3&gt;

&lt;p&gt;Even though sessions are temporary, cookies can allow for persistence across visits. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For example&lt;/strong&gt;, if you log in and select "Remember Me," the site might use a cookie to store your login status so you don’t have to log in again on future visits.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Authentication vs Authorization</title>
      <dc:creator>Shan Asif</dc:creator>
      <pubDate>Fri, 20 Dec 2024 07:57:47 +0000</pubDate>
      <link>https://forem.com/codewithshan/authentication-vs-authorization-1gif</link>
      <guid>https://forem.com/codewithshan/authentication-vs-authorization-1gif</guid>
      <description>&lt;p&gt;Authentication and authorization are two important concepts in website security, and they serve different purposes:&lt;/p&gt;

&lt;h2&gt;
  
  
  Authentication:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt; It's the process of verifying who someone is.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; When you log into a website using your username and password, you are proving your identity. This is authentication. It answers the question, "Are you who you say you are?"&lt;/p&gt;

&lt;h2&gt;
  
  
  Authorization:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What it is:&lt;/strong&gt; It's the process of determining what someone is allowed to do.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; Once you've logged in, the website checks what actions you can perform, like viewing your profile, modifying data, or accessing certain sections. This is authorization. It answers the question, "What are you allowed to do?"&lt;/p&gt;

&lt;p&gt;In simple terms, authentication is about checking your identity, while authorization is about checking your permissions.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Request vs Response Headers</title>
      <dc:creator>Shan Asif</dc:creator>
      <pubDate>Thu, 12 Dec 2024 19:17:46 +0000</pubDate>
      <link>https://forem.com/codewithshan/request-vs-response-headers-5a43</link>
      <guid>https://forem.com/codewithshan/request-vs-response-headers-5a43</guid>
      <description>&lt;p&gt;In HTTP communication, headers are used to pass additional information with requests and responses. Here’s a comparison between response headers and request headers:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Request Headers&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition:&lt;/strong&gt; These are the headers sent by the client (usually a web browser) to the server with an HTTP request.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Purpose:&lt;/strong&gt; They carry information about the client and its environment. This can include details like what type of data the client can process, what languages it prefers, and any cookies it might have stored.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Common Examples:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Accept:&lt;/strong&gt; Specifies the media types that are acceptable for the response (e.g., text/html, application/json).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User-Agent:&lt;/strong&gt; Provides information about the client software initiating the request (e.g., browser type and version).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authorization:&lt;/strong&gt; Contains credentials for authenticating the client with the server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Host:&lt;/strong&gt; Indicates the domain name of the server and, optionally, the TCP port number.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Response Headers&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition:&lt;/strong&gt; These are the headers sent by the server back to the client in response to an HTTP request.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Purpose:&lt;/strong&gt; They provide information about the server's response, such as metadata about the returned content and instructions on how to handle it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Common Examples:&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Content-Type:&lt;/strong&gt; Indicates the media type of the resource (e.g., text/html, image/png).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Set-Cookie:&lt;/strong&gt; Sends cookies from the server to be stored on the client.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache-Control:&lt;/strong&gt; Provides caching directives for both requests and responses (e.g., no-cache, max-age=3600).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server:&lt;/strong&gt; Identifies the software used by the origin server (though this can be hidden for security reasons).&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Get specific properties from an array of Objects in JavaScript</title>
      <dc:creator>Shan Asif</dc:creator>
      <pubDate>Sat, 31 Aug 2024 11:09:37 +0000</pubDate>
      <link>https://forem.com/codewithshan/get-specific-properties-from-an-array-of-objects-in-javascript-215</link>
      <guid>https://forem.com/codewithshan/get-specific-properties-from-an-array-of-objects-in-javascript-215</guid>
      <description>&lt;p&gt;&lt;strong&gt;Get Specific Properties from an Array of Objects in JavaScript Using Map.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Points:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;→ &lt;strong&gt;Purpose:&lt;/strong&gt; Creates a new array by applying a function to each element of an existing array.&lt;/p&gt;

&lt;p&gt;→ &lt;strong&gt;Returns a New Array:&lt;/strong&gt; The original array remains unchanged; a new array is generated.&lt;/p&gt;

&lt;p&gt;→ &lt;strong&gt;Chainable:&lt;/strong&gt; Can be combined with other array methods like filter and reduce.&lt;/p&gt;

&lt;p&gt;→ &lt;strong&gt;Not for Side Effects:&lt;/strong&gt; Primarily used for data transformation, not for modifying external variables.&lt;/p&gt;

&lt;p&gt;→ &lt;strong&gt;Example:&lt;/strong&gt; Easily transforms arrays, such as doubling numbers.&lt;/p&gt;

&lt;p&gt;→ &lt;strong&gt;Performance:&lt;/strong&gt; More efficient and cleaner than traditional loops for creating new arrays.&lt;/p&gt;

&lt;p&gt;If you want to learn the execution of map array method with examples:&lt;/p&gt;

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

&lt;p&gt;On YouTube → &lt;a href="https://www.youtube.com/watch?v=phSe9bHPNtg" rel="noopener noreferrer"&gt;Get specific properties from an array of Objects&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Remove Object from Array using JavaScript Filter (Easy Tutorial)</title>
      <dc:creator>Shan Asif</dc:creator>
      <pubDate>Tue, 27 Aug 2024 12:54:54 +0000</pubDate>
      <link>https://forem.com/codewithshan/remove-object-from-array-using-javascript-filter-easy-tutorial-kbb</link>
      <guid>https://forem.com/codewithshan/remove-object-from-array-using-javascript-filter-easy-tutorial-kbb</guid>
      <description>&lt;p&gt;&lt;strong&gt;Key Points:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;→ Creates a New Array: Returns a new array containing elements that pass the test defined by the provided function.&lt;/p&gt;

&lt;p&gt;→ Non-destructive: Does not modify the original array; it leaves it unchanged.&lt;/p&gt;

&lt;p&gt;→ Callback Function: Takes a function that receives each element and returns true or false to keep or remove the element.&lt;/p&gt;

&lt;p&gt;→ Chaining: Can be combined with other array methods like map() and reduce() for complex operations.&lt;/p&gt;

&lt;p&gt;→ Use Cases: Ideal for filtering out elements based on specific conditions, such as excluding certain values or objects.&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=YRL-Uidsw0E" rel="noopener noreferrer"&gt;Tutorial Remove Object from Array → on YouTube&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>5 Project ideas for NextJS</title>
      <dc:creator>Shan Asif</dc:creator>
      <pubDate>Thu, 19 Oct 2023 10:13:40 +0000</pubDate>
      <link>https://forem.com/codewithshan/5-project-ideas-for-nextjs-14bk</link>
      <guid>https://forem.com/codewithshan/5-project-ideas-for-nextjs-14bk</guid>
      <description>&lt;h2&gt;
  
  
  Level up your NextJS skills.
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Check out these great project ideas:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Clinic Management System&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Marketplace Application&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Budget Planner&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SEO Ready Blog App with CMS&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;LMS (Learning Management System)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;💡 Tip: Boost your projects with the power of OpenAI models!&lt;/p&gt;

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

</description>
      <category>nextjs</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>NextJS Tip ⚡ Better Website Optimization with Smarter Font Management</title>
      <dc:creator>Shan Asif</dc:creator>
      <pubDate>Thu, 19 Oct 2023 09:42:30 +0000</pubDate>
      <link>https://forem.com/codewithshan/nextjs-tip-better-website-optimization-with-smarter-font-management-aee</link>
      <guid>https://forem.com/codewithshan/nextjs-tip-better-website-optimization-with-smarter-font-management-aee</guid>
      <description>&lt;h2&gt;
  
  
  NextJS Tip ⚡ Better Website Optimization with Smarter Font Management
&lt;/h2&gt;

&lt;p&gt;If you're still using the &lt;strong&gt;old manual&lt;/strong&gt; method of adding links inside the next/head.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stop doing that&lt;/strong&gt;; instead, utilize &lt;strong&gt;next/font&lt;/strong&gt;, which lets you optimize your fonts easily and efficiently.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;During build time, CSS and font files are downloaded and self-hosted with other static assets.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No requests are sent to Google by the browser.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;next/font optimize fonts and remove network requests for improved privacy and performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This means you can optimally load web fonts with zero layout shift&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F03v9ago62zos4x60ty9m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F03v9ago62zos4x60ty9m.png" alt="NextJS Tip ⚡ Better Website Optimization with Smarter Font Management" width="800" height="683"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Follow me for more NextJS | ReactJS Tips &amp;amp; Simplified Code Snippets&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>⚡️ Check Active Links &amp; Sub-Links in NextJS</title>
      <dc:creator>Shan Asif</dc:creator>
      <pubDate>Thu, 19 Oct 2023 07:49:21 +0000</pubDate>
      <link>https://forem.com/codewithshan/check-active-links-sub-links-in-nextjs-195o</link>
      <guid>https://forem.com/codewithshan/check-active-links-sub-links-in-nextjs-195o</guid>
      <description>&lt;h2&gt;
  
  
  ⚡️ Check Active Links &amp;amp; Sub-Links in NextJS
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You can use usePathname() to determine if a link is active.&lt;/li&gt;
&lt;li&gt;Check if the current pathname matches the href of the link OR the sub-link&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Quick Notes:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;usePathname() is a Client Component hook that lets you read the current URL's pathname.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It returns a string of the current URL's pathname&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;/dashboard → '/dashboard'&lt;/li&gt;
&lt;li&gt;/dashboard?v=2 → '/dashboard'&lt;/li&gt;
&lt;li&gt;/blog/hello-world → '/blog/hello-world'&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyi9vvmdhmtawre22v6j1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyi9vvmdhmtawre22v6j1.png" alt="Check Active Links &amp;amp; Sub-Links in NextJS" width="800" height="683"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Follow for more NextJS | ReactJS Tips &amp;amp; Simplified Code Snippets&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Create a JavaScript Tool to Generate Acronym from User Input</title>
      <dc:creator>Shan Asif</dc:creator>
      <pubDate>Wed, 13 Sep 2023 18:30:36 +0000</pubDate>
      <link>https://forem.com/codewithshan/create-a-javascript-tool-to-generate-acronym-from-user-input-2ib7</link>
      <guid>https://forem.com/codewithshan/create-a-javascript-tool-to-generate-acronym-from-user-input-2ib7</guid>
      <description>&lt;p&gt;The code provided is a JavaScript function called getAcronym that takes a string of words as input and returns the acronym formed from the first letter of each word.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Acronymn?
&lt;/h2&gt;

&lt;p&gt;An acronym is a word formed from the initial letters of a phrase or a series of words. It is used as a shorter way to represent a longer phrase or name.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Here’s a step-by-step explanation to generate Acronym:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The &lt;strong&gt;getAcronym&lt;/strong&gt; function is defined using the arrow function syntax (&lt;strong&gt;const getAcronym = (words) =&amp;gt; { ... }&lt;/strong&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The input string words is split into an array of words using the split method and the space delimiter (words.split(" ")). This creates an array where each element represents a word in the input string.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;strong&gt;map&lt;/strong&gt; method is used to iterate over each word in the array. For each word, a callback function is executed, which extracts the first character of the word using the &lt;strong&gt;charAt(0)&lt;/strong&gt; method and converts it to uppercase using the toUpperCase method (&lt;strong&gt;word.charAt(0).toUpperCase()&lt;/strong&gt;). This creates an array of uppercase letters representing the first letters of each word.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;strong&gt;join&lt;/strong&gt; method is used to combine all the elements of the array into a single string. The empty string "" is used as the separator (&lt;strong&gt;array.join("")&lt;/strong&gt;). This results in a string that represents the acronym formed by concatenating the uppercase letters.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The acronym string is returned as the output of the &lt;strong&gt;getAcronym&lt;/strong&gt; function.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In the example usage, the getAcronym function is called with the input string “&lt;strong&gt;Fear of missing out&lt;/strong&gt;”. The resulting acronym “&lt;strong&gt;FOMO&lt;/strong&gt;” is then logged to the console using console.log(acronym).&lt;/p&gt;

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

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Debugging is like being the detective in a crime movie</title>
      <dc:creator>Shan Asif</dc:creator>
      <pubDate>Sat, 02 Sep 2023 12:34:07 +0000</pubDate>
      <link>https://forem.com/codewithshan/debugging-is-like-being-the-detective-in-a-crime-movie-29ih</link>
      <guid>https://forem.com/codewithshan/debugging-is-like-being-the-detective-in-a-crime-movie-29ih</guid>
      <description>&lt;p&gt;&lt;strong&gt;Debugging&lt;/strong&gt; is like being the detective in a crime movie, except the crime scene is your own code, and the culprit is usually a missing semicolon.&lt;/p&gt;

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

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