September 2009
52 posts
We had the ticket on the sofa, and our puppy grabbed it and took off with it, so...
– Puppy nearly destroys $1.3m winning ticket | Stuff.co.nz
Here is the speech he drafted for Nixon to read in case the Apollo 11 Astronauts...
– William Safire’s Finest Speech - William Safire - Gawker
And if only 1% of those people... | Derek Sivers →
(via @nikz)
Eric got out and is now licking my screen! Damn you, Tom Oatmeal!
The new pants mean that left handed men can finally go to the bathroom as...
– Store launches underpants for left-handed men | Stuff.co.nz
Google Chrome Frame - Google Code →
Google Chrome Frame is an early-stage open source plug-in that seamlessly brings Google Chrome’s open web technologies and speedy JavaScript engine to Internet Explorer.
Haha! Rock on Google…
YouTube Comes To A 5-Star Realization: Its Ratings... →
Interesting read on the usefulness of 5-star rating systems.
Lucid Dreaming: A Beginner’s Guide →
1 tag
Setting up for development on OSX 10.6 (Snow...
Read these articles and follow their instructions:
Enabling PHP and Snow Leopard Gotchas
Hivelogic.com: Ruby, RubyGems, Rails
Hivelogic.com: Git
Hivelogic.com: MySQL
Good luck!
Note to Gunrunners: Don’t Use Gmail | Wired.com →
Google Algorithm Predicts When Species Will Go... →
Very cool
Bulletproof @font-face Syntax →
matthewb:
Useful tips from Paul Irish.
1 tag
PHP: array_search with Partial Matching
Ever wanted to check for a value in an array with a partial match? Same.
// array_search with partial matches
function array_find($needle, $haystack) {
if(!is_array($haystack)) return false;
foreach ($haystack as $key=>$item) {
if (strpos($item, $needle) !== false) return $key;
}
return false;
}
Enjoy.
A boy asks her granny, “Have you seen my pills, they were labelled LSD?”
Granny replies, “f*ck the pills, have you seen the dragons in the kitchen?!”
1 tag
PHP: Safe Eval
Want to allow your users to enter and parse PHP code, but don’t want them to blow up your server? Try this:
// parse potentially eval'able code for illegal function calls
function bd_parse($str) {
// allowed functions:
$allowedCalls = explode(
',',
'explode,implode,date,time,round,trunc,rand,ceil,floor,srand,'.
'strtolower,strtoupper,substr,stristr,strpos,print,print_r'
);
//...