<?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: Zeeshan Safdar</title>
    <description>The latest articles on DEV Community by Zeeshan Safdar (@zeeshansafdar48).</description>
    <link>https://dev.to/zeeshansafdar48</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%2F544692%2Fc9dcc752-f1ab-4485-a31f-8c59d607cc27.png</url>
      <title>DEV Community: Zeeshan Safdar</title>
      <link>https://dev.to/zeeshansafdar48</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zeeshansafdar48"/>
    <language>en</language>
    <item>
      <title>What is cross-origin? Why do we write cross-origin in our code?</title>
      <dc:creator>Zeeshan Safdar</dc:creator>
      <pubDate>Sat, 03 Jun 2023 05:42:37 +0000</pubDate>
      <link>https://dev.to/zeeshansafdar48/what-is-cross-origin-why-do-we-write-cross-origin-in-our-code-45fk</link>
      <guid>https://dev.to/zeeshansafdar48/what-is-cross-origin-why-do-we-write-cross-origin-in-our-code-45fk</guid>
      <description>&lt;p&gt;In web development, the term "&lt;strong&gt;cross-origin&lt;/strong&gt;" refers to interactions between web pages or scripts that originate from different domains, protocols, or ports. Browsers enforce a security policy called the "&lt;strong&gt;same-origin policy&lt;/strong&gt;" that restricts these interactions by default. The policy aims to prevent malicious websites from accessing or manipulating data from other websites without explicit permission.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;script crossorigin src="https://unpkg.com/react@18/umd/react.development.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The crossorigin attribute I included in my code snippet is used when loading external resources, such as scripts, stylesheets, or images, from a different origin. It is primarily used for loading resources that support &lt;strong&gt;Cross-Origin Resource Sharing (CORS)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When I set the crossorigin attribute to a value, such as "anonymous" or "use-credentials," I indicate to the browser how it should handle any cross-origin requests made while fetching the resource.&lt;/p&gt;

&lt;p&gt;In my example, By including the crossorigin attribute, I am specifying that the browser should handle any cross-origin requests made by this script according to the CORS policy. This can include making AJAX requests to other domains or loading additional resources like stylesheets or images.&lt;/p&gt;

&lt;p&gt;It's important to note that the use of the crossorigin attribute depends on the specific resource being loaded and whether the server hosting the resource supports CORS headers. If the server does not send the necessary CORS headers, the crossorigin attribute may not have any effect.&lt;/p&gt;

&lt;p&gt;To fully understand the concept of &lt;strong&gt;CORS&lt;/strong&gt;, let's have a look into it in detail.&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/tcLW5d0KAYE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>crossorigin</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>What is CDN? Why do we use CDN?</title>
      <dc:creator>Zeeshan Safdar</dc:creator>
      <pubDate>Wed, 31 May 2023 18:44:48 +0000</pubDate>
      <link>https://dev.to/zeeshansafdar48/what-is-cdn-why-do-we-use-cdn-4f57</link>
      <guid>https://dev.to/zeeshansafdar48/what-is-cdn-why-do-we-use-cdn-4f57</guid>
      <description>&lt;p&gt;Do you know what is CDN? No, Don't worry, let's have a look on CDN. &lt;/p&gt;

&lt;p&gt;CDN stands for &lt;strong&gt;Content Delivery Network&lt;/strong&gt;. Think of a CDN (Content Delivery Network) as a network of servers spread across different locations around the world. These servers work together to deliver web content, like images, videos, and files, to users quickly and efficiently.&lt;/p&gt;

&lt;h2&gt;
  
  
  CDNs are used for several reasons:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Improved Performance:&lt;/strong&gt; By placing servers closer to end-users, CDNs reduce the distance that content needs to travel, resulting in faster loading times and improved overall performance. This is especially beneficial for delivering content to users located far from the origin server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scalability:&lt;/strong&gt; CDNs are designed to handle high traffic volumes and sudden spikes in demand. They distribute the load across multiple servers, preventing any single server from being overwhelmed, and ensuring a smooth user experience during peak times.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reliability and Redundancy:&lt;/strong&gt; CDNs employ redundancy and failover mechanisms to ensure high availability of content. If one server fails, another server in the network can seamlessly take over and continue serving the content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bandwidth Optimization:&lt;/strong&gt; CDNs help optimize bandwidth usage by caching content at various edge server locations. When a user requests content, the CDN serves it from the server closest to the user, reducing the load on the origin server and conserving bandwidth.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Global Reach:&lt;/strong&gt; CDNs have a wide network presence, enabling content to be delivered quickly to users worldwide. This is particularly advantageous for global businesses with a diverse user base.&lt;/p&gt;

&lt;p&gt;Overall, CDNs enhance the speed, reliability, and scalability of content delivery, resulting in an improved user experience, reduced server load, and more efficient use of network resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Still confused?&lt;/strong&gt;, don't worry, checkout this video for better understanding.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Bsq5cKkS33I"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>cdn</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>Understanding Git and Github</title>
      <dc:creator>Zeeshan Safdar</dc:creator>
      <pubDate>Sat, 23 Jul 2022 08:04:08 +0000</pubDate>
      <link>https://dev.to/zeeshansafdar48/understanding-git-and-github-c9b</link>
      <guid>https://dev.to/zeeshansafdar48/understanding-git-and-github-c9b</guid>
      <description>&lt;p&gt;Hi Folks, Are you get started with &lt;strong&gt;Version Control System&lt;/strong&gt;? Or just want to learn about git? Don't worry, today we will learn these in details.&lt;/p&gt;

&lt;h2&gt;
  
  
  What and Why - Git and Github
&lt;/h2&gt;

&lt;p&gt;Git is a version control system. And what is version control system exactly, let's find out. &lt;br&gt;
Imagine you have some project and you want to collaborate with other people. Or Imagine you add a new feature into your project, and now your application breaks, and it is not running as it was running before, and you think, &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ohh, It would be very great, If I could go back in the past, in that codebase in which my application was running. I wish there is some sort of way. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Congratulations!!!&lt;/strong&gt; Your wish came true. &lt;/p&gt;

&lt;p&gt;Thanks to Version Control System that helps us to track and manage changes to our project. It helps us to maintain the history of our project, like at what particular point of time, &lt;strong&gt;which person&lt;/strong&gt; made &lt;strong&gt;which change&lt;/strong&gt;, &lt;strong&gt;where&lt;/strong&gt; in the project. &lt;/p&gt;

&lt;p&gt;So you understand the Version Control System, and what is relationship between Git and Version Control System? Git is a version control system. And there are other version control systems as well, like SVN, TFS etc. But we use Git because it is so popular, and mostly programmers like you and me use Git.&lt;/p&gt;

&lt;p&gt;And what is &lt;strong&gt;Github&lt;/strong&gt;?&lt;br&gt;
Github is a platform, that allows us to host our Git projects/Repositories. &lt;/p&gt;

&lt;p&gt;Think both like an email service. You use email service in you day to day life, right? You send an email via a platform like Gmail, Outlook etc. These are some platforms that give you an interface to use this service, which is send an email. Now relate with it Git and Github, you use Git with some other platforms, like Github, Gitlab, Bitbucket etc. These platforms allow us to host our projects on their website, so that other people from around the world can share, look, contribute our projects. &lt;br&gt;
You get the idea... right!&lt;/p&gt;

&lt;p&gt;And &lt;strong&gt;WHY&lt;/strong&gt; we are using Git and Github as there are so many version control systems (like CVS, SVN, Mercurial, Monotone etc.)  and platforms (like Gitlab, Bitbucket etc.) because these are so popular in the market. Everybody use Git and Github as these are the standards. &lt;br&gt;
You get the idea... right!&lt;/p&gt;

&lt;h2&gt;
  
  
  A Basic Project (Steps)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Make a repository in the Github website&lt;/li&gt;
&lt;li&gt;Make a folder into your PC&lt;/li&gt;
&lt;li&gt;run command &lt;code&gt;git init&lt;/code&gt; into your folder&lt;/li&gt;
&lt;li&gt;rum command &lt;code&gt;git remote add origin insert_https_project_link_here&lt;/code&gt; to connect your Github repository with your current(local) folder&lt;/li&gt;
&lt;li&gt;run command &lt;code&gt;git remote -v&lt;/code&gt; to view your all remote urls&lt;/li&gt;
&lt;li&gt;Add files into your folder, make some changes also&lt;/li&gt;
&lt;li&gt;run command &lt;code&gt;git status&lt;/code&gt; to view the changes&lt;/li&gt;
&lt;li&gt;run command &lt;code&gt;git add file_name&lt;/code&gt; or &lt;code&gt;git add .&lt;/code&gt; (to add everything in the current folder) &lt;/li&gt;
&lt;li&gt;run command &lt;code&gt;git commit -m "your_message_here"&lt;/code&gt; to Committing the files&lt;/li&gt;
&lt;li&gt;run command &lt;code&gt;git push origin master&lt;/code&gt; to push your local changes to remote repository&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Congratulations!!! You create your first Github repo&lt;/p&gt;

&lt;p&gt;Now I will list down some basic concepts that you use daily in your git work&lt;/p&gt;

&lt;h2&gt;
  
  
  Some Keywords and Concepts
&lt;/h2&gt;

&lt;p&gt;You never need to become a master of Git and Github before using it. You just need a basic understanding of it to get started. Mostly, in the industry, we use some concepts repetitively and these are the followings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repository/repo:&lt;/strong&gt; This is your project on the platform or project in which you are working on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Branch:&lt;/strong&gt; A branch is a new/separate version of the main repository. There will be a main or master branch which is the first or default branch in the repository. Let' say I am working on a project, and 7 other developers are also working on the same project. If all the others are working in the same branch, It will be very difficult to maintain all the work. If I am working on a feature called login feature, then I will make a new branch let's say feature/login and will work on this branch without impacting the other code work. Once my work will complete, I will merge my feature/login branch into the main or master branch.&lt;/p&gt;

&lt;p&gt;Never commit on the main or master branch since it's the one&lt;br&gt;
used by the people, to prevent any mishaps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Push:&lt;/strong&gt; Let's say I complete my login work (mentioned above), now I need to push my local code into our repository. For that we use push concept, I will run the command and push my changes to the branch.&lt;br&gt;
&lt;code&gt;git push origin feature/login&lt;/code&gt;&lt;br&gt;
-- feature/login is the branch name&lt;/p&gt;

&lt;p&gt;Note: Before pushing my changes, I need to pull the latest code in my current branch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pull:&lt;/strong&gt; Let's say I was working on my login work, and also one my friend also working on login functionality and his part is to beautify the UI part. He done his changes and push his code into the feature/login branch. Now, If I need his changes, I need to pull his changes from the Git. And the command I will use is &lt;br&gt;
&lt;code&gt;git pull origin feature/login&lt;/code&gt;&lt;br&gt;
-- feature/login is the branch name&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Merge:&lt;/strong&gt; Let's say I completed my work of login functionality, and now I want to merge with it main code base and accessible to others to use my functionality. For this I need to merge my branch with the main branch or master branch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Merge Conflict:&lt;/strong&gt; Let's say, I was working on a file in my feature/login branch, and my other friend was also working on the same file. We both make a change on the same line, when I take pull of his code, then Git will on confuse, wether my code will be on this line or my friend's code. This situation is called conflict. We then resolve this issue, by telling the Git that whose code will be gone to the repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic Git Commands
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;To check if git is installed in your PC&lt;br&gt;
&lt;code&gt;git&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To initialize an empty Git repository in your folder&lt;br&gt;
&lt;code&gt;git init&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To view the changes or the untracked files in the&lt;br&gt;
project that's not been saved yet&lt;br&gt;
&lt;code&gt;git status&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Staging the files&lt;br&gt;
&lt;code&gt;git add file_name&lt;/code&gt; or &lt;code&gt;git add .&lt;/code&gt; (to stage everything in&lt;br&gt;
the current folder)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Committing the files&lt;br&gt;
&lt;code&gt;git commit -m "your_message_here"&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To unstage or remove a file from the staging level&lt;br&gt;
&lt;code&gt;git restore --staged file_name.txt&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To view the entire history of the project&lt;br&gt;
&lt;code&gt;git log&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Removing a commit from the history of a project&lt;br&gt;
&lt;code&gt;git reset&lt;br&gt;
insert_commit_hash_id_to_which_you_want_to_go_back_to_here&lt;/code&gt;&lt;br&gt;
(all the commits or changes before this will go back to&lt;br&gt;
the unstaged area now)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After you stage a few files but then you want to have a&lt;br&gt;
clean codebase or reuse those files later, we can&lt;br&gt;
stash those changes to go back to the commit before&lt;br&gt;
they were staged&lt;br&gt;
&lt;code&gt;git stash&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Bringing back those changes or pop them from the&lt;br&gt;
stash&lt;br&gt;
&lt;code&gt;git stash pop&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To clear the changes or files in your stash&lt;br&gt;
&lt;code&gt;git stash clear&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How Git works
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Connecting your Remote Repository to Local Repository&lt;br&gt;
&lt;code&gt;git remote add origin insert_https_project_link_here&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pushing local changes to remote repository&lt;br&gt;
&lt;code&gt;git push origin master&lt;/code&gt; (we're pushing to the url origin,&lt;br&gt;
and the branch master)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To view all your remote urls&lt;br&gt;
&lt;code&gt;git remote -v&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Move to other branch&lt;br&gt;
&lt;code&gt;git checkout branch_name&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Merging your branch to main of project&lt;br&gt;
&lt;code&gt;git merge branch_name&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are still feel stuck or confuse, don't worry,&lt;br&gt;
Follow the video that will clear your concepts.&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=apGV9Kg7ics&amp;amp;ab_channel=KunalKushwaha" rel="noopener noreferrer"&gt;Complete Git and GitHub Tutorial - Kunal Kushwaha&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Follow this very useful PDF for all the commands that you need.&lt;br&gt;
&lt;a href="https://github.com/kunal-kushwaha/DSA-Bootcamp-Java/blob/main/lectures/01-git/git-cheat-sheet-education.pdf" rel="noopener noreferrer"&gt;Git Cheat Sheet Education&lt;/a&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
