Version and build numbers for Cordova and Phonegap mobile apps

I like to use the following simple versioning method for mobile apps:

Persist data on a mobile device even if the app is uninstalled - using Ionic and Cordova

There are many options to store data in cordova apps such as local storage, sqlite or the file system. However when the user uninstalls the app, this data is removed as well (besides the file systems plugin on Android, more details below). I was looking for a way to store data that would persist even if the app is uninstalled and then re-installed again. Preferably with the same API that I could use on both platforms.

Icon resizing for Cordova

Both the iOS and Android platforms require multiple versions of icon sizes to be provided. If you need to change the icon at some point you have to regenerate all the icons again. This can be automated using ImageMagick which can resize and create images with the command line.

Setting up remote logging to papertrail using chef

One of the options to send logs to papertrail on a unix system is to use the syslog. When using chef for provisioning, the following ruby code will modify the syslog configuration file but only if it was not already modified before:

Randomizing bot execution with randomizer

If you’re building a bot and would like a quick way to add some randomness to make it look less like a bot, check out the Randomizer library. Randomizer let’s you randomly decide when to execute a command based on a given probability.