Programming

Date format

Format a date in ruby using the string from time method (strftime).

Format options:
%a - The abbreviated weekday name (“Sun”)
%A - The full weekday name (“Sunday”)
%b - The abbreviated month name (“Jan”)
%B - The full month name (“January”)
%c - The [...]


Ruby on Rails for RHEL 5

Here is the quick and dirty Ruby on Rails setup for Redhat Enterprise Linux v5 with MySQL.
Using yum install ruby and mysql. The command below does not list all the required packages, but due to dependencies, the additional packages will be installed (or should be - this is all from memory).


Reduce database connections using :include

When displaying a list that requires information from several tables in the database, you can sometimes end up with three or more database queries per list row. Depending on the situation, this may not be a problem. However, it is possible to join the tables in one large SQL query using the :include [...]


Install phpMyAdmin

phpMyAdmin is web-based PHP application for managing MySQL databases. It is fairly easy to install and configure.
Download the latest stable version from the phpMyAdmin web site, and extract it to a location of your choice. I prefer to keep the installation outside of the web root and use an apache alias to reference [...]