Why to use Git/Advantages of using Git

Git is a version control system for tracking changes in computer files and coordinating work on those files among multiple people. Git can be used to maintain histories of your work, collaborate with other team members, go to any historical state of your work and lot more. In this article, we will try to figure out following:   1. What are the advantages of using git. 2. Why Git is so famous around the community. 3. What all people get benefit when git used as development VCS.   Let’s first try to find out what are the advantages of Git …

Continue Reading

Story of revamping my Portfolio website

Sometime back i had thought of revamping my portfolio website, This thought came into mind, when i was thinking of work on my online identity. Now i have about 6 yrs of working experience, blogging experience here and at medium and some of my own projects to show in my portfolio. I wanted to have something clean, not too much funky stuff this time, so i contact designer Omar Faizan to help me building my new portfolio website.  In about 3 weeks time, he came up with design  that we discussed  and improved in between. This was first iteration design …

Continue Reading

How do I delete a Git branch both locally and remotely

When you are working with version control system with workflow that require new branch for each new feature, you will often have to clean non required branch mess quite in a while. When we talk about, how to delete a Git branch. Delete branch locally: You can remove local branch using following command:

The -d option is an alias for –delete, which only deletes the branch if it has already been fully merged in its upstream branch. You could also use -D, which is an alias for –delete –force, which deletes the branch “irrespective of its merged status.” Delete Remote Branch: You can also delete …

Continue Reading

Lot of questions??????

Lot of questions?????? Life is not a fair game. Life is a suffering but we are trying to create happiness out of it. Some of us are successful up-to some point but still compromising at some defined lines.   I think we all know everything we should be doing, even before this world start telling us. But we are not doing that, instead we are making excuses day by day. Why we are not doing things we are supposed to do? Is it that we are actually unable to do those things? Is it that we actually setup expectation very …

Continue Reading

Two day journey of building lokarpan.com

Two weeks back, i got a call from stranger that he wants me to work on his project. I was supposed to have time in coming days, so i agreed to work on the project. Next day, i started working on project. Client provide me design and content for the website. Some interns had already toughed some part of project but those parts was so poorly written, i decided to rewrite most of it. You can check out the final website here. This is how landing page looks like for various devices. Desktop View: Layout for landing page was simple …

Continue Reading

Writing and singing 2 lines

Today after coming back from office, I sat down down for having dinner. but my heart was to rhyme something. I took a notebook and write 2 lines that was playing in my mind constantly. After writing, i tried to record it. I know, i am bad at singing but i love to do what my heart says. So rhyme these 2 lines. By the way, these lines are in Punjabi language. So hardly anyone will be able to understand it….ha ha!! This is it for now. I am thinking of extending it to some lines. But will do that …

Continue Reading

How to write custom logging function in JavaScript

In this article we will be discussing, how to write custom logging function in JavaScript. Javascript provide various logging function by default like:

Why Custom Logging: But there are various instances when you would like to have custom logging function. Some of these instances might be like : Logging messages based on components basis(Each logging message have component name prefixed). Enable/disable logging with a flag, e.g., isDebug = true i.e You might want to have logs while development while no logs for production environment. Short logging syntax i.e logs(“Hello world”);   Above are just some common example in case …

Continue Reading

How to add comments in JSX

In this article i will be discussing what is JSX, JSX in React and how to add comments in JSX template. What is JSX: JSX is an XML/HTML-like syntax used by React that extends ECMAScript so that XML/HTML-like text can co-exist with JavaScript/React code. The syntax is intended to be used by preprocessors (i.e., transpilers like Babel) to transform HTML-like text found in JavaScript files into standard JavaScript objects that a JavaScript engine will parse. Basically, by using JSX you can write concise HTML/XML-like structures (e.g., DOM like tree structures) in the same file as you write JavaScript code, then …

Continue Reading

How to add class in react conditionally

During initial day of react coding, all of us must stuck with the question how to add class in react conditionally. One often requires to add class in react DOM element based on some condition. Adding cladd using conditional operator is an very easy way to add class in react conditionally like this.

  In above code, hide class will be added when this.state.showLoading value will be set to false.  

Continue Reading

How to calculate the executing time of Javascript code

Are you looking out for the way using which you can get the executing time of Javascript code? Around the javaScript community i have seen people using various methods to achieve the same. Today i will discus various of them and also discuss which one is the better one and why.   Use Cases: There are a few situations where you’d use this high resolution timer instead of grabbing a basic timestamp: Benchmarking game or animation runloop code Calculating frame rate with precision Cueing actions or audio to occur at specific points in an animation or other time-based sequence Let’s …

Continue Reading