Repeating Keys in macOs

Have you ever noticed that in macOs you cannot hold down a key for it to repeat? If you ever had to repetitively type the same characters over and over this can be frustrating.

Strangely in Windows, this is enabled by default. Luckily similar to how you are able to speed up key presses in macOs, you can enable an option to allow repeating keys. Run the command below in your terminal to enable repeating keys.

defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false

What other commands or options do you find useful in macOs?

Set Git Default Upstream Branch

When creating branches in git, have you noticed that you always have to set the upstream before you can push?

fatal: The current branch test has no upstream branch.
To push the current branch and set the remote as upstream, use

Fortunately, a simple git config setting will make your life easier and save you some keystrokes. Just run the command below.

git config --global push.default current

Now you should ever have to set the upstream manually.

Git Rebase by Default

When working on a project with multiple developers it’s a good idea to always rebase when you pull.

git pull --rebase

But if you would like to rebase by default, you can add it to your global .gitconfig file by running this command:

git config --global pull.rebase true

Hope this saves you some time!

Money in Javascript

When accepting money online, it is important to be accurate. Just one cent off and your customers may lose trust in your application. That is why it is  It is important to understand how Javascript handles decimals.

By default, Javascript does not have a decimal datatype but it does have a Number type, which can be used as an integer or a double precision float. Because it’s a binary representation of a base 10 system, you end up with inaccurate results when you try to do the math. Read More