Paul Ferrett had dinner with Brad Jeffries.
Brad Jeffries worked with Michael J. Fox on Back to the Future.
Michael J. Fox and Kevin Bacon appeared in The Magic 7.
Posters of Melbourne
When it comes to loving your city, I’m about as proud of Melbourne as you can get! So of course I would want to decorate the walls of my city apartment with this awesome Typographic Poster of Melbourne!
It’s a part of a series of City Posters from a good friend of mine and has other great prints from around the world including England and London, and they really are a great show piece. We get loads of comments on ours and make a great gift.
Do yourself a favour and buy yours today (or tomorrow, I guess)!
Month Dropdown in PHP
A simple way to generate an HTML select menu using PHP that lists the previous 12 months (or coming months).
You can easily change the output of the labels and option values by adjusting the output format from the calls to date().
<select name="month"> <?php for ($i = 0; $i <= 12; ++$i) { $time = strtotime(sprintf('-%d months', $i)); $value = date('Y-m', $time); $label = date('F Y', $time); printf('<option value="%s">%s</option>', $value, $label); } ?> </select> |
Fast domain name searching
Just a quick post to say that Instant Domain Search is a great website for finding domain names really fast! A great free service. http://instantdomainsearch.com/
Google+capturing + (plus key) with keymaster.js
We use keymaster.js to power the keyboard shortcuts on a new product under development at work. It’s a great little javascript library for detecting key-presses from users.
For this product we wanted to capture the “+” key for when users wanted to Add something to their console. The confusion for me came from the fact the the “+” is used in the key() method for joining sequences of keys to get multi-key dispatching (e.g. pressing Control and Return at the same time).
It’s a pretty simple solution, but I couldn’t find it anywhere so thought I’d post here just in case someone else wants to do the same thing. As it turns out, “=” and “+” share the same key code in javascript, so the following will allow capturing of the plus key from both the numeric keypad as well as on the standard keyboard.
<script type="text/javascript" src="keymaster.min.js"></script> <script type="text/javascript"> (function() { var myFunc = function() { console.log("User hit the + key"); }; key('=,shift+=', myFunc); }()); </script> |
An unfortunate by-product of the above, however, is that the same function will fire if the user hits just the “=” key. A pretty trivial trade-off IMHO. If anyone can think of a way to differentiate between the two let me know!
Google+Use PHP sprintf to pad leading zeros
A simple way to use sprintf in PHP to pad a number with leading zeros.
<?php // Pad the number 2 with zeros to get a 5 char (total) length string $n = 2; $n_padded = sprintf('%05d', $n); // EXAMPLES // Pad month/year to 2 digits in credit card form dropdown $year_from = (int)date("y"); $year_to = $year_from + 6; for($i = $year_from; $i <= $year_to; $i++) { $year = sprintf('20%02d', $i); echo "<option value="{$i}">{$year}</option>"; } // Making up unique (Australian) mobile numbers for testing $n = 0; do { $mobile = sprintf('04%08d', $n++); } while(is_existing_mobile($mobile)); ?> |
Trello Boards Chrome Extension
I love using Trello, and use it all the time for work and personal task management. I now have upwards of 15 boards on the go at once, and found it frustrating that I needed to create a bookmark bar link to each new board that I create. Continue reading
Google+Stay with me!
The fastest way to buy Ink Cartridges and Toner Online
I am very happy to announce the launch of fastsupplies.com.au – the fast, easy way to order Ink Cartridges and Toner online in Australia! A huge selection of genuine and compatible ink and toner, an easy to use website, and our next day delivery policy means buying print supplies online got a whole lot easier.
Google+Extending Prototype’s Template class to allow default values
I’ve often wanted to extend Prototype’s Template class to allow setting default values for template fields if the user doesn’t pass them, so I wrote a simple wrapper class that does just that.
Google+
