[Dev Notes] setup git credentials globally and quick

steamy gate

This happens from time to time when you are setting up a new machine or getting a new machine or a machine has just gone broke. Now you have to login with your credentials every time…no thank you!

So seeing that I have had to dig around a few times I decided to take my own notes to know where to go

How to check your current git credentials or if you have one

git config --list

Now you’ll either see a load of details or not too much happening in the console(if not much action be sure to install git to your machine first). However look for the user.name and user.email values. they should contain your git username and git email address.

How to set git credentials globally

$ git config --global user.name John_Doe
$ git config --global user.email johndoe@example.com

After adding your details you can check it out by following the first step to check if all has been set correctly.

There are more details for adding git credentials locally there may be an instance where you require another account to access another repo.

for more details here is my source

JavaScript What is hoisting?

adorable niece

Very important concept to understand, I’ll need to start with some context.

Context of Hoisting

We need to understand the life cycle of code and there are two main phases code goes through. The Creation Phase and the Execution Phase.

When does hoisting happen?

During the Creation Phase, the program will set all the global variables and if there are var variables declared they will be initialized with the value of ‘undefined’, upon the programs Execution Phase this will assign the value officially to the variable if the var is above the invoked function.

MDN definition:

The var statement declares a function-scoped or globally-scoped variable, optionally initializing it to a value.

My understanding of hoisting is:

The process of a variable(var, let, const) declaration a default value of undefined during the creation phase. Functions on the other hand upon starting up of the program are stored in memory source

Been through a few tuts and this guy explains it well enough for me to understand

The above tutorial also goes through other important concepts of JavaScript functions and their behavior when invoked.