<?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: ABU SAID</title>
    <description>The latest articles on Forem by ABU SAID (@said7388).</description>
    <link>https://forem.com/said7388</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%2F770279%2Fa204e277-1706-4262-af08-9536b47d766f.png</url>
      <title>Forem: ABU SAID</title>
      <link>https://forem.com/said7388</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/said7388"/>
    <language>en</language>
    <item>
      <title>GitHub and EC2 manual deployment with Deploy keys</title>
      <dc:creator>ABU SAID</dc:creator>
      <pubDate>Fri, 17 May 2024 05:39:03 +0000</pubDate>
      <link>https://forem.com/said7388/github-and-ec2-manual-deployment-with-deploy-keys-397d</link>
      <guid>https://forem.com/said7388/github-and-ec2-manual-deployment-with-deploy-keys-397d</guid>
      <description>&lt;p&gt;For those looking to quickly deploy a project, whether it’s a prototype or a solo endeavor, manual deployment with GitHub and AWS EC2 is a reliable and efficient method. Here’s a comprehensive guide to setting up your deployment using deploy keys.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting Up Your EC2 Instance
&lt;/h3&gt;

&lt;p&gt;Begin by launching an on-demand EC2 instance on AWS. Access this instance via SSH, and use Git to clone or pull your repository. This setup will be similar to your local development environment, except you’ll need to configure environment variables specific to your server.&lt;/p&gt;

&lt;p&gt;To ensure your server is secure, configure nginx with SSL certificates. This adds a layer of security and professionalism to your deployment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Using GitHub Deploy Keys
&lt;/h3&gt;

&lt;p&gt;Deploy keys provide a secure, read-only connection between your EC2 instance and your GitHub repository. Here’s how to set them up:&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 1: Generate SSH Keys
&lt;/h4&gt;

&lt;p&gt;First, generate an SSH key pair on your EC2 instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; ed25519 &lt;span class="nt"&gt;-f&lt;/span&gt; ~/.ssh/my_project_deploy_key &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"your_email@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using &lt;code&gt;ed25519&lt;/code&gt; instead of the more common RSA provides better security. The &lt;code&gt;-C&lt;/code&gt; flag is optional but useful if you plan to use the key for commit signing in addition to deployment.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 2: Add the Public Key to GitHub
&lt;/h4&gt;

&lt;p&gt;In your GitHub repository, navigate to &lt;strong&gt;Settings &amp;gt; Deploy keys&lt;/strong&gt;. Click &lt;strong&gt;Add Deploy Key&lt;/strong&gt;, provide a descriptive title like "EC2 Deployment Key", and paste the contents of your public key file (&lt;code&gt;~/.ssh/my_project_deploy_key.pub&lt;/code&gt;). For most deployment scenarios, you won’t need to enable write access.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 3: Configure SSH for Git
&lt;/h4&gt;

&lt;p&gt;To allow your EC2 instance to access multiple repositories without using the default &lt;code&gt;id_rsa&lt;/code&gt; key name, configure your SSH client:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vim ~/.ssh/config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following entries to the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Host github.com-my_project
  HostName github.com
  IdentityFile ~/.ssh/my_project_deploy_key
  User git

Host github.com-other_project
  HostName github.com
  IdentityFile ~/.ssh/other_deploy_key
  User git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This configuration allows you to manage multiple repositories with different keys.&lt;/p&gt;

&lt;p&gt;To clone your repository, use the configured host:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone git@github.com-my_project:your_github_org/your_repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can then use &lt;code&gt;git pull&lt;/code&gt; as needed to update your project.&lt;/p&gt;

&lt;h3&gt;
  
  
  Improving Your Deployment Process
&lt;/h3&gt;

&lt;p&gt;While this manual setup is quick and effective, it does have some limitations, such as downtime during updates. To minimize downtime, consider using a process manager like &lt;a href="https://futurestud.io/tutorials/pm2-cluster-mode-and-zero-downtime-restarts" rel="noopener noreferrer"&gt;pm2&lt;/a&gt;, which supports zero-downtime restarts.&lt;/p&gt;

&lt;p&gt;As your project grows, SSH-based manual deployments might become cumbersome. Automating your deployment process can save time and reduce errors. You can use GitHub webhooks to trigger automatic deployments or configure your server as a Git remote to push updates directly. This approach can streamline your workflow and enhance efficiency.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Deploying with GitHub and EC2 using deploy keys is a straightforward and effective way to manage your projects, especially for quick prototypes and solo projects. This method allows you to leverage the power of AWS and GitHub without the overhead of more complex deployment strategies. Stay tuned for future posts where we’ll explore advanced deployment techniques and best practices.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ec2</category>
      <category>github</category>
      <category>deployment</category>
    </item>
    <item>
      <title>Build an awesome GitHub developer portfolio.</title>
      <dc:creator>ABU SAID</dc:creator>
      <pubDate>Mon, 06 May 2024 06:21:43 +0000</pubDate>
      <link>https://forem.com/said7388/build-an-awesome-github-developer-portfolio-54ka</link>
      <guid>https://forem.com/said7388/build-an-awesome-github-developer-portfolio-54ka</guid>
      <description>&lt;p&gt;In the software development world, it's crucial to effectively present your work alongside the code you write. A portfolio website is an excellent way for developers to showcase their skills, projects, and contributions. One innovative way to enhance your portfolio is by integrating GitHub statistics, which can provide real-time insights into your coding activity and contributions.&lt;/p&gt;

&lt;p&gt;To assist other developers in achieving this, I have created a new website from scratch that highlights your GitHub works. The website is built using NextJS and Tailwind CSS, and it fetches all data from your GitHub profile and work. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;This article will guide you through the setup process step by step, and it will also provide you with the GitHub link.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here is the live preview:&lt;/strong&gt; &lt;a href="https://github.abusaid.me/" rel="noopener noreferrer"&gt;Live preview url&lt;/a&gt;&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%2Ffi8nc8kwy5vn42vk70zr.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%2Ffi8nc8kwy5vn42vk70zr.png" alt=" " width="800" height="909"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 01:&lt;/strong&gt;&lt;br&gt;
Clone the Repository using &lt;a href="https://github.com/said7388/github-portfolio.git" rel="noopener noreferrer"&gt;GitHub link&lt;/a&gt; and change the directory to the github-portfolio.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;clone&lt;/span&gt; &lt;span class="nx"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//github.com/said7388/github-portfolio.git&lt;/span&gt;
&lt;span class="nx"&gt;cd&lt;/span&gt; &lt;span class="nx"&gt;github&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;portfolio&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;STEP 02:&lt;/strong&gt;&lt;br&gt;
Now install all packages using &lt;code&gt;npm&lt;/code&gt; or &lt;code&gt;yarn&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;or&lt;/span&gt;
&lt;span class="nx"&gt;yarn&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installation, all packages, Now change all data on &lt;code&gt;data/user-data.js&lt;/code&gt; according to you. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;githubUser&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;said7388&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;devUsername&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;said7388&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;github&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://github.com/said7388&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;facebook&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://www.facebook.com/abusaid.riyaz/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;linkedIn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://www.linkedin.com/in/abu-said-bd/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;twitter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://twitter.com/said7388&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;stackOverflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://stackoverflow.com/users/16840768/abu-said&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;leetcode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://leetcode.com/said3812/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;resume&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://drive.google.com/file/d/1eyutpKFFhJ9X-qpQGKhUNnVRkB5Wer00/view?usp=sharing&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;skills&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;React&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;NextJS&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Redux&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Express&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;NestJS&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;MySql&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;MongoDB&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Postgres&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Docker&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;AWS&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;timezone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;+6&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;STEP 03:&lt;/strong&gt; &lt;br&gt;
If you want to use Google Analytics, Please create a new &lt;code&gt;.env&lt;/code&gt; file from the &lt;code&gt;.env.example&lt;/code&gt; file and provide the value. The &lt;code&gt;.env&lt;/code&gt; file will be the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;NEXT_PUBLIC_GTM&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;STEP 04:&lt;/strong&gt;&lt;br&gt;
Now the GitHub portfolio website is ready for the run. You can run it using &lt;code&gt;npm&lt;/code&gt; or &lt;code&gt;yarn&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;run&lt;/span&gt; &lt;span class="nx"&gt;dev&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;or&lt;/span&gt;
&lt;span class="nx"&gt;yarn&lt;/span&gt; &lt;span class="nx"&gt;dev&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you like this GitHub portfolio project you can consider giving it a star on the &lt;a href="https://github.com/said7388/github-portfolio" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;You can connect with me on Linkedin: &lt;a href="https://www.linkedin.com/in/abu-said-bd/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/abu-said-bd/&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Disclaimer: In this repository, I have used some open-source APIs. All credits go to the owners of those repositories.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>portfolio</category>
      <category>developer</category>
      <category>github</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>Build an awesome developer portfolio website.</title>
      <dc:creator>ABU SAID</dc:creator>
      <pubDate>Tue, 12 Mar 2024 08:54:09 +0000</pubDate>
      <link>https://forem.com/said7388/build-an-awesome-developer-portfolio-website-4cj9</link>
      <guid>https://forem.com/said7388/build-an-awesome-developer-portfolio-website-4cj9</guid>
      <description>&lt;p&gt;As a software developer, it's important to have a robust portfolio website that can display our abilities and experiences. To assist other developers, I have designed a portfolio website using Next, Tailwind CSS, and EmailJS. In this article, I will provide a step-by-step guide on the setup process, along with the GitHub link.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here is the live preview:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://abusaid.me" rel="noopener noreferrer"&gt;Live preview url&lt;/a&gt;&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%2Fsy839bd6kfivrjowtyy2.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%2Fsy839bd6kfivrjowtyy2.png" alt=" " width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 01:&lt;/strong&gt;&lt;br&gt;
Clone the Repository using &lt;a href="https://github.com/said7388/developer-portfolio.git" rel="noopener noreferrer"&gt;GitHub link&lt;/a&gt; and change the directory to the developer-portfolio.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;git&lt;/span&gt; &lt;span class="nx"&gt;clone&lt;/span&gt; &lt;span class="nx"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//github.com/said7388/developer-portfolio.git&lt;/span&gt;
&lt;span class="nx"&gt;cd&lt;/span&gt; &lt;span class="nx"&gt;developer&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;portfolio&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;STEP 02:&lt;/strong&gt;&lt;br&gt;
Now install all packages using &lt;code&gt;npm&lt;/code&gt; or &lt;code&gt;yarn&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;or&lt;/span&gt;
&lt;span class="nx"&gt;yarn&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installation, all packages, Now change all data on &lt;code&gt;utils/data/*&lt;/code&gt; according to you. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;personalData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ABU SAID&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;profile&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/profile.png&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;designation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Full-Stack Software Developer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;My name is ABU SAID....&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;abusaid7388@gmail.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;phone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;+8801608797655&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;address&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Dhaka, Bangladesh&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;github&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://github.com/said7388&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;facebook&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://www.facebook.com/abusaid.riyaz/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;linkedIn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://www.linkedin.com/in/abu-said-bd/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;twitter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://twitter.com/said7388&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;stackOverflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://stackoverflow.com/users/16840768/abu-said&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;leetcode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://leetcode.com/said3812/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;devUsername&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;said7388&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;resume&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;devusername&lt;/code&gt; properties replace it with your &lt;code&gt;dev.to&lt;/code&gt; &lt;code&gt;username&lt;/code&gt; and it will &lt;code&gt;fetch&lt;/code&gt; all blogs from your &lt;code&gt;dev.to&lt;/code&gt; website.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 03:&lt;/strong&gt; &lt;br&gt;
Now we will make a &lt;code&gt;.env&lt;/code&gt; file and set up our &lt;code&gt;Email.JS&lt;/code&gt; credential in a &lt;code&gt;.env&lt;/code&gt; file. I am using EmailJs in this project for the user to send mail to me and It's free. The &lt;code&gt;.env&lt;/code&gt; file will be the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;NEXT_PUBLIC_EMAILJS_SERVICE_ID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
&lt;span class="nx"&gt;NEXT_PUBLIC_EMAILJS_TEMPLATE_ID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
&lt;span class="nx"&gt;NEXT_PUBLIC_EMAILJS_PUBLIC_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First of all, go to &lt;a href="https://www.emailjs.com/" rel="noopener noreferrer"&gt;Emailjs.com&lt;/a&gt; and sign up for an account. &lt;/p&gt;

&lt;p&gt;Make a &lt;a href="https://dashboard.emailjs.com/admin" rel="noopener noreferrer"&gt;email service&lt;/a&gt; using &lt;code&gt;Gmail&lt;/code&gt; and take the &lt;code&gt;Service ID&lt;/code&gt; and add it &lt;code&gt;.env&lt;/code&gt; file as &lt;code&gt;REACT_APP_YOUR_SERVICE_ID&lt;/code&gt; value. &lt;/p&gt;

&lt;p&gt;Then make a &lt;a href="https://dashboard.emailjs.com/admin/templates/new" rel="noopener noreferrer"&gt;Email template&lt;/a&gt; and take &lt;code&gt;Template ID&lt;/code&gt; from the template setting and use it &lt;code&gt;.env&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Then go to &lt;a href="https://dashboard.emailjs.com/admin/account" rel="noopener noreferrer"&gt;Account&lt;/a&gt; and take &lt;code&gt;Public Key&lt;/code&gt; and use it in &lt;code&gt;.env&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 04:&lt;/strong&gt;&lt;br&gt;
Now the portfolio website is ready for the run. You can run it using &lt;code&gt;npm&lt;/code&gt; or &lt;code&gt;yarn&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;run&lt;/span&gt; &lt;span class="nx"&gt;dev&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="nx"&gt;or&lt;/span&gt;
&lt;span class="nx"&gt;yarn&lt;/span&gt; &lt;span class="nx"&gt;dev&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you like the portfolio project Please give it a star on the &lt;a href="https://github.com/said7388/developer-portfolio" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;. &lt;br&gt;
You can connect with me on Linkedin: &lt;a href="https://www.linkedin.com/in/abu-said-bd/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/abu-said-bd/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>portfolio</category>
      <category>devpolio</category>
      <category>webdev</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>How to create a Popover using React and Tailwind CSS</title>
      <dc:creator>ABU SAID</dc:creator>
      <pubDate>Thu, 16 Nov 2023 08:45:20 +0000</pubDate>
      <link>https://forem.com/said7388/how-to-create-a-popover-using-tailwind-css-13kj</link>
      <guid>https://forem.com/said7388/how-to-create-a-popover-using-tailwind-css-13kj</guid>
      <description>&lt;p&gt;&lt;code&gt;Popover&lt;/code&gt; is a common &lt;code&gt;UI element&lt;/code&gt; in web applications, providing a way to display additional information or options when interacting with a particular element. With &lt;code&gt;React&lt;/code&gt; and &lt;code&gt;TailwindCSS&lt;/code&gt;, most of the time developers use an &lt;code&gt;npm library&lt;/code&gt; for the &lt;code&gt;Popover&lt;/code&gt; or &lt;code&gt;Popover&lt;/code&gt;. You know, when we use an npm library, it increases the &lt;code&gt;project build sizes&lt;/code&gt;.&lt;br&gt;
In this article, I will create a reusable &lt;code&gt;Popover component&lt;/code&gt; using &lt;code&gt;Tailwind CSS&lt;/code&gt;. We will use &lt;code&gt;click&lt;/code&gt; and &lt;code&gt;hover&lt;/code&gt; triggers for the Popover.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Popover component:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// @flow strict
"use client"
import { useEffect, useRef, useState } from "react";

function ReactPopover({
  children,
  content,
  trigger = "click"
}) {
  const [show, setShow] = useState(false);
  const wrapperRef = useRef(null);

  const handleMouseOver = () =&amp;gt; {
    if (trigger === "hover") {
      setShow(true);
    };
  };

  const handleMouseLeft = () =&amp;gt; {
    if (trigger === "hover") {
      setShow(false);
    };
  };

  useEffect(() =&amp;gt; {
    function handleClickOutside(event) {
      if (wrapperRef.current &amp;amp;&amp;amp; !wrapperRef.current.contains(event.target)) {
        setShow(false);
      }
    }

    if (show) {
      // Bind the event listener
      document.addEventListener("mousedown", handleClickOutside);
      return () =&amp;gt; {
        // Unbind the event listener on clean up
        document.removeEventListener("mousedown", handleClickOutside);
      };
    }
  }, [show, wrapperRef]);

  return (
    &amp;lt;div
      ref={wrapperRef}
      onMouseEnter={handleMouseOver}
      onMouseLeave={handleMouseLeft}
      className="w-fit h-fit relative flex justify-center"&amp;gt;
      &amp;lt;div
        onClick={() =&amp;gt; setShow(!show)}
      &amp;gt;
        {children}
      &amp;lt;/div&amp;gt;
      &amp;lt;div
        hidden={!show}
        className="min-w-fit w-[200px] h-fit absolute bottom-[100%] z-50 transition-all"&amp;gt;
        &amp;lt;div className="rounded bg-white p-3 shadow-[10px_30px_150px_rgba(46,38,92,0.25)] mb-[10px]"&amp;gt;
          {content}
        &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};

export default ReactPopover;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this component the &lt;code&gt;trigger&lt;/code&gt; default value is &lt;code&gt;click&lt;/code&gt; and you can pass &lt;code&gt;hover&lt;/code&gt; as an attribute. When you click outside of the &lt;code&gt;Popover&lt;/code&gt;, the Popover will be closed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use the Popover component:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import ReactPopover from "@/components/common/react-popover";

const Page = () =&amp;gt; {
  return (
    &amp;lt;div className="w-screen h-screen flex justify-center items-center gap-4"&amp;gt;
      &amp;lt;ReactPopover
        content={
          &amp;lt;p&amp;gt;This Content Will be render in Popover.&amp;lt;/p&amp;gt;
        }
      &amp;gt;
        &amp;lt;button className="bg-indigo-500 px-4 py-1.5 border rounded text-white"&amp;gt;
          Click me
        &amp;lt;/button&amp;gt;
      &amp;lt;/ReactPopover&amp;gt;
      &amp;lt;ReactPopover
        trigger="hover"
        content={
          &amp;lt;p&amp;gt;This Content Will be render in Popover.&amp;lt;/p&amp;gt;
        }
      &amp;gt;
        &amp;lt;button className="bg-indigo-500 px-4 py-1.5 border rounded text-white"&amp;gt;
          Hover me
        &amp;lt;/button&amp;gt;
      &amp;lt;/ReactPopover&amp;gt;
    &amp;lt;/div&amp;gt;
  );
};

export default Page;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>tailwindcss</category>
      <category>react</category>
      <category>nextjs</category>
      <category>css</category>
    </item>
    <item>
      <title>Scop in Javascript with example</title>
      <dc:creator>ABU SAID</dc:creator>
      <pubDate>Thu, 16 Nov 2023 07:43:12 +0000</pubDate>
      <link>https://forem.com/said7388/scop-in-javascript-with-example-1o78</link>
      <guid>https://forem.com/said7388/scop-in-javascript-with-example-1o78</guid>
      <description>&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%2F1vgla531ye8hjzcv6f48.jpg" 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%2F1vgla531ye8hjzcv6f48.jpg" alt=" " width="800" height="496"&gt;&lt;/a&gt;&lt;br&gt;
JavaScript is a powerful and versatile programming language that is widely used for web development. One of the key concepts in JavaScript is scope, which refers to the accessibility of variables, functions, and objects within a program. In this blog post, we will explain the different types of scope in JavaScript, including global scope, local scope, and function scope, and provide examples to help you understand how they work.&lt;/p&gt;
&lt;h2&gt;
  
  
  Global scope
&lt;/h2&gt;

&lt;p&gt;Global scope in JavaScript refers to variables, functions, and objects that can be accessed from anywhere within a program. These variables, functions, and objects are defined outside of any function or block of code. &lt;br&gt;
For example, consider the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let globalVariable = "Hello, World!";

function myFunction() {
  console.log(globalVariable); // prints "Hello, World!"
}

console.log(globalVariable); // prints "Hello, World!"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the variable &lt;code&gt;globalVariable&lt;/code&gt; is declared outside of any function or block of code, making it accessible from anywhere within the program. Both the &lt;code&gt;myFunction&lt;/code&gt; function and the &lt;code&gt;console.log&lt;/code&gt; statement outside of the function are able to access and print the value of &lt;code&gt;globalVariable&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Local scope
&lt;/h2&gt;

&lt;p&gt;Local scope in JavaScript refers to variables, functions, and objects that can only be accessed within a specific block of code. These variables, functions, and objects are defined within a block of code, such as a &lt;code&gt;if&lt;/code&gt; statement or a &lt;code&gt;for&lt;/code&gt; loop. &lt;br&gt;
For example, consider the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (true) {
  let localVariable = "Hello, World!";
  console.log(localVariable); // prints "Hello, World!"
}

console.log(localVariable); // throws an error, localVariable is not defined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the variable &lt;code&gt;localVariable&lt;/code&gt; is defined within the &lt;code&gt;if&lt;/code&gt; statement, making it only accessible within that block of code. The &lt;code&gt;console.log&lt;/code&gt; statement within the if statement is able to access and print the value of &lt;code&gt;localVariable&lt;/code&gt;, but the &lt;code&gt;console.log&lt;/code&gt; statement outside of the &lt;code&gt;if&lt;/code&gt;statement throws an error because &lt;code&gt;localVariable&lt;/code&gt; is not defined in the global scope.&lt;/p&gt;

&lt;h2&gt;
  
  
  Function scope
&lt;/h2&gt;

&lt;p&gt;Function scope in JavaScript refers to variables, functions, and objects that can only be accessed within a specific function. These variables, functions, and objects are defined within a function, and are not accessible outside of that function. &lt;br&gt;
For example, consider the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function myFunction() {
  let functionVariable = "Hello, World!";
  console.log(functionVariable); // prints "Hello, World!"
}

console.log(functionVariable); // throws an error, functionVariable is not defined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the variable &lt;code&gt;functionVariable&lt;/code&gt; is defined within the &lt;code&gt;myFunction&lt;/code&gt; function, making it only accessible within that function. The &lt;code&gt;console.log&lt;/code&gt; statement within the function is able to access and print the value of &lt;code&gt;functionVariable&lt;/code&gt;, but the &lt;code&gt;console.log&lt;/code&gt; statement outside of the function throws an error because &lt;code&gt;functionVariable&lt;/code&gt; is not defined in the global or local scope.&lt;/p&gt;

&lt;p&gt;In conclusion, understanding the concept of scope in JavaScript is essential for writing clean, efficient, and maintainable code. There are three types of scope in JavaScript: global scope, local scope, and function scope. Global scope refers to variables, functions, and objects that can be accessed from anywhere within a program, local scope refers to variables, functions, and objects that can only be accessed within a specific block of code, and function scope refers to variables, functions, and objects that&lt;/p&gt;

</description>
      <category>scop</category>
      <category>javascript</category>
      <category>node</category>
      <category>programming</category>
    </item>
    <item>
      <title>🚀 Git Cheatsheet for Developers — From Basics to Advanced</title>
      <dc:creator>ABU SAID</dc:creator>
      <pubDate>Wed, 22 Feb 2023 05:38:34 +0000</pubDate>
      <link>https://forem.com/said7388/git-cheatsheet-that-will-make-you-a-master-in-git-11l4</link>
      <guid>https://forem.com/said7388/git-cheatsheet-that-will-make-you-a-master-in-git-11l4</guid>
      <description>&lt;h2&gt;
  
  
  Introduction to Git
&lt;/h2&gt;

&lt;p&gt;Git is the most popular version control system used by developers to track code changes, collaborate efficiently, and manage project history with confidence. Whether you're working solo or as part of a large engineering team, Git has become an essential tool in modern software development.&lt;/p&gt;

&lt;p&gt;However, mastering Git can feel overwhelming at first — especially with its wide range of commands and workflows.&lt;/p&gt;

&lt;p&gt;That’s why this &lt;strong&gt;Git Cheatsheet&lt;/strong&gt; breaks down both &lt;strong&gt;essential&lt;/strong&gt; and &lt;strong&gt;advanced Git commands&lt;/strong&gt; in a clear, practical way. From creating repositories to branching strategies, stashing work, and rewriting history — this guide will help you work faster, cleaner, and smarter with Git.&lt;/p&gt;

&lt;p&gt;Perfect for:&lt;br&gt;
✅ Beginners learning Git&lt;br&gt;
✅ Developers refreshing their skills&lt;br&gt;
✅ Pros optimizing daily workflow&lt;/p&gt;


&lt;h2&gt;
  
  
  📌 Basic Git Commands
&lt;/h2&gt;
&lt;h3&gt;
  
  
  🔧 Initialize a Repository
&lt;/h3&gt;

&lt;p&gt;Create a new Git repo in your current folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This adds a hidden &lt;code&gt;.git&lt;/code&gt; folder that tracks your project history.&lt;/p&gt;




&lt;h3&gt;
  
  
  📥 Clone a Repository
&lt;/h3&gt;

&lt;p&gt;Copy an existing repo to your local machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone &amp;lt;repository-url&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  📦 Stage Changes
&lt;/h3&gt;

&lt;p&gt;Add specific files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &amp;lt;file&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add everything:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  💾 Commit Changes
&lt;/h3&gt;

&lt;p&gt;Save staged changes with a message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Your message here"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pro tip: write clear, meaningful messages.&lt;/p&gt;




&lt;h3&gt;
  
  
  📊 Check Repository Status
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Shows modified, staged, and untracked files.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔍 View Differences
&lt;/h3&gt;

&lt;p&gt;Working directory vs staged:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git diff
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Staged vs last commit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git diff &lt;span class="nt"&gt;--cached&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  🌿 Branching &amp;amp; Merging
&lt;/h3&gt;

&lt;p&gt;Create branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Switch branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create + switch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout &lt;span class="nt"&gt;-b&lt;/span&gt; &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Merge:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git merge &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  🚀 Push Changes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push &amp;lt;remote&amp;gt; &amp;lt;branch&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  📥 Pull Updates
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git pull &amp;lt;remote&amp;gt; &amp;lt;branch&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  📜 View Commit History
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ⚙️ Advanced Git Commands
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ↩️ Revert a Commit (Safe Undo)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git revert &amp;lt;commit-hash&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creates a new commit that undoes changes.&lt;/p&gt;




&lt;h3&gt;
  
  
  🧹 Reset Commits (Rewrite History)
&lt;/h3&gt;

&lt;p&gt;Soft (keep staged):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git reset &lt;span class="nt"&gt;--soft&lt;/span&gt; HEAD~1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mixed (unstage):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git reset &lt;span class="nt"&gt;--mixed&lt;/span&gt; HEAD~1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hard (delete everything):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git reset &lt;span class="nt"&gt;--hard&lt;/span&gt; HEAD~1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;⚠️ Use &lt;code&gt;--hard&lt;/code&gt; carefully.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔁 Rebase Branches
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git rebase &amp;lt;branch-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Moves your commits on top of another branch — keeps history clean.&lt;/p&gt;




&lt;h3&gt;
  
  
  📦 Stash Work Temporarily
&lt;/h3&gt;

&lt;p&gt;Save changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restore:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git stash apply
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  🍒 Cherry-Pick a Commit
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git cherry-pick &amp;lt;commit-hash&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apply one specific commit to another branch.&lt;/p&gt;




&lt;h3&gt;
  
  
  🪝 Git Hooks
&lt;/h3&gt;

&lt;p&gt;Automate actions before/after Git events.&lt;/p&gt;

&lt;p&gt;Location:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.git/hooks/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;pre-commit&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;post-merge&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use them for formatting, tests, or validations.&lt;/p&gt;




&lt;h3&gt;
  
  
  ⚡ Git Aliases (Speed Mode)
&lt;/h3&gt;

&lt;p&gt;Create shortcuts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; alias.co checkout
git config &lt;span class="nt"&gt;--global&lt;/span&gt; alias.cm commit
git config &lt;span class="nt"&gt;--global&lt;/span&gt; alias.br branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git co main
git cm &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"msg"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔄 Popular Git Workflows
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ✅ Centralized Workflow
&lt;/h3&gt;

&lt;p&gt;Single main branch — simple but limited.&lt;/p&gt;

&lt;h3&gt;
  
  
  🌱 Feature Branch Workflow
&lt;/h3&gt;

&lt;p&gt;Each feature gets its own branch (most common).&lt;/p&gt;

&lt;h3&gt;
  
  
  🚦 Gitflow Workflow
&lt;/h3&gt;

&lt;p&gt;Structured branches:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;main&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;develop&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;feature/*&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;release/*&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Great for large teams and releases.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Git isn’t just a tool — it’s a core developer skill.&lt;/p&gt;

&lt;p&gt;Once you master:&lt;br&gt;
✔ Version control&lt;br&gt;
✔ Branching strategies&lt;br&gt;
✔ Clean history&lt;br&gt;
✔ Collaboration&lt;/p&gt;

&lt;p&gt;Your productivity skyrockets.&lt;/p&gt;

&lt;p&gt;Use this cheatsheet as a quick reference — and over time, Git will feel natural instead of confusing.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔗 Let’s Connect
&lt;/h3&gt;

&lt;p&gt;💼 LinkedIn: &lt;a href="https://www.linkedin.com/in/abu-said-bd/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/abu-said-bd/&lt;/a&gt;&lt;br&gt;
💻 GitHub: &lt;a href="https://github.com/said7388" rel="noopener noreferrer"&gt;https://github.com/said7388&lt;/a&gt;&lt;/p&gt;

</description>
      <category>motivation</category>
      <category>career</category>
      <category>goodjob</category>
      <category>git</category>
    </item>
    <item>
      <title>How does ChatGPT generate human-like text?</title>
      <dc:creator>ABU SAID</dc:creator>
      <pubDate>Mon, 06 Feb 2023 07:24:06 +0000</pubDate>
      <link>https://forem.com/said7388/how-does-chatgpt-generate-human-like-text-4h07</link>
      <guid>https://forem.com/said7388/how-does-chatgpt-generate-human-like-text-4h07</guid>
      <description>&lt;p&gt;ChatGPT, developed by OpenAI, is a cutting-edge language model that has made a significant impact in the field of natural language processing. It uses deep learning algorithms to generate human-like text based on the input it receives, making it an excellent tool for chatbots, content creation, and other applications that require natural language processing. In this post, we will explore the workings of ChatGPT to understand how it generates human-like text.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Core of ChatGPT :
&lt;/h3&gt;

&lt;p&gt;The backbone of ChatGPT is a transformer-based neural network that has been trained on a massive amount of text data. This training allows the model to understand the patterns and relationships between words in a sentence and how they can be used to generate new text that is coherent and meaningful. The transformer-based architecture is a novel approach to machine learning that enables the model to learn and make predictions based on the context of the input. This makes it ideal for language models that need to generate text that is relevant to the context of a conversation.&lt;/p&gt;

&lt;h3&gt;
  
  
  How ChatGPT Generates Text :
&lt;/h3&gt;

&lt;p&gt;ChatGPT uses an autoregressive language modeling approach to generate text. When you provide input to ChatGPT, the model first encodes the input into a vector representation. This representation is then used to generate a probability distribution over the next word in the sequence. The model selects the most likely next word and generates a new vector representation based on the new input. This process is repeated until the desired length of text has been developed.&lt;/p&gt;

&lt;p&gt;One of the key strengths of ChatGPT is its ability to handle context. The model has been trained to understand the context of a conversation and can generate text that is relevant to the current topic. This allows it to respond to questions and generate text that is relevant to the context of the conversation. This makes it an excellent tool for chatbots, as it can understand the user's intention and respond accordingly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Scalability and Fine-tuning :
&lt;/h3&gt;

&lt;p&gt;Another critical aspect of ChatGPT is its scalability. The model can be fine-tuned for specific use cases by training it on specific data sets. This allows it to generate text that is more tailored to the needs of the application. For example, if ChatGPT is being used in a customer service chatbot, it can be fine-tuned on data that is relevant to customer service queries to generate more accurate and relevant responses. This fine-tuning process can be done by using transfer learning, where the model is trained on a smaller data set, leveraging the knowledge it gained from its training on the larger data set.&lt;/p&gt;

&lt;h3&gt;
  
  
  Real-world Applications :
&lt;/h3&gt;

&lt;p&gt;ChatGPT has a wide range of real-world applications, from content creation to customer service. It can be used to generate news articles, creative writing, and even poetry. In customer service, ChatGPT can be used as a chatbot to respond to customer queries, freeing up human agents to handle more complex issues. Additionally, ChatGPT can be used in language translation, as it has the ability to understand the context of a conversation and translate text accordingly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In summary&lt;/strong&gt;, ChatGPT's ability to generate human-like text and understand context makes it a versatile tool with endless potential applications. Its deep learning algorithms and transformer-based architecture allow it to generate coherent and meaningful text, making it an exciting development in the field of natural language processing. Whether it's being used in customer service, content creation, or language translation, ChatGPT has the potential to revolutionize the way we interact with machines.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion :
&lt;/h3&gt;

&lt;p&gt;In conclusion, this blog has explored the workings of ChatGPT, a cutting-edge language model developed by OpenAI. We have seen that the model is based on a transformer-based neural network that has been trained on massive amounts of text data, allowing it to generate human-like text based on the context of a conversation. Its scalability and fine-tuning capabilities make it a valuable tool for a wide range of applications, from customer service to content creation. With its ability to understand the context and generate coherent and meaningful text, ChatGPT has the potential to revolutionize the way we interact with machines and will play a crucial role in the development of AI-powered applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;disclaimer:&lt;/strong&gt; This post is also written using ChatGPT.&lt;/p&gt;

</description>
      <category>chatgpt</category>
      <category>webdev</category>
      <category>openai</category>
      <category>ai</category>
    </item>
    <item>
      <title>Make an Image drag and drop with CSS in React</title>
      <dc:creator>ABU SAID</dc:creator>
      <pubDate>Sat, 04 Feb 2023 14:56:40 +0000</pubDate>
      <link>https://forem.com/said7388/make-a-image-drug-and-drop-with-css-in-react-5cf1</link>
      <guid>https://forem.com/said7388/make-a-image-drug-and-drop-with-css-in-react-5cf1</guid>
      <description>&lt;p&gt;React is a popular JavaScript library for building user interfaces, and its flexibility and versatility make it a great choice for building interactive applications. In this tutorial, we will show you how to create a drag-and-drop feature for images using only CSS in React.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1 —
&lt;/h2&gt;

&lt;p&gt;To start, let's set up a React project. You can use either Create React App or any other setup method that works best for you. Let's make a React application using create-react-app.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-react-app drag-and-drop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2 —
&lt;/h2&gt;

&lt;p&gt;Replace &lt;code&gt;App.js&lt;/code&gt; and &lt;code&gt;App.css&lt;/code&gt; with the below code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;App.js&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import './App.css';

function App() {
  return (
    &amp;lt;div className="App"&amp;gt;
      &amp;lt;h2 className="heading"&amp;gt;Select Image:&amp;lt;/h2&amp;gt;
      &amp;lt;div className="image-area"&amp;gt;

      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;App.css&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
.App {
  text-align: center;
  width: 100vw;
  height: 100vh;

}

.heading {
  font-size: 32px;
  font-weight: 500;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3 —
&lt;/h2&gt;

&lt;p&gt;Now create a new file and component &lt;code&gt;ImageContainer.js&lt;/code&gt; in the &lt;code&gt;src&lt;/code&gt; directory and take a div for drag and drop container.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;ImageContainer.js&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';

const ImageContainer = () =&amp;gt; {

    return (
        &amp;lt;div className="image-container"&amp;gt;

        &amp;lt;/div&amp;gt;
    );
};

export default ImageContainer;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then make a CSS file &lt;code&gt;ImageContainer.css&lt;/code&gt; in the &lt;code&gt;src&lt;/code&gt; directory and add some styles in the image container.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;ImageContainer.css&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.image-container {
    width: 60%;
    height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(0, 0, 0, .3);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 4 —
&lt;/h2&gt;

&lt;p&gt;Now we will take a div with an input field and input text title inside the &lt;code&gt;.image-container&lt;/code&gt; class and add some style in the &lt;code&gt;ImageContainer.css&lt;/code&gt; file. We will also take a state for the image URL and an onChage function for the update state.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;ImageContainer.js will be&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import './ImageContainer.css';

const ImageContainer = () =&amp;gt; {
    const [url, setUrl] = React.useState('');

    const onChange = (e) =&amp;gt; {
        const files = e.target.files;
        files.length &amp;gt; 0 &amp;amp;&amp;amp; setUrl(URL.createObjectURL(files[0]));
    };

    return (
        &amp;lt;div className="image-container"&amp;gt;
            &amp;lt;div className="upload-container"&amp;gt;
                &amp;lt;input
                    type="file"
                    className="input-file"
                    accept=".png, .jpg, .jpeg"
                    onChange={onChange}
                /&amp;gt;
                &amp;lt;p&amp;gt;Drag &amp;amp; Drop here&amp;lt;/p&amp;gt;
                &amp;lt;p&amp;gt;or&amp;lt;/p&amp;gt;
                &amp;lt;p&amp;gt;Click&amp;lt;/p&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
    );
};

export default ImageContainer;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;ImageContainer.css will be&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.image-container {
    width: 60%;
    height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(0, 0, 0, .3);
}

.upload-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: white;
}

.upload-container&amp;gt;p {
    font-size: 18px;
    margin: 4px;
    font-weight: 500;
}

.input-file {
    display: block;
    border: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 5 —
&lt;/h2&gt;

&lt;p&gt;Now we will preview the image file conditionally. If you have dropped an image will render the image and or render the drag-and-drop area.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;ImageContainer.js will be&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import './ImageContainer.css';

const ImageContainer = () =&amp;gt; {
    const [url, setUrl] = React.useState('');

    const onChange = (e) =&amp;gt; {
        const files = e.target.files;
        files.length &amp;gt; 0 &amp;amp;&amp;amp; setUrl(URL.createObjectURL(files[0]));
    };

    return (
        &amp;lt;div className="image-container"&amp;gt;
            {
                url ?
                    &amp;lt;img
                        className='image-view'
                        style={{ width: '100%', height: '100%' }}
                        src={url} alt="" /&amp;gt;
                    :
                    &amp;lt;div className="upload-container"&amp;gt;
                        &amp;lt;input
                            type="file"
                            className="input-file"
                            accept=".png, .jpg, .jpeg"
                            onChange={onChange}
                        /&amp;gt;
                        &amp;lt;p&amp;gt;Drag &amp;amp; Drop here&amp;lt;/p&amp;gt;
                        &amp;lt;p&amp;gt;or &amp;lt;span style={{ color: "blue" }} &amp;gt;Browse&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;

                    &amp;lt;/div&amp;gt;
            }
        &amp;lt;/div&amp;gt;
    );
};

export default ImageContainer;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 6 —
&lt;/h2&gt;

&lt;p&gt;Now we will import the &lt;code&gt;ImageContainer&lt;/code&gt; component in our &lt;code&gt;App.js&lt;/code&gt; and run our application using the &lt;code&gt;npm start&lt;/code&gt; command and have fun while coding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;App.js will be&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import './App.css';
import ImageContainer from './ImageContainer';

function App() {
  return (
    &amp;lt;div className="App"&amp;gt;
      &amp;lt;h2 className="heading"&amp;gt;Select Image:&amp;lt;/h2&amp;gt;
      &amp;lt;div className="image-area"&amp;gt;
        &amp;lt;ImageContainer /&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export default App;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this tutorial, we showed you how to create a drag-and-drop feature for images using only CSS in React.&lt;/p&gt;

&lt;p&gt;You can grab the source code from &lt;a href="https://github.com/said7388/react-drag-and-drop" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>devto</category>
      <category>community</category>
      <category>announcement</category>
    </item>
    <item>
      <title>Top 10 ES6 Features that Every Developer Should know</title>
      <dc:creator>ABU SAID</dc:creator>
      <pubDate>Thu, 02 Feb 2023 14:24:21 +0000</pubDate>
      <link>https://forem.com/said7388/top-10-es6-features-that-every-developer-should-know-2f8g</link>
      <guid>https://forem.com/said7388/top-10-es6-features-that-every-developer-should-know-2f8g</guid>
      <description>&lt;p&gt;JavaScript is one of the most widely-used programming languages in the world, and its popularity continues to grow. ES6, also known as ECMAScript 2015, introduced many new and exciting features to the JavaScript language. In this blog, we'll take a look at 10 advanced ES6 features that every JavaScript developer should master in order to stay ahead of the curve. Whether you're a beginner or an experienced developer, these features are sure to enhance your JavaScript skills and take your coding to the next level.&lt;/p&gt;

&lt;h2&gt;
  
  
  01. Arrow Functions:
&lt;/h2&gt;

&lt;p&gt;Arrow functions are a concise syntax for writing anonymous functions. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For instance, instead of writing this:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const square = function (num) {
  return num * num;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;You can write the same code with an arrow function:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const square = (num) =&amp;gt; num * num;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  02. Template Literals:
&lt;/h3&gt;

&lt;p&gt;Template literals allow you to embed expressions in string literals. They use backticks instead of quotes and can be multi-line as well.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const name = "John";
const greeting = `Hello, ${name}!`;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  03. Destructuring:
&lt;/h3&gt;

&lt;p&gt;Destructuring allows you to extract data from arrays or objects into separate variables. This makes it easier to work with complex data structures.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here's an example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const numbers = [1, 2, 3];
const [first, second, third] = numbers; //Array destructure

const person ={
  name: "John",
  age: 18,
}
const {name, age} = person; // Object destructure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  04. Spread Operator:
&lt;/h3&gt;

&lt;p&gt;The spread operator allows you to spread elements of an array or properties of an object into a new array or object. This is useful for merging arrays or objects, or for spreading an array into function arguments.&lt;/p&gt;

&lt;p&gt;Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const numbers = [1, 2, 3];
const newNumbers = [...numbers, 4, 5];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  05. Default Parameters:
&lt;/h3&gt;

&lt;p&gt;Default parameters allow you to specify default values for function parameters in case no value is passed. This makes it easier to handle edge cases and reduces the need for conditional statements.&lt;/p&gt;

&lt;p&gt;Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const greet = (name = "John") =&amp;gt; {
  console.log(`Hello, ${name}!`);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  06. Rest Parameters:
&lt;/h3&gt;

&lt;p&gt;Rest parameters allow you to collect an indefinite number of arguments into an array. This is useful for writing functions that can accept any number of arguments.&lt;/p&gt;

&lt;p&gt;Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const sum = (...numbers) =&amp;gt; {
  let result = 0;
  for (const number of numbers) {
    result += number;
  }
  return result;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  07. Class Definitions:
&lt;/h3&gt;

&lt;p&gt;Class definitions provide a more object-oriented way of defining objects in JavaScript. They make it easier to create reusable objects with inheritance and encapsulation.&lt;/p&gt;

&lt;p&gt;Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Person {
  constructor(name) {
    this.name = name;
  }

  greet() {
    console.log(`Hello, my name is ${this.name}`);
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  08. Modules:
&lt;/h3&gt;

&lt;p&gt;Modules allow you to organize your code into smaller, reusable pieces. This makes it easier to manage complex projects and reduces the risk of naming collisions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here's a simple example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// greeting.js
export const greet = (name) =&amp;gt; {
  console.log(`Hello, ${name}!`);
};

// main.js
import { greet } from "./greeting.js";
greet("John");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  09. Promise:
&lt;/h3&gt;

&lt;p&gt;Promises are a way to handle asynchronous operations in JavaScript. They provide a way to handle errors, and can be combined to create complex asynchronous flows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here's a simple example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const fetchData = () =&amp;gt; {
  return new Promise((resolve, reject) =&amp;gt; {
    setTimeout(() =&amp;gt; {
      resolve("Data fetched");
    }, 1000);
  });
};

fetchData().then((data) =&amp;gt; {
  console.log(data);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  10. Map and Set:
&lt;/h3&gt;

&lt;p&gt;The Map and Set data structures provide an efficient way to store unique values in JavaScript. They also provide a variety of useful methods for searching and manipulating the data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Creating a Map
const map = new Map();
map.set("name", "John");
map.set("age", 30);

// Accessing values in a Map
console.log(map.get("name")); // Output: John
console.log(map.get("age")); // Output: 30

// Iterating over a Map
for (const [key, value] of map) {
  console.log(`${key}: ${value}`);
}

// Output:
// name: John
// age: 30

// Creating a Set
const set = new Set();
set.add("John");
set.add("Jane");
set.add("Jim");

// Iterating over a Set
for (const name of set) {
  console.log(name);
}

// Output:
// John
// Jane
// Jim

// Checking if a value exists in a Set
console.log(set.has("John")); // Output: true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In conclusion, the advanced ES6 features outlined in this blog are essential for every JavaScript developer to master. They provide a more efficient, concise, and organized way of writing code, making it easier to work with complex data structures and handle asynchronous operations. Whether you're looking to improve your existing skills or just starting out with JavaScript, these features are an excellent starting point. Remember that becoming an expert in these features takes time and practice, so don't be discouraged if you don't understand everything right away. With consistent effort and dedication, you'll be able to master these advanced ES6 features and take your JavaScript skills to new heights.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>react</category>
      <category>node</category>
    </item>
    <item>
      <title>Highly Effective 7 Habits for Developers</title>
      <dc:creator>ABU SAID</dc:creator>
      <pubDate>Thu, 02 Feb 2023 08:53:05 +0000</pubDate>
      <link>https://forem.com/said7388/highly-effective-7-habits-for-developers-50c2</link>
      <guid>https://forem.com/said7388/highly-effective-7-habits-for-developers-50c2</guid>
      <description>&lt;p&gt;Success in software development doesn’t happen overnight — and it definitely isn’t luck. It’s built through discipline, continuous learning, smart work habits, and a mindset focused on growth.&lt;/p&gt;

&lt;p&gt;In a fast-moving tech world where frameworks evolve and tools change constantly, developers who stay effective are the ones who develop strong daily habits. These habits help them learn faster, write better code, avoid burnout, and stand out in their careers.&lt;/p&gt;

&lt;p&gt;Let’s break down &lt;strong&gt;7 powerful habits&lt;/strong&gt; that can transform you into a highly effective software developer.&lt;/p&gt;




&lt;h3&gt;
  
  
  ✅ 1. Map Out a Timetable
&lt;/h3&gt;

&lt;p&gt;Just like any high-performing professional, developers thrive with structure.&lt;/p&gt;

&lt;p&gt;Create a daily or weekly schedule that includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learning time&lt;/li&gt;
&lt;li&gt;Coding practice&lt;/li&gt;
&lt;li&gt;Project work&lt;/li&gt;
&lt;li&gt;Rest and reflection&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you're learning a new language or skill, a timetable keeps you focused, reduces distractions, and ensures steady progress instead of random bursts of motivation.&lt;/p&gt;




&lt;h3&gt;
  
  
  🧠 2. Embrace Mistakes and Learn From Them
&lt;/h3&gt;

&lt;p&gt;Mistakes aren’t failures — they’re feedback.&lt;/p&gt;

&lt;p&gt;Every bug, crash, or wrong approach teaches you something valuable. Instead of getting frustrated:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Analyze what went wrong&lt;/li&gt;
&lt;li&gt;Understand why it happened&lt;/li&gt;
&lt;li&gt;Improve your approach next time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This habit alone can accelerate your growth faster than any tutorial.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔁 3. Be Consistent
&lt;/h3&gt;

&lt;p&gt;Consistency beats intensity.&lt;/p&gt;

&lt;p&gt;Even 1–2 focused hours of coding every day will outperform random long sessions once a week. Daily practice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Strengthens problem-solving skills&lt;/li&gt;
&lt;li&gt;Builds muscle memory&lt;/li&gt;
&lt;li&gt;Keeps concepts fresh&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Small progress every day compounds into massive skill growth over time.&lt;/p&gt;




&lt;h3&gt;
  
  
  👨‍🏫 4. Find a Mentor
&lt;/h3&gt;

&lt;p&gt;A good mentor can shortcut years of struggle.&lt;/p&gt;

&lt;p&gt;They help you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Avoid common mistakes&lt;/li&gt;
&lt;li&gt;Improve code quality&lt;/li&gt;
&lt;li&gt;Navigate career decisions&lt;/li&gt;
&lt;li&gt;Think like a professional developer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whether through work, online communities, or open-source projects — learning from someone experienced is a game-changer.&lt;/p&gt;




&lt;h3&gt;
  
  
  🛠 5. Work on Real Projects
&lt;/h3&gt;

&lt;p&gt;Tutorials teach syntax.&lt;br&gt;
Projects teach problem-solving.&lt;/p&gt;

&lt;p&gt;Build things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Small apps&lt;/li&gt;
&lt;li&gt;Websites&lt;/li&gt;
&lt;li&gt;APIs&lt;/li&gt;
&lt;li&gt;Automation tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Start simple and gradually increase complexity. Real projects give you confidence, portfolio value, and real-world experience that employers actually care about.&lt;/p&gt;




&lt;h3&gt;
  
  
  🎯 6. Don’t Be a Jack of All Trades
&lt;/h3&gt;

&lt;p&gt;Trying to learn everything at once slows you down.&lt;/p&gt;

&lt;p&gt;Instead:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Master one core skill (frontend, backend, mobile, DevOps, etc.)&lt;/li&gt;
&lt;li&gt;Build depth first&lt;/li&gt;
&lt;li&gt;Expand later&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Specialization makes you more valuable, more confident, and more employable.&lt;/p&gt;




&lt;h3&gt;
  
  
  📚 7. Stay Up to Date
&lt;/h3&gt;

&lt;p&gt;Technology evolves fast — great developers evolve faster.&lt;/p&gt;

&lt;p&gt;Make it a habit to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read tech blogs&lt;/li&gt;
&lt;li&gt;Watch dev talks&lt;/li&gt;
&lt;li&gt;Follow industry leaders&lt;/li&gt;
&lt;li&gt;Explore new tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Staying current keeps your skills relevant and opens new opportunities.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌟 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Great developers aren’t born — they’re built through habits.&lt;/p&gt;

&lt;p&gt;By:&lt;br&gt;
✔ Managing your time&lt;br&gt;
✔ Learning from mistakes&lt;br&gt;
✔ Practicing consistently&lt;br&gt;
✔ Building real projects&lt;br&gt;
✔ Focusing deeply&lt;br&gt;
✔ Staying updated&lt;/p&gt;

&lt;p&gt;You set yourself up for long-term success in tech.&lt;/p&gt;

&lt;p&gt;Start small. Stay consistent. And watch your skills level up faster than you ever imagined. 💻🔥&lt;/p&gt;

</description>
      <category>web3</category>
      <category>blockchain</category>
      <category>crypto</category>
    </item>
    <item>
      <title>Asynchronous programming in Javascript</title>
      <dc:creator>ABU SAID</dc:creator>
      <pubDate>Tue, 31 Jan 2023 18:03:20 +0000</pubDate>
      <link>https://forem.com/said7388/asynchronous-programming-in-javascript-4mep</link>
      <guid>https://forem.com/said7388/asynchronous-programming-in-javascript-4mep</guid>
      <description>&lt;p&gt;JavaScript, being a single-threaded language, can only process one task at a time. This can result in long wait times for complex tasks, as the script will be blocked from executing any other tasks until it has been completed. To tackle this, JavaScript offers asynchronous programming, which allows the script to continue executing other tasks while it waits for an asynchronous task to complete. In this blog, we’ll explore the basics of asynchronous programming in JavaScript and how it can be achieved through the use of callback functions, promises, and async/await.&lt;/p&gt;

&lt;h2&gt;
  
  
  Callback Functions
&lt;/h2&gt;

&lt;p&gt;A callback function is a function that is passed as an argument to another function and is executed after the main function has been completed. Callbacks are used in asynchronous programming to wait for a task to complete before executing the next step.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For example, consider the following code:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function slowTask(callback) {
  setTimeout(() =&amp;gt; {
    console.log("Slow task completed.");
    callback();
  }, 1000);
}

function runProgram() {
  console.log("Program started.");
  slowTask(() =&amp;gt; {
    console.log("Callback function executed.");
  });
  console.log("Program ended.");
}

runProgram();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the &lt;code&gt;slowTask&lt;/code&gt; function takes a callback as an argument. The &lt;code&gt;slowTask&lt;/code&gt; function uses &lt;code&gt;setTimeout&lt;/code&gt; to delay the execution of a task for one second. The &lt;code&gt;runProgram&lt;/code&gt; function calls &lt;code&gt;slowTask&lt;/code&gt; and passes a callback function as an argument. The &lt;code&gt;runProgram&lt;/code&gt; function also logs "Program started" and "Program ended". When the &lt;code&gt;slowTask&lt;/code&gt; function has been completed, it logs "Slow task completed" and executes the callback function, which logs "Callback function executed". &lt;br&gt;
The output will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Program started.
Program ended.
Slow task completed.
Callback function executed.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Promises
&lt;/h2&gt;

&lt;p&gt;Promises are a more modern approach to asynchronous programming in JavaScript. A promise represents the result of an asynchronous operation and can be in one of three states: pending, fulfilled, or rejected. A promise can be created using the &lt;code&gt;Promise&lt;/code&gt; constructor, and its state can be determined using the &lt;code&gt;then&lt;/code&gt; and &lt;code&gt;catch&lt;/code&gt; methods. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const slowTask = new Promise((resolve, reject) =&amp;gt; {
  setTimeout(() =&amp;gt; {
    resolve("Slow task completed.");
  }, 1000);
});

function runProgram() {
  console.log("Program started.");
  slowTask
    .then((result) =&amp;gt; {
      console.log(result);
    })
    .catch((error) =&amp;gt; {
      console.error(error);
    });
  console.log("Program ended.");
}

runProgram();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, &lt;code&gt;slowTask&lt;/code&gt; is a promise that is resolved after one second with the result "Slow task completed.". The &lt;code&gt;runProgram&lt;/code&gt; function calls &lt;code&gt;slowTask&lt;/code&gt; and uses the &lt;code&gt;then&lt;/code&gt; method to log the result when the promise is fulfilled. &lt;br&gt;
The output will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Program started.
Program ended.
Slow task completed.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Async/Await
&lt;/h2&gt;

&lt;p&gt;Async/await is the latest and most readable way to handle asynchronous operations in JavaScript. It allows developers to write asynchronous code that looks like synchronous code, making it easier to understand and maintain. The async keyword is used to declare an asynchronous function, and the await keyword is used to wait for a promise to be resolved.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here is an example to demonstrate the use of async/await in JavaScript:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function fetchData() {
  const response = await fetch("https://api.example.com/data");
  const data = await response.json();
  console.log(data);
}

fetchData();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the &lt;code&gt;fetchData&lt;/code&gt; function is declared as asynchronous using the &lt;code&gt;async&lt;/code&gt; keyword. The function uses &lt;code&gt;fetch&lt;/code&gt; to retrieve data from an API, and &lt;code&gt;await&lt;/code&gt; is used to wait for the fetch operation to complete. The resolved response is then transformed into a JSON object using &lt;code&gt;response.json()&lt;/code&gt;. The &lt;code&gt;await&lt;/code&gt; keyword is used to wait for the JSON transformation to complete, and the final result is logged to the console.&lt;/p&gt;

&lt;p&gt;It's important to note that the code within an asynchronous function will be executed asynchronously, but the code outside of the function will still be executed synchronously. Also, the await keyword can only be used within an asynchronous function.&lt;/p&gt;

&lt;p&gt;In conclusion, asynchronous programming in JavaScript allows the script to continue executing other tasks while it waits for an asynchronous task to complete. Callback functions, promises, and async/await are three ways to achieve asynchronous programming in JavaScript. Callback functions are the simplest and most basic way to handle asynchronous operations, while promises offer a more modern and flexible approach. Async/await provides the most readable way to handle asynchronous operations and is the recommended method for modern JavaScript programming. Understanding asynchronous programming in JavaScript is important for creating efficient and responsive applications, and is a must-have skill for any JavaScript developer.&lt;/p&gt;

</description>
      <category>crypto</category>
      <category>cryptocurrency</category>
      <category>blockchain</category>
      <category>web3</category>
    </item>
    <item>
      <title>Top 20 React.JS interview questions.</title>
      <dc:creator>ABU SAID</dc:creator>
      <pubDate>Mon, 30 Jan 2023 05:03:33 +0000</pubDate>
      <link>https://forem.com/said7388/top-20-reactjs-interview-questions-3a0m</link>
      <guid>https://forem.com/said7388/top-20-reactjs-interview-questions-3a0m</guid>
      <description>&lt;p&gt;As a React developer, it is important to have a solid understanding of the framework's key concepts and principles. With this in mind, I have put together a list of 20 important questions that every React developer should know, whether they are interviewing for a job or just looking to improve their skills.&lt;/p&gt;

&lt;p&gt;Before diving into the questions and answers, I suggest trying to answer each question on your own before looking at the answers provided. This will help you gauge your current level of understanding and identify areas that may need further improvement.&lt;/p&gt;

&lt;p&gt;Let's get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  01. What is React and what are its benefits?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; React is a JavaScript library for building user interfaces. It is used for building web applications because it allows developers to create reusable UI components and manage the state of the application in an efficient and organized way.&lt;/p&gt;

&lt;h2&gt;
  
  
  02. What is the virtual DOM and how does it work?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; The Virtual DOM (Document Object Model) is a representation of the actual DOM in the browser. It enables React to update only the specific parts of a web page that need to change, instead of rewriting the entire page, leading to increased performance.&lt;/p&gt;

&lt;p&gt;When a component's state or props change, React will first create a new version of the Virtual DOM that reflects the updated state or props. It then compares this new version with the previous version to determine what has changed.&lt;/p&gt;

&lt;p&gt;Once the changes have been identified, React will then update the actual DOM with the minimum number of operations necessary to bring it in line with the new version of the Virtual DOM. This process is known as "reconciliation".&lt;/p&gt;

&lt;p&gt;The use of a Virtual DOM allows for more efficient updates because it reduces the amount of direct manipulation of the actual DOM, which can be a slow and resource-intensive process. By only updating the parts that have actually changed, React can improve the performance of an application, especially on slow devices or when dealing with large amounts of data.&lt;/p&gt;

&lt;h2&gt;
  
  
  03. How does React handle updates and rendering?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; React handles updates and rendering through a virtual DOM and component-based architecture. When a component's state or props change, React creates a new version of the virtual DOM that reflects the updated state or props, then compares it with the previous version to determine what has changed. React updates the actual DOM with the minimum number of operations necessary to bring it in line with the new version of the virtual DOM, a process called "reconciliation". React also uses a component-based architecture where each component has its own state and render method. It re-renders only the components that have actually changed. It does this efficiently and quickly, which is why React is known for its performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  04. Explain the concept of Components in React?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; A React component is a JavaScript function or class that returns a React element, which describes the UI for a piece of the application. Components can accept inputs called "props", and manage their own state.&lt;/p&gt;

&lt;h2&gt;
  
  
  05. What is JSX and why is it used in React?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; JSX is a syntax extension for JavaScript that allows embedding HTML-like syntax in JavaScript. It is used in React to describe the UI, and is transpiled to plain JavaScript by a build tool such as Babel.&lt;/p&gt;

&lt;h2&gt;
  
  
  06. What is the difference between state and props?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; State and props are both used to store data in a React component, but they serve different purposes and have different characteristics.&lt;/p&gt;

&lt;p&gt;Props (short for "properties") are a way to pass data from a parent component to a child component. They are read-only and cannot be modified by the child component.&lt;/p&gt;

&lt;p&gt;State, on the other hand, is an object that holds the data of a component that can change over time. It can be updated using the setState() method and is used to control the behavior and rendering of a component.&lt;/p&gt;

&lt;h2&gt;
  
  
  07. What is the difference between controlled and uncontrolled components in React?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; In React, controlled and uncontrolled components refer to the way that forms are handled. A controlled component is a component where the state of the form is controlled by React, and updates to the form's inputs are handled by event handlers. An uncontrolled component, on the other hand, relies on the default behavior of the browser to handle updates to the form's inputs.&lt;/p&gt;

&lt;p&gt;A controlled component is a component where the value of input fields is set by state and changes are managed by React's event handlers, this allows for better control over the form's behavior and validation, and it makes it easy to handle form submission.&lt;/p&gt;

&lt;p&gt;On the other hand, an uncontrolled component is a component where the value of the input fields is set by the default value attribute, and changes are managed by the browser's default behavior, this approach is less performant and it's harder to handle form submission and validation.&lt;/p&gt;

&lt;h2&gt;
  
  
  08. What is Redux and how does it work with React?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; Redux is a predictable state management library for JavaScript applications, often used with React. It provides a centralized store for the application's state, and uses pure functions called reducers to update the state in response to actions.&lt;/p&gt;

&lt;p&gt;In a React app, Redux is integrated with React via the react-redux library, which provides the connect function for connecting components to the Redux store and dispatching actions. The components can access the state from the store, and dispatch actions to update the state, via props provided by the connect function.&lt;/p&gt;

&lt;h2&gt;
  
  
  09. Can you explain the concept of Higher Order Components (HOC) in React?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; A Higher Order Component (HOC) in React is a function that takes a component and returns a new component with additional props. HOCs are used to reuse logic across multiple components, such as adding a common behavior or styling.&lt;/p&gt;

&lt;p&gt;HOCs are used by wrapping a component within the HOC, which returns a new component with the added props. The original component is passed as an argument to the HOC, and receives the additional props via destructuring. HOCs are pure functions, meaning they do not modify the original component, but return a new, enhanced component.&lt;/p&gt;

&lt;p&gt;For example, an HOC could be used to add authentication behavior to a component, such as checking if a user is logged in before rendering the component. The HOC would handle the logic for checking if the user is logged in, and pass a prop indicating the login status to the wrapped component.&lt;/p&gt;

&lt;p&gt;HOCs are a powerful pattern in React, allowing for code reuse and abstraction, while keeping the components modular and easy to maintain.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. What is the difference between server-side rendering and client-side rendering in React?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; Server-side rendering (SSR) and client-side rendering (CSR) are two different ways of rendering a React application.&lt;/p&gt;

&lt;p&gt;In SSR, the initial HTML is generated on the server, and then sent to the client, where it is hydrated into a full React app. This results in a faster initial load time, as the HTML is already present on the page, and can be indexed by search engines.&lt;/p&gt;

&lt;p&gt;In CSR, the initial HTML is a minimal, empty document, and the React app is built and rendered entirely on the client. The client makes API calls to fetch the data required to render the UI. This results in a slower initial load time, but a more responsive and dynamic experience, as all the rendering is done on the client.&lt;/p&gt;

&lt;h2&gt;
  
  
  11. What are React Hooks and how do they work?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; React Hooks are a feature in React that allow functional components to have state and other lifecycle methods without using class components. They make it easier to reuse state and logic across multiple components, making code more concise and easier to read. Hooks include useState for adding state and useEffect for performing side effects in response to changes in state or props. They make it easier to write reusable, maintainable code.&lt;/p&gt;

&lt;h2&gt;
  
  
  12. How does React handle state management?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; React handles state management through its state object and setState() method. The state object is a data structure that stores values that change within a component and can be updated using the setState() method. The state updates trigger a re-render of the component, allowing it to display updated values dynamically. React updates the state in an asynchronous and batched manner, ensuring that multiple setState() calls are merged into a single update for better performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  13. How do work useEffect hook in React?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; The useEffect hook in React allows developers to perform side effects such as data fetching, subscription, and setting up/cleaning up timers, in functional components. It runs after every render, including the first render, and after the render is committed to the screen. The useEffect hook takes two arguments - a function to run after every render and an array of dependencies that determines when the effect should be run. If the dependency array is empty or absent, the effect will run after every render.&lt;/p&gt;

&lt;h2&gt;
  
  
  14. Can you explain the concept of server-side rendering in React?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; Server-side rendering (SSR) in React is the process of rendering components on the server and sending fully rendered HTML to the browser. SSR improves the initial loading performance and SEO of a React app by providing a fully rendered HTML to the browser, reducing the amount of JavaScript that needs to be parsed and executed on the client, and improving the indexing of a web page by search engines. In SSR, the React components are rendered on the server and sent to the client as a fully formed HTML string, improving the initial load time and providing a more SEO-friendly web page.&lt;/p&gt;

&lt;h2&gt;
  
  
  15. How does React handle events and what are some common event handlers?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; React handles events through its event handling system, where event handlers are passed as props to the components. Event handlers are functions that are executed when a specific event occurs, such as a user clicking a button. Common event handlers in React include onClick, onChange, onSubmit, etc. The event handler receives an event object, which contains information about the event, such as the target element, the type of event, and any data associated with the event. React event handlers should be passed &lt;br&gt;
as props to the components, and the event handlers should be defined within the component or in a separate helper function.&lt;/p&gt;

&lt;h2&gt;
  
  
  16. Can you explain the concept of React context?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; React context is a way to share data between components without passing props down manually through every level of the component tree. The context is created with a provider and consumed by multiple components using the useContext hook.&lt;/p&gt;

&lt;h2&gt;
  
  
  17. How does React handle routing and what are some popular routing libraries for React?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; React handles routing by using React Router library, which provides routing capabilities to React applications. Some popular routing libraries for React include React Router, Reach Router, and Next.js.&lt;/p&gt;

&lt;h2&gt;
  
  
  18. What are some best practices for performance optimization in React?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; Best practices for performance optimization in React include using memoization, avoiding unnecessary re-renders, using lazy loading for components and images, and using the right data structures.&lt;/p&gt;

&lt;h2&gt;
  
  
  19. How does React handle testing and what are some popular testing frameworks for React?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; React handles testing using testing frameworks such as Jest, Mocha, and Enzyme. Jest is a popular testing framework for React applications, while Mocha and Enzyme are also widely used.&lt;/p&gt;

&lt;h2&gt;
  
  
  20. How do you handle asynchronous data loading in React?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ans:&lt;/strong&gt; Asynchronous data loading in React can be handled using various methods such as the fetch API, Axios, or other network libraries. It can also be handled using the &lt;code&gt;useState&lt;/code&gt; and &lt;code&gt;useEffect&lt;/code&gt; hooks to trigger a state update when data is returned from the API call. It is important to handle loading and error states properly to provide a good user experience.&lt;/p&gt;

&lt;p&gt;In conclusion, this blog post covers the top 20 major questions that a React developer should know in 2023. The questions cover a wide range of topics from the basics of React, its benefits and architecture, to more advanced concepts such as JSX, state and props, controlled and uncontrolled components, Redux, Higher Order Components, and more. By trying to answer each question yourself before looking at the answers, you can gain a deeper understanding of the React framework and become a better React developer. &lt;/p&gt;

&lt;p&gt;Connect with me on Linkedin : &lt;a href="https://www.linkedin.com/in/abu-said-bd/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/abu-said-bd/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>interview</category>
      <category>nextjs</category>
      <category>node</category>
    </item>
  </channel>
</rss>
