Archive for the "Code" Tag

Today I felt like tidying a bit Planet WordPress, an unofficial aggregation of feeds about WordPress I've been maintaining for about 2 years now. The thing was fetching about 80 feeds, of which about a half were… dead, missing in action, or just inactive. It quickly appeared to me than manually reviewing 80 feeds would […][...] → Read more

Filed in: , , , ,
Posted On: 2007 / 05 / 03

A few days ago, Project Honey Pot introduced a new service : http:BL, a blacklist of all the suspicious IPs they are gathering through all the honey pots, and an API allowing anyone to use this blacklist. Their API is very easy to use, and I believe a number of projects (hint) should use it […][...] → Read more

One of the things you have to pay attention to when you move your website to another host is correct redirection to pages, and ensuring you're not giving 404 errors to legitimate requests. This morning I was checking my error logs and noticed a lot of pathetic attempts from script kiddies looking for an easy […][...] → Read more

Filed in: , , , , ,
Posted On: 2006 / 10 / 06

With Google's latest toy, Code Search, you have yet another tool for your egosurf needs. How many people use your code ? Example query for "ozh". Once again I found several WordPress themes using my Theme Toolkit I didn't know about, if only theme authors would simply drop a line to say hi when they […][...] → Read more

Filed in: , ,
Posted On: 2006 / 06 / 14

Situation : You want to insert some simple content into a DOM element. Since you happen to be a javascript n00b like me who always forget how to do it, and you don't want to use a 60 kb prototype.js for your 10 javascript lines project, you thought it would be useful to write down […][...] → Read more

Filed in: , ,
Posted On: 2006 / 06 / 09

Did you know it ? PHP GD's imagecolorallocate() can only allocate 255 colors in a palette based image created by imagecreate() (no such limitation when you use function imagecreatetruecolors() by the way). This sounds pretty stupid as well as rather undocumented, but anyway, here is a new version of my GD Gradient Fill PHP class, […][...] → Read more

Filed in: , , , ,
Posted On: 2006 / 06 / 01

I thought, and had been told, that using constants instead of variables in PHP was mostly a matter of speed : at run time, the engine replaces every occurrence of a constant with its hard-coded value, making code presumably faster than using variables that must be evaluated each time they are encountered. Or something like […][...] → Read more

Filed in: , , , ,
Posted On: 2006 / 05 / 30

Create your own complex functions in your wiki.[...] → Read more

Filed in: , , , ,
Posted On: 2006 / 05 / 23

PHP5 Benchmarks: for vs while, count vs sizeof, md5 vs sha1 and other speed comparisons like these for those who really need an extra millisecond of optimisation. I like this.[...] → Read more

Filed in: , , ,
Posted On: 2006 / 05 / 16

Basically, a plugin for WordPress creates a PHP function (called a filter or an action) which is triggered when a particular event (called a hook) occurs. When several filters are supposed to be triggered by the same hook, you can define their priority. When you're writing a plugin and you're facing unexpected behavior, it may […][...] → Read more