<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Muhammad Khurram Raza on Medium]]></title>
        <description><![CDATA[Stories by Muhammad Khurram Raza on Medium]]></description>
        <link>https://medium.com/@mkhurramraza?source=rss-2fda6ded7b64------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_ARCFaUQclr8tG_PkYhuLw.jpeg</url>
            <title>Stories by Muhammad Khurram Raza on Medium</title>
            <link>https://medium.com/@mkhurramraza?source=rss-2fda6ded7b64------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 22:48:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mkhurramraza/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Git will be Git]]></title>
            <link>https://mkhurramraza.medium.com/git-will-be-git-196c6aac1cf8?source=rss-2fda6ded7b64------2</link>
            <guid isPermaLink="false">https://medium.com/p/196c6aac1cf8</guid>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[programmer]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Muhammad Khurram Raza]]></dc:creator>
            <pubDate>Sun, 19 Dec 2021 23:26:48 GMT</pubDate>
            <atom:updated>2021-12-23T20:35:51.029Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is about understanding git , git-hub and publishing your first git repository on github platform. Lets hear a story. There are few friends who want to develop a web application which will be used later on but they want it to be developed together and in a manner that it will keep the track of each changes, new features being added, who added or updated those changes. So that later on if a bug arise in any line of code or feature failed. They will be aware of the history so that they may observe the current or previous state of their project. They were bored of traditional copy pasting or sharing of code via email or USB. They needed a system which can bring ease to their life. The system which will promote faster development and better code management.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*R6w2vjh0ve0sb7aM40-n_g.jpeg" /><figcaption>lets git in</figcaption></figure><h3>What is the Solution ?</h3><h3>Git:</h3><p>Git came as a solution to them. Git is a <strong>distributed version control system</strong>. Git keeps the history of changes being added, remove or updated in you code base. It is a powerful tool which promotes rapid software development, collaboration and history maintenance.</p><blockquote><strong>DVCS:</strong></blockquote><blockquote>A distributed version control system ( DVCS ) is a type of version control where the complete codebase — including its full version history — is mirrored on every developer’s computer. It’s abbreviated DVCS.</blockquote><p>After reading the definition we came to know that it will help us in solving a problem. Lets dig in more. I assume that you already have installed <a href="https://git-scm.com/"><strong><em>git</em></strong></a> and <a href="https://code.visualstudio.com/download"><strong><em>vscode (Visual Studio Code)</em></strong></a> on you local machine. If not that you can click on items to download and install them as the tool-tip will represent links. Lets dig in more.</p><h3>First Git Project :</h3><blockquote>Open a Terminal or Git-bash .<br>Verify the installed git version by running the following command in terminal.</blockquote><pre>git --version</pre><blockquote>Create a new folder using mkdir command and named it as FirstProject. <br>Use cd ( change directory ) command to move in.</blockquote><pre>mkdir FirstProject<br>cd FirstProject</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*hTiMIM9AkCOgJpnC5ulfIQ.png" /></figure><h4><strong>Git status :</strong></h4><blockquote>Git status commands gives you the current folder’s status. Either new files are added or modified. It also helps us in identifying tracked file .</blockquote><pre>git status</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*gz0JKR5xqErzzXT1IKIhTA.png" /></figure><p>Oops! it means your current folder is not associated as git repository.</p><p><strong>Git init:</strong></p><blockquote>Initiate your git repository by running the git init command .<br>This command will generate the .git folder which contains all the data structure to store the tracking of your project .</blockquote><pre>git init</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*qezlHTTkRIKYzF3wvJ4gaw.png" /></figure><p>As you can see it initializes a git repository by creating “.git” folder in it. Now your folder has become local repository and it is ready to maintain history. Local repository means the code-base is only available on your machine for now.</p><blockquote>Type ls command and see folder structure .</blockquote><pre>ls -a</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*mLQ6Wj0Q99KOSJJrKEmOUg.png" /></figure><blockquote>Now create a file named as index.html using the touch command.</blockquote><pre>touch index.html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*hKLxac7oTCug0k4Nie8fhA.png" /></figure><p>As you can see index.html file hasalready been created. Now retype git status command and observe the status of your current directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*8Eb7_44dZo2FNdHPVHKbUA.png" /><figcaption>git status right after creating html file</figcaption></figure><p>A few things can be observe now.<br>* The branch on which we are working( master ). We will change master to main branch later on.<br>* No commits yet mean nothing is being tracked. <br>* The index.html file in red color indicates it is <strong>untracked</strong> now and git does not maintain history unless it gets tracked and commit.</p><p>* The index.html file in red color indicates it is <strong>untracked</strong> now and git does not maintain history unless it gets tracked and commit.</p><h4>Now open your current directory in vscode using code. Command or manually by running VScode by double clicking on icon.</h4><pre>code .</pre><blockquote>this command will open your current directory in vscode editor. Here “.” proceeding code is used for current directory. A pop up will open as ask you for the permission. Proceed with “yes” for now. And write some dummy html code in your index.html file</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*X8wlHnpJQj_hhpi7tse5oQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*OXg7EuCVfPZW0Of6lHwlbQ.png" /></figure><p>As you have added some code in index.html and press Ctrl+S in order to save the code. Now all you need is to make your changes trackable and track them by running following commands .</p><h4>Git add:</h4><p>The git add command adds <strong>a change in the working directory to the staging area</strong>. It tells Git that you want to include updates to a particular file in the next commit.</p><pre>git add &lt;file_path_along_name&gt; </pre><p>or</p><pre>git add .</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*4ZjnIKPnmoCkxVO7VAM3EA.png" /></figure><p>Git commit :As you can see index.html is in green color . It indicated the file is in a stage mode and it is ready to commit .</p><h4>Git commit :</h4><blockquote>The git commit command <strong>captures a snapshot of the project’s currently staged changes</strong>. Committed snapshots can be thought of as “safe” versions of a project — Git will never change them unless you explicitly ask it to.</blockquote><blockquote>A shortcut command that immediately creates a commit with a passed commit message. By default, git commit will open up the locally configured text editor, and prompt for a commit message to be entered. Passing the -m option will forgo the text editor prompt in-favor of an inline message.Type the following command in terminal .</blockquote><pre>git commit -m &quot;text-message-that-define-purpose&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*eDBuXFxqRMZW5dHB5wLAyg.png" /></figure><p>“Here I have used an analogy, for example you have some data files and you have made some changes in them. And then add them to staging area. Staging is like a box. You can add multiple files in this box. Once you are done adding you commit it. Commit is like putting a label on your box with a text message and putting it in a safe zone. Rocket is the safest place to keep this box.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YpQo48tmNYB78pdPd70T3w.jpeg" /></figure><p>Now you are set. You are done with development. Now you want your repository to be available for other to contribute. It means you need a platform where you local repository will be host. Here we need a platform which will store our repository as in open source or private mode. Ever heard of Github?</p><h4>Github:</h4><blockquote>Git-hub is git-based repository hosting platform .</blockquote><p>A platform where your code base will reside and you can either pull or push the code over there .I assume you already have created an account. Just browser to <a href="http://www.github.com/">www.github.com</a> . Sign in and create a repository named as FirstProject. Keep it public for now .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/1*pleL1NYzu23Uz2R6Ygtm8A.png" /></figure><p>Click on the New button to create it and it will route you to different page .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*8zGAWpd_NyXqvqAVruuexA.png" /></figure><p>Add details and press create repository button.It will route you to different page .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cAXouf9DaVtseDOIh4fCyQ.png" /></figure><p>Now you are all set . You have created your repo on github .It is available on remote but your local repository is not synced with remote one . All you need is to push your code . Before it we need to change the our branch name as master is not being used much .So we should rename it from master to main .We will use following command .</p><pre>git branch -m &lt;old_branch_name&gt; &lt;new_branch_name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*0F0d6CVXSubkR0tt_Ev6PA.png" /></figure><p>Once you are done with renaming. Now you need to add origin repository url .So that you can push your local repository code . You can add origin repo url using remote command .</p><pre>git remote add origin &lt;git-repo-url&gt;</pre><p>Once you are done with this step all you need is to push your local code to origin/host .</p><h4>Git Push :</h4><blockquote>The git push command is <strong>used to upload local repository content to a remote repository</strong>.</blockquote><p>Use the following command to push your current “main” branch to origin .</p><pre>git push -u origin main</pre><p>Add user name and password for you github profile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*XTUGkztHIbfQ3zLeqILhPw.png" /></figure><p>Now witness magic on your github repository. How your local code is pushed to git-hub .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OOW78-KRrzWG7YTKh7Yi1Q.png" /></figure><p>Hurray!! You can see your project content . This repository is now available for others to collaborate . This article was about to get you familiar with git and github. In next article we will learn about merge, branching , pull, clone , stash , git trunk based model and much more . Stay tuned !!</p><p><a href="https://www.atlassian.com/git/tutorials/what-is-version-control"><em>Referance Link</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=196c6aac1cf8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hello World Application in Node.js]]></title>
            <link>https://mkhurramraza.medium.com/hello-world-application-in-node-js-67c20ad5249d?source=rss-2fda6ded7b64------2</link>
            <guid isPermaLink="false">https://medium.com/p/67c20ad5249d</guid>
            <category><![CDATA[scripting]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[servers]]></category>
            <dc:creator><![CDATA[Muhammad Khurram Raza]]></dc:creator>
            <pubDate>Sun, 06 Jun 2021 07:08:05 GMT</pubDate>
            <atom:updated>2021-06-06T12:00:18.916Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi everyone welcome to my first blog. As everyone is quiet excited in learning the modern javascript framework and libraries. Lets get started with the simple application in node.js.</p><p><strong>Introduction :</strong></p><p>Nodejs is a javascript library .Moreover, we can say it is a javascript environment .Environment where every javascript code can be executed. Initially javascript was only available in browser. As javascript is a scripting language. After further development developer introduces Nodejs which can not only run in browser but also run as a standalone application on a machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*X6475XesgqGDDET4etCphA.jpeg" /></figure><p>Every javascript and nodejs code runs on the V8 javascript runtime engine .V8 engine compiles the javascript code into machine code (low level code) which is easily machine understandable.</p><p>Hence, javascript is not limited to only browser now . You can do much more with javascript now.Creating interactive web applications to mobile applications. Javascript is doing almost every thing now what other scripting languages are doing like python . <br>As i have given nodejs as an analogy to doctor Octavius. I will explain it later why?</p><p><strong>Installation :</strong></p><p>To get started with our first nodejs application .We need to install node on our machine .I am using a Ubuntu 20 ,so installation is pretty easy here too .Following snippets helps you in installation of nodejs .</p><pre>sudo apt install nodejs</pre><p>This command will let install the latest version of node js on your linux machine.I have already installed it so it has just given a pretty reminder.If you are a windows user , you can download and install nodejs setup from their official website <a href="https://nodejs.org/en/download/">Install nodejs on windows</a>. Once it has been installed check the versions of nodejs and npm ( node package module ) on your machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*33tvxz8hTZJN6Gk3o1YwfQ.jpeg" /></figure><blockquote><strong>npm</strong> is the world’s largest <strong>Software Registry </strong>which container contains over 800,000 <strong>code packages</strong>.<strong>Open-source</strong> developers use <strong>npm</strong> to <strong>share</strong> software.<br>Open-source developers use npm to share software.Many organizations also use npm to manage private development.organizations also use npm to manage private development.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*Gt55h9cwVepfGO276KXcYQ.jpeg" /></figure><p>Once you are done with installation , install any of the code editor sublime,atom or vscode on your machine . I will recommend visual studio code.I have already installed it on my machine.</p><p><strong>Application :</strong></p><blockquote>lets create a new folder using <strong>mkdir</strong> command. I name this folder as firstApp.</blockquote><pre>mkdir firstApp</pre><blockquote>Move to the newly created folder using<strong> cd </strong>command followed by folder name .</blockquote><pre>cd firstApp</pre><blockquote>Initiate the node js application with <strong>npm init</strong> <strong>-y </strong>command . It will generate a <strong>package.json </strong>with configuration.</blockquote><pre>npm init -y</pre><blockquote>Lets visualize the content of current folder using <strong>ls</strong> command . It contains only one file .</blockquote><pre>ls</pre><blockquote>Lets open the current folder in visual studio code with <strong>code . </strong>command .</blockquote><pre>code .</pre><blockquote>Once packge.json file is successfully created lets create a server for this application . Create a file App.js using <strong>touch</strong> command .</blockquote><pre>touch App.js</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*hJMTeQ57jBqG-8ihdq9hyA.jpeg" /></figure><p>Once the App.js file is created. Copy the following code in App.js file.</p><pre>const http = require(&quot;http&quot;);</pre><pre>const PORT = 3000; // creating a port</pre><pre>http.createServer(function(request,response){ //creating httpserver</pre><pre>response.writeHead(200,{&quot;Content-type&quot;:&quot;text/html&quot;});<br>// writing content for head along with status code </pre><pre>response.write(&quot;&lt;h1&gt;Hello World&lt;/h1&gt;&quot;);     // writing a html </pre><pre>response.end();</pre><pre>}).listen(PORT,function(){// exposing the server to the defined port</pre><pre>console.log(&quot;Server is being listened on port &quot;, PORT);</pre><pre>});</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*aSHyQey_c12itwz4qqzY_g.jpeg" /></figure><blockquote>here <strong>“http”</strong> is the built in module of Node JS through which we can transfer data over HTTP protocols. here is the list of all the built-in modules of Node JS <a href="https://nodejs.org/dist/latest-v8.x/docs/api/">https://nodejs.org/dist/latest-v8.x/docs/api/</a></blockquote><p>Lets run the node server using the <strong>node &lt;file_name&gt;</strong> command .</p><pre>node App.js</pre><p>After running this command ,you will see an output on the terminal ,<em>Server is being listened on port 3000. </em>All you can do is open the browser and type in the url <a href="http://localhost:3000/">http://localhost:3000</a> and hit Enter key, Hello World will be shown in browser .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*dIYDKB6IxE95mS1BRUx7Vw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*8ZH5OrjpIHspvAAw42fsJQ.jpeg" /></figure><p>Now Press Ctrl+C in terminal to terminate the server . Add add<strong> “start”</strong> command in script of package.json file. Instead of running a server by file name , we will run it with command only this time . Add the following code in “scripts” object in package.json file .</p><pre>&quot;start&quot; : &quot;node App.js&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*msEPUEtZW4F-Sj-oR_aaFQ.jpeg" /></figure><p>Now run the server using <strong>npm run start</strong> command .</p><pre>npm run start</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*W4sPjQGavn7mkoVxfftyBA.jpeg" /></figure><p>Congratulations!! you have successfully created you first node js server. The purpose of this article is to get you familiar with nodejs ,terminal ,scripts .<br>Stay tunned …..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67c20ad5249d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>