How to set environment variables that can be referenced by Apache, shells and cron jobs

In some cases, environment variables are used to store configuration information. If the values are referenced from different sources, such as through a web server and on the command line, it is a good idea to define them in a single place and graceful… more »

CSS list filter and view

The goal of this fiddle was to provide a CSS and JavaScript method to switch between a list and card or grid view. It uses jQuery and a very simple filter that fires on keyup. The code is commented here, you can see it run at… more »

Create a PHP class from a database table

Simple script to get the columns from a database table and write out a PHP class. PHP<?php$table = preg_replace('/\W/','',$argv[1]);if (empty($table)) die ('Invalid table'.PHP_EOL); try {   &#16… more »

Open Source Software and House Paint

If you think about it, free or inexpensive open source software is like house paint. The product is readily available and doesn't cost a lot, but can be very valuable. A good open source software system such as a content management system, ecommerce sy… more »

PHP - Sorting Objects - Performance Considerations

PHP has some great functions for sorting arrays, however, they should be used with care. If you have an array of complex objects and plan to sort only on one value, you may see significant performance gains if you flatten the array into a single dimens… more »