Generate PDFs with HTML templates in Rails

Generating PDF for your webapplication is not that difficult as you think.

»
Author's profile picture David Chua

Setting up your First Ruby Environment

Setting your ruby environment can be quite difficult.

»
Author's profile picture David Chua

Remove title bar in your Android App

To remove the title bar in your android app, add the following in your Activity's onCreate() method.

»
Author's profile picture David Chua

Run a webrick server to serve static html content in a folder

Need a quick way to serve html files?

»
Author's profile picture David Chua

Selectively routing connections through VPN on OSX

When connecting your OSX machine to your VPN and you only want to access the resources on the private network and not tunnel your entire connection through, in OSX, add the following:

»
Author's profile picture David Chua

Figure out which DNS server you are using

If you need to find out what DNS you are currently using (for troubleshooting purposes, this snippet might help):

»
Author's profile picture David Chua

Link your custom app to your Gnome Applications

If you're running GNOME and you have a custom script/app that you want to be able to run quickly from your applications bar, you can easily add an entry with the following:

»
Author's profile picture David Chua

Authenticating with Pagekite API using Ruby

If you're using pagekite, you probably have read this document.

»
Author's profile picture David Chua

MySQL backup process

How I usually prepare the backup regime of my mysql/mariadb databases of all my newly provisioned servers is to do the following tasks:

»
Author's profile picture David Chua

Custom Timestamp attributes for Activerecord

In ActiveRecord, when working with legacy database and the existing database uses different fields for last_update and created_at, how do you specify the correct column names for ActiveRecord to properly record timestamps?

»
Author's profile picture David Chua

Equivalent of try() for hashes? - Ruby

To do a try() on hashes, its as simple as:

»
Author's profile picture David Chua

Migrating from utf8 to utf8mb4 in MySQL

If you ever get this error message:

»
Author's profile picture David Chua

DRY your ActionMailer::Base.deliveries.clear in RSpec tests

When testing for mailers, you might need to add the following quite frequently:

»
Author's profile picture David Chua

Testing with Rack-test custom headers

When writingg a method that requires a custom request header, ie. "X-Api-Key", use the following:

»
Author's profile picture David Chua

Configuring your BCM207020A0 Bluetooth Dongle with HSP

If you're using an IOGear GBU521 Low Energy Bluetooth 4.0 Dongle like me, and you're trying to get your bluetooth headset w/ microphone to work (mic input), you probably want to check this out.

»
Author's profile picture David Chua