Add Amazon Affiliate Code to Links

If you’re a blogger and not using Amazon affiliate links, you are missing out on a great extra source of income. Unlike ads, they do not affect your readers and allow them to find the items you are reviewing/recommending.

When writing a post, there is always a chance you could forget to add your affiliate code to the end of the URL. Below is a javascript snippet that can be added to most websites and will automatically add your affiliate code to any Amazon URL. Make sure you include jquery on your site and change the affilateTag variable. Read More

Register Global Vue Components using Webpack

If you have ever worked on a VueJs application, you probably have noticed there are several ways to register Vue components. You have the ability to manually register each component globally or locally. This will work but is very repetitive and not necessary.

Global

Vue.component('my-component-name', { /* ... */ })

Local

components: {
   'component-a': ComponentA,
   'component-b': ComponentB
}

Read More

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.