Batch convert wav files to mp3 in OSX using Terminal

Higher values of the -V* parameter will reduce the quality and decrease the file size of the mp3 files. Make sure lame is installed.

Using Two-factor Authentication Secured Google Services on your iPhone

Problem

You sync your Calendar or Contacts on your iPhone with Google’s CalDAV and/or CardDAV. But enabling multi-factor authentication for your Google Account causes the synchronization to fail. Because you know, you cannot enter the second factor somewhere.

Solution

A simple fix to keep using the secure 2-factor authentication but have your data synchronized using password authentication, you can expose certain services using a password by setting up service-specific passwords in the settings of your Google Account.

Initialize UIColor from RGB hex in Swift

Want to initialize a UIColor object from a hex code?

Create a new Swift class named “UIColor+FromRGB.swift” with the following content:

Initializing a UIColor object then is now a matter of a one-liner, e.g.:

 

Unpack part’ed tarballs

Need to unpack a bunch of files such as:

with the following command:

cat bigfile.tar-part000* | tar xzf –

which untars the part file’s contents to the current folder.