I use Git in both my personal and professional life. Depending on the context, I want to use different contact information. This is how I set this up on my machine.
Computing
Git Change Default Branch to Main
In Git 2.28 you can change the default branch name from ‘master’ to whatever you want (the name ‘main’ seems to be a popular choice). This is the command to run to add this to your configuration.
JavaScript get Date in YYYYMMDD Format
Recently, I was working in JavaScript and I need to transform a date into the format YYYYMMDD, this is how I did it.
Code Standards Naming Styles
There are lots of ways to write variable names when programming. This is the list of ones I find myself using.
How to Add a Non-Breaking Space
A non-breaking space has a unicode value of `U+00A0` (a normal space has a unicode value of `U+0020`). This is how I add this character.
git switch
Git version 2.23.0 is introduced a new command ‘git switch’. This command does a subset of what ‘git checkout’ does (because ‘git checkout’ does so many different things).
git restore
Git version 2.23.0 is introduced a new command ‘git switch’. This command does a subset of what ‘git checkout’ does (because ‘git checkout’ does so many different things).
PHP declare(strict_types=1);
What does declare(strict_types=1); do in PHP? PHP is a weakly typed language, which means that when a value is of the wrong type, PHP tries to cast it to the proper type. For example if you try to add an integer and a string, echo 5 + “3”; PHP will try to cast the string […]
git warning: path is unmerged
Sometimes after running git stash pop, I get a conflict warning and I want to discard any changes to a file. However, when I try to checkout the file I get an error message. Using reset and then checkout, lets me accomplish this goal.
Markdown Avoid Auto Numbering
I spend most of my time doing my writing in markdown. One of the features I have mixed feelings about, is auto-numbering of ordered. There are often times when I need to modify the numbering. I like to do this by adding a backslash (\) before the period after the number, which renders the list as text. If you want to render the list with the ol/li markup, you can write the exact markup you want in your markdown document and it will render without any modifications.