Snippets

Quick bits and pieces that could save you a lifetime!

How to rename a local Git branch

January 22, 2019

People change their minds about branch names all the time. Thankfully git allows quick and easy renaming of branches. Here are a few ways to rename a local Git branch. If currently on the branch: If…

How to display an Alert Popup in iOS Swift

January 21, 2019

Often times in an iOS application you will need to prompt the user with an alert to either display something or have the user perform an action (ie Confirm action). has a built in alert called and…

How to redirect to another page in Javascript

January 21, 2019

This question often comes up, and people are usually wondering whether jQuery is needed for redirecting to a different page. The answer is no. Compatible with most browsers including IE9 & higher…

Raw Values vs Associated Values in Swift

January 20, 2019

Raw values are used to associate constant (literal) values to enum cases. The value type is part of the enum type, and each enum case must specify a unique raw value (duplicate values are not allowed…

How to delete a Git branch both locally and remotely?

January 20, 2019

This is a question that often comes up in a team environment when using Git. I'm trying to remove a branch both locally and remotely on my fork... How do I delete this branch both locally and on…

Removing Array Duplicates in ES6

January 19, 2019

There are many ways to remove duplicates from an array in Javascript, but ES6 specifically offers some interesting and functional methods for doing so.

WTH is Strong, Weak, Unowned in Swift?

January 19, 2019

A reference is whenever we declare a variable without specifying its reference type, it will always be strong. A reference being strong means that the ARC will increment the reference count for the…