lime icon

Phosphorus and Lime

A Developer's Broadsheet

This blog has been deprecated. Please visit my new blog at klenwell.com/press.
FYI: The Apple iPod Font
Myriad

A font-family setting for CSS:

.ipod_font { font-family:myriad,frutiger,helvetica,sans-serif; font-weight:bold; }


Demo:

iPod: the Walkman that controls you
PHP: Database Abstraction (PEAR::DB vs. ADOdb)
Until now, in using MySQL with PHP, I've just adapted the native mysql function to my own uses. For instance, I have a mysql_update_array() function that simplifies updating values in a single row in a table.

But now that I contemplating migrating to PostGreSQL, it occurred to me that now is the time to seriously investigate an abstract DB class -- and find the best open source one out there.

This forum was helpful:

phplens.com

I think it's the site run by the creator of ADODb, but the arguments are convincing. In the event, I think I'll go with ADOdb Lite.
HTML: relative links
Ok, how long have I been doing web design? And until this afternoon, if you would have asked me how to create a relative link to a file two directories up, I would have had to look it up or would have fiddled around with slashes and dots until it worked. The reason: I got started using Dreamweaver.

Anyway, I finally did look it up. The rule?

./ <- current directory. Handy if you want to link to the index page without to use something like 'index.html'

../ <- parent directory


source: webmasterworld.com

The other reason I never mastered this was I started working in PHP and was more concerned on creating relative links from a variable defined root level. In that case -- say where you move a site from a subdirectory on your local server to the root directory of a production server -- these kinds of links are not that handy.
LINUX: Linux File System Subdirectories
Still getting used to Linux. I was wondering what the different standard subdirectories (dev, etc, opt, misc, etc.) are meant for. Found a nice table explaining them on tldp.org.

keywords: linux, directory, subdirectory, file system
PHP: pick random element from array
For some reason, this isn't second nature for me yet:

$_index = array_rand($ARRAY);

$random_element = $ARRAY[$_index];


I think this can also be done in one step like this:

$random_element = $ARRAY[array_rand($ARRAY)];


Both only work for picking one element from array.

keywords: PHP, array_rand, array, random