How to convert a timestamp into a readable date in PHP

A UNIX timestamp is something like a 10 digit (or less) integer number which represents the elapsed seconds since the 1st of January 1970 (also known as the Unix Epoch). It’s a very accurate representation of time, but not necessarily something us humans easily understand. A Unix Timestamp looks something like 1367805780. We can use … Read more

How to auto indent and collapse source code in Dreamweaver

I keep forgetting where and how to find this feature. Turns out the Command menu gives us such features: Commands – Apply Source Formatting (to Selection) Applies the correct indentations to the entire file, or your selection only. It’s the equivalent of Xcode’s “Editor – Structure – Re-Indent”. To manually move blocks of code, select … Read more

How to react to multiple UIAlertViews

If your class creates more than one UIAlertView, then you need a way to react to each of those accordingly. Problem is, you may only have one delegate that listens to all alerts at any given time. You could of course create a separate class for each alert view, but that’s a bit overkill. Instead, […]

How to add a WordPress user directly to the database

wordpress-iconSometimes you may want to add a new user to your WordPress site without accessing the admin interface. Here’s how we do that.

We need the following ingredients:

  • MySQL access details (host, username, password, database name – you can extract this from wp-config.php)
  • phpMyAdmin (or equivalent database management tool, such as Sequel Pro)

Let’s get started!

Read more

How to mount an EBS Volume in Linux

Once you’ve created an EBS Volume in the AWS web interface and attached it to an EC2 instance, how do you actually use it on your virtual server? Here’s how! The following commands assume you’re logged into your system as root. I’ve created a 13GB volume and attached it to my running instance. Before we … Read more