While lazy loading of the images has been used by many performance conscious websites, the placeholder images are not usually the focus. Having placeholder images that respect the actual proportion of the lazily loaded images will reduce the “jumpiness” once images are loaded. Obviously in order to do this, you will need to know the… Continue reading Lazy image placeholders that respect the actual image aspect ratio
For the recent baby names project, we have a need to generate a baby name graphic on the fly to be used for pinterest. The corresponding graphics designed are very vector friendly. My first thought was why not generate these in svg to be shared? There are three background patterns and three different color groups… Continue reading Dynamically generate svg and converting it to gif in drupal
I’ve been using a nice caching php script for getting my latest tweets. Recently twitter completely stopped support for API 1 and everyone must use API 1.1. API 1.1 requires authentication and therefore making it more complicated to use the original script. I’ve modified the script with the help of the codebird library to do… Continue reading Twitter API 1.1 php get tweets script
Not really a new trick but I had to look for the syntax today to use reflection to set a private property on an object to use it in a junit test.
Yesterday I attended Ted Neward‘s game design session at nofluff. It inspired me to begin to implement the game sequence in an ajax app. It will be a private app since I only plan to play it with some friends. But it will be hosted somewhere on my website so it can be accessed from… Continue reading writing an ajax app for Sequence
One thing I did for dmb is making dodosmb.com/profile/username work with my profile.php script. Normally without the help of .htaccess, you can use the value of the path info from the global variable For example, create a php file named profile.php and in there put: Then upload the file and load it with yourServerPath/profile.php/dodo. The… Continue reading Simple PHP URL rewrite
i just saw the funniest thing in PHP yet! below is taken from here. This code is lifted from a socket handling class that I’ve been asked to work on today. Prepare to cringe: It’s worth noting that the foreach() statement will move from line 392 with so much as a return key (as it… Continue reading A new way of array checking in PHP
okie, i thought someone has figured it out by now. but when i asked on the wordpress board, i got no response. so i digged around and figured a hack for it. i noticed sometimes esp. on some pages, the smiley conversion does a poor job and converts the wrong text into smilies. it really… Continue reading disable wordpress smiley for a certain post/page
dodosmail has been upgraded to version 2.1 after securing it from header injection.
aw thanks to miki for the tip. i was wondering if there was a smarter way to print out the alphabet in php than just typing them out LOL Every letter of the English alphabet corresponds to an ASCII code, so rather than manually typing everything out, you can achieve the same result with a… Continue reading php alphabet output