Google Alerts now available in RSS

Google Alerts is now available through an RSS feed instead of having to come through email. If you’re not already using Google Alerts to keep track of news for your sites, now may be a good time to start.

WordPress: Get custom field function

On several WordPress projects I've needed to get the value of a custom field.  Not too difficult using the get_post_meta command, but I wanted a little quicker way.  So I now add this little function to the functions.php file on themes I'm working on. PLAIN TEXT PHP: function getMeta($key) { global $post; return get_post_meta($post->ID, $key); [...]

Debug function for FireBug

If you do much JavaScript coding and have FireBug odds are good you know that you can call console.info() to output to the FireBug console. But what happens if you leave your console.info() call in your code and a visitor looks with IE? It'll throw an error. So here's a quick, little function that will [...]

isApache() and isIIS() functions for PHP

A couple quick little functions for when you need to know if you're running on Apache or IIS. PLAIN TEXT PHP: function isApache()     {     return ((bool) preg_match('/Apache/i', $_SERVER['SERVER_SOFTWARE']));     } function isIIS()     {     return ((bool) preg_match('/IIS/i', $_SERVER['SERVER_SOFTWARE']));     } isApache() will return true if it's [...]

Trimming array elements in PHP

Several times I've had a user setting that was separated by commas that I needed to split out into an array. People, correctly, put a space after commas. But for the array the space shouldn't be there. Here's a quick tip to strip out those leading spaces. PLAIN TEXT PHP: $array = array_map('trim', $array); array_map [...]