isDivisible function for PHP

A quick function to check if a number is divisible by another.

PHP:
  1. function isDivisible($number, $divisibleBy)
  2.     {
  3.     if ($number % $divisibleBy == 0)
  4.         return true;
  5.     return false;
  6.     }

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.

YouTube looks to offering full length TV shows

YouTube will start offering full length TV shows with ads as Google is trying to get more revenue out of the video sharing site.

Full story at NYTimes.com

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.

PHP:
  1. function getMeta($key)
  2. {
  3. global $post;
  4. return get_post_meta($post->ID, $key);
  5. }

Say you’ve got a custom field name thisIsMyCustomField, you’d just do this to display the value.

PHP:
  1. echo getMeta(‘thisIsMyCustomField’);

JavaScript progress bar indicator

Need a way to show the progress on a long process on your web page? Here’s a quick little JavaScript routine that will do it for you.

Read the rest of this entry »