<?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>DEV Community: Rezzak</title>
    <description>The latest articles on DEV Community by Rezzak (@rezzakali).</description>
    <link>https://dev.to/rezzakali</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%2F939355%2F8dfe577f-6917-470c-b7dd-7897f3b852a6.png</url>
      <title>DEV Community: Rezzak</title>
      <link>https://dev.to/rezzakali</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rezzakali"/>
    <language>en</language>
    <item>
      <title>Basic Git Command</title>
      <dc:creator>Rezzak</dc:creator>
      <pubDate>Sat, 05 Nov 2022 15:40:36 +0000</pubDate>
      <link>https://dev.to/rezzakali/basic-git-command-2hi</link>
      <guid>https://dev.to/rezzakali/basic-git-command-2hi</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1OCjJs2Z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/guswqsa6s2jivlywjgwl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1OCjJs2Z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/guswqsa6s2jivlywjgwl.png" alt="Image description" width="880" height="478"&gt;&lt;/a&gt; &lt;br&gt;
 Hi there 🤚&lt;/p&gt;

&lt;p&gt;This essential Git commands you must know if you are a beginner in web dev….&lt;/p&gt;

&lt;p&gt;Let’s start.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;1. git config [options]&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;👉 Sets the username and email address for commits.&lt;/p&gt;

&lt;p&gt;git config –global user.name “jag”&lt;/p&gt;

&lt;p&gt;git config –global user.email &lt;a href="mailto:youremail@gmail.com"&gt;youremail@gmail.com&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. git init
&lt;/h2&gt;

&lt;p&gt;👉 Initialize repository as git repository&lt;/p&gt;

&lt;p&gt;git init&lt;/p&gt;

&lt;h2&gt;
  
  
  3. git clone [url]
&lt;/h2&gt;

&lt;p&gt;👉 Clone repository from any server like Github Gitlab&lt;/p&gt;

&lt;p&gt;git clone &lt;a href="https://github.com/yourusername/hello.git"&gt;https://github.com/yourusername/hello.git&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. git status
&lt;/h2&gt;

&lt;p&gt;👉 Check the current status of working tree &lt;/p&gt;

&lt;p&gt;git status&lt;/p&gt;

&lt;h2&gt;
  
  
  5. git add [filename(s)]
&lt;/h2&gt;

&lt;p&gt;👉Puts the unstage files to staging area&lt;/p&gt;

&lt;p&gt;git add index.js&lt;/p&gt;

&lt;p&gt;git add .&lt;/p&gt;

&lt;h2&gt;
  
  
  6. git commit –m [message]
&lt;/h2&gt;

&lt;p&gt;👉 Records changes to the git repository&lt;/p&gt;

&lt;p&gt;git commit –m “make it better”&lt;/p&gt;

&lt;p&gt;git commit –a // commit all files without message&lt;/p&gt;

&lt;h2&gt;
  
  
  7. git remote [options] [variables] [url]
&lt;/h2&gt;

&lt;p&gt;👉Connect your local repo to remote over server&lt;/p&gt;

&lt;p&gt;git remote add&lt;/p&gt;

&lt;p&gt;origin &lt;a href="https://github.com/yourusername/repo.git"&gt;https://github.com/yourusername/repo.git&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  8. git push [options] [variables] [branch]
&lt;/h2&gt;

&lt;p&gt;👉Push the contents of your local repo to the remote repo&lt;/p&gt;

&lt;p&gt;git push –u origin main&lt;/p&gt;

&lt;h2&gt;
  
  
  9. git pull [variables] [branch] [url]
&lt;/h2&gt;

&lt;p&gt;👉 Fetch and integrate the content of the remote repo to local repo..&lt;/p&gt;

&lt;p&gt;git pull origin main&lt;/p&gt;

&lt;p&gt;git pull &lt;a href="https://github.com/username/repo"&gt;https://github.com/username/repo&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  10. git checkout [branch]
&lt;/h2&gt;

&lt;p&gt;👉 Move from one branch to another&lt;/p&gt;

&lt;p&gt;git checkout roj&lt;/p&gt;

&lt;h2&gt;
  
  
  11. git checkout [options] [branch]
&lt;/h2&gt;

&lt;p&gt;👉 Create specific branch and simultaneously switches to it&lt;/p&gt;

&lt;p&gt;git checkout –b jagroj&lt;/p&gt;

&lt;h2&gt;
  
  
  12. git branch [options] [branch]
&lt;/h2&gt;

&lt;p&gt;👉 Performs operations over the specified branch&lt;/p&gt;

&lt;p&gt;git branch –d jagroj&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to preview your uploaded profile picture in front-end when you uploaded</title>
      <dc:creator>Rezzak</dc:creator>
      <pubDate>Tue, 01 Nov 2022 15:16:43 +0000</pubDate>
      <link>https://dev.to/rezzakali/how-to-preview-your-uploaded-profile-picture-in-front-end-when-you-uploaded-538o</link>
      <guid>https://dev.to/rezzakali/how-to-preview-your-uploaded-profile-picture-in-front-end-when-you-uploaded-538o</guid>
      <description>&lt;p&gt;In this article I will show you how to preview your picture in react/JavaScript when you uploaded..........&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create a new project using react (npx create-react-app your-app-name).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;create a form component with file input element tag as follows&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { useRef, useState } from 'react';
import './App.css';
import PreviewProfile from './PreviewProfile';

function App() {
  const [value, setValue] = useState(null);
  const fileRef = useRef(null);

  return (
    &amp;lt;form&amp;gt;
      &amp;lt;input
        hidden
        type="file"
        ref={fileRef}
        onChange={(e) =&amp;gt; setValue(e.target.files[0])}
      /&amp;gt;
      {value &amp;amp;&amp;amp; &amp;lt;PreviewProfile file={value} /&amp;gt;}

      &amp;lt;button
        type="button"
        onClick={() =&amp;gt; {
          fileRef.current.click();
        }}
      &amp;gt;
        Upload Profile
      &amp;lt;/button&amp;gt;
    &amp;lt;/form&amp;gt;
  );
}

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Let's create another component with PreviewProfile.jsx (as your desire) and write the following code:
&lt;/li&gt;
&lt;/ol&gt;

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

function PreviewProfile({ file }) {
  const [preview, setPreview] = useState(null);

  const reader = new FileReader();

  reader.readAsDataURL(file);
  reader.onload = () =&amp;gt; {
    setPreview(reader.result);
  };

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;img
        src={preview}
        alt="preview"
        style={{ width: '50px', height: '50px', borderRadius: '50%' }}
      /&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

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

&lt;/div&gt;



&lt;p&gt;and run your application and upload an image and that's all.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to prevent user to go login or register route if he already logged in</title>
      <dc:creator>Rezzak</dc:creator>
      <pubDate>Mon, 10 Oct 2022 17:27:45 +0000</pubDate>
      <link>https://dev.to/rezzakali/how-to-prevent-user-to-go-login-or-register-route-if-he-already-logged-in-53e8</link>
      <guid>https://dev.to/rezzakali/how-to-prevent-user-to-go-login-or-register-route-if-he-already-logged-in-53e8</guid>
      <description>&lt;p&gt;Hi there!&lt;br&gt;
I'm a beginner in MERN Stack Dev. I want to learn how to prevent user to go login/register route in mern using api response , not using any template (ejs or pug). I hope I get the response from my senior developers. &lt;br&gt;
thanks&lt;/p&gt;

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