Snippets

Quick bits and pieces that could save you a lifetime!

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…

Using Fragments in React

January 18, 2019

When rendering multiple adjacent elements in React, you usually get an error saying "Adjacent JSX elements must be wrapped in an enclosing tag" . Basically in React, adjacent elements need to always…

Backdate Commits in Git

January 18, 2019

Sometimes you need to backdate commits for numerous reasons such as keeping your records straight or if the date on your device is wrong. There are multiple ways to backdate commits in Github, here…

How to run code on the Main Thread with Delay in Swift

January 18, 2019

There are a lot of bugs that could be caused because code in not running on the main thread. Typically this could happen when you are making a network call and then try to up the UI and see that it…

Handling Optionals with 'if let' in Swift

January 18, 2019

Typically when you have an value of let's say type , in order to get the actual value you need to use you must unwrap them. We can achieve this by using or . Let's see this in action: Now what…

Search by