Snippets

Quick bits and pieces that could save you a lifetime!

Special literals to get current line number in Swift

January 31, 2019

One interesting feature that Swift has are the idea of special literals. The literals are unique in the way that they are able to obtain information about the code themselves. Let's take a look at…

What is "use strict" in Javascript?

January 31, 2019

Use strict is a feature introduced in ES5, where adding the string "use strict" to a context in your JS code will opt it into a stricter variant of Javascript, where certain unsafe actions are not…

How to check if an element in hidden in Javascript

January 30, 2019

This question is commonly asked around the web. In many cases with complex UIs you'd like to know if an element is currently hidden or visible, that's if you don't already keep track of this in a…

How to programmatically determine the current iPhone device

January 30, 2019

In many instances as an iOS developer you may want to know which device is currently running the application. In my experience, I would use this very often since I code without storyboards and layout…

How to add tap function to UIButton

January 29, 2019

One of the most annoyances in iOS development is to programmatically handle a tap action for a . In Android all views have an which removes the need to use and and creating a separate function…

10 useful Lodash array functions

January 29, 2019

When working with a lot of data, in many cases you're looking to perform complex operations on arrays of records. This is where Lodash comes in! "A modern JavaScript utility library delivering…

General Purpose .gitignore for iOS Projects

January 28, 2019

When starting a new project with no , you'll find yourself committing files that you don't want to commit (ie build folders). It is common that people will reuse git ignore files from projects. Here…

Search by