Snippets

Quick bits and pieces that could save you a lifetime!

Excluding node_modules in TSLint

March 18, 2019

Personally I think TSLint shouldn't look at anything inside of node_modules by default, however this is not the case out-of-the-box. For some libraries this can cause an issue, for instance when using…

Update OR Create function for Sequelize

March 18, 2019

A lot of times when creating records in a database, we'd like to know whether the record already existed, or at least partially did, and now we can add some more attributes to it. This is when a…

Pain-Free PostgreSQL Setup in Docker

February 22, 2019

Docker is cool! When using official Docker images, you can instantly have services up and running. A service that I use very often is PostgreSQL. It is a very powerful flavour of SQL, and thanks to…

Securely store credentials safely in iOS

February 20, 2019

If you're building an app chances are it requires some sort of authentication. Typically you would perform network calls an pass in a token that you've stored after login and it persists through the…

Get the number of rows in a table in SQL

February 20, 2019

Regardless of the flavour, SQL databases come with many useful aggregate functions that can come in handy and save many lines of code in your queries. One of these functions is the function. Here's…

Solving in the Lonely Integer Problem in Swift

February 19, 2019

Suppose you have an array of elements (integers), each element in the array occurs twice in the array except for one. How would you find that one element? Constraints: Complexity Space (Means no…

Detecting NSFW images with CoreML

February 18, 2019

You're making an app that allows people to upload images, perhaps even setting a profile photo, and you don't want to continually moderate inappropriate images. Luckly, with XCode 10 and iOS 12 you…

Search by