RFC – ChuckNorris Plugin
Update (06/10/2009): installation & usage instructions are available from ChuckNorris Plugin wiki page.
Me and some colleagues were yammering some Chuck Norris Facts-like jokes a few days ago (ChuckNorrisException can never be caught, only thrown :p), and that reminded me of ChuckNorris Plugin, a simple plugin I wrote when I first started learning about Hudson plugin mechanism a while ago.
This plugin displays a picture of Chuck Norris, instead of Hudson the butler, and a random Chuck Norris ‘The Programmer’ fact on each build page.

On failure build, Chuck Norris is ready to give you a whoopin’ for breaking the build.
You’ll also see a Chuck Norris fact on the build page.
![]()
A thumb up on successful build.

And an alert stance on other build results.
Please leave a comment and let me know what you think of ChuckNorris Plugin. And also let me know if you want to install it on your Hudson instance, I’ll make the .hpi file available for download.
My favourite facts: ‘Chuck Norris can unit test an entire application with a single assert,’ and ‘When a bug sees Chuck Norris, it flees screaming in terror, and then immediately self-destructs to avoid being roundhouse-kicked.’
Projects: emptiness mycss plugins stylesheet wordpress
by Cliffano Subagio
24 comments
A Cleaner Way To Customise WordPress Theme Styles
The most frequently asked question from Emptiness Theme users was about customising the styles (font, color, width, etc) and the header image of the theme, and I usually answered by giving them some pointers to which file to modify and where. The problem was that most WordPress usersĀ would make the modifications directly against the theme files.
The downside of such approach is that the custom code would end up buried within the theme, which users won’t remember few months down the line. And this will then discourage them from upgrading the theme in order to avoid overwriting the customisations accidentally.
A cleaner approach to customise a theme is by isolating the custom code away from the original theme code. Having said that, I would like to encourage my theme users to start practicing this approach. Here’s what you need to do:
- Install MyCSS Plugin, read the documentation on how to use the plugin. Note: you might encounter an error complaining about ‘my.css file not found’, to fix this, you need to create my.css file under mycss plugin directory and give it a proper permission (644 will do).
- When you need to customise a style, do it on my.css file. CSS code in this file will take precedence over the theme’s own style.css .
For example, to change the font-family of the sidebar headings, I added these lines to my.css file:
h3 {
font-family: helvetica, sans-serif;
}
That’s it. I didn’t modify any of the theme code. The catch here is of course we have to be careful not to accidentally delete my.css file.
I don’t know why WordPress doesn’t have this custom CSS feature as part of vanilla WordPress installation. I think this would be very useful when they finally provide easy theme upgrade just like the way upgrading plugins is done.
As for MyCSS Plugin itself, it would be nice if it allows me to customise the location of my.css file so I can put it external to the plugin directory. And how about storing the content of my.css in the database so it can be persisted between plugin versions? Another nice improvement would be to provide the ability to upload files, handy for custom images.
Projects: bitpress image effect plugins reflection wordpress
by Cliffano Subagio
5 comments
Testing Reflection Plugin
I spent several train rides this week putting together Reflection Plugin for WordPress. This plugin applies reflection effect to images on a blog. The reflection effect is done on the client side using the excellent Raphael JavaScript library. You can use normal image on your posts as usual, and you’ll get the reflection effect by simply adding ‘reflection’ to the class value.
Here are some examples of the effect…
Wide movie poster:

Album covers, aligned, with wrapping text:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut pede ut mauris varius ultricies. In a dolor non risus dapibus faucibus. Etiam tristique pellentesque ligula. Cras tempus nunc vel turpis. Vivamus congue. Nullam hendrerit tincidunt metus. Pellentesque bibendum dapibus felis. Suspendisse risus magna, placerat id, malesuada eget, pellentesque quis, felis. Sed dolor lectus, vehicula rutrum, venenatis et, fringilla vel, tellus. Curabitur mi. Donec ligula pede, vulputate vitae, bibendum ac, pharetra in, elit. Pellentesque et mauris ut pede mattis commodo. Mauris massa odio, egestas eget, luctus id, suscipit sit amet, velit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse ac sem. Cras nec dolor a ipsum consectetur lobortis. In blandit erat. Fusce mollis ultrices ipsum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ut pede ut mauris varius ultricies. In a dolor non risus dapibus faucibus. Etiam tristique pellentesque ligula. Cras tempus nunc vel turpis. Vivamus congue. Nullam hendrerit tincidunt metus. Pellentesque bibendum dapibus felis. Suspendisse risus magna, placerat id, malesuada eget, pellentesque quis, felis. Sed dolor lectus, vehicula rutrum, venenatis et, fringilla vel, tellus. Curabitur mi. Donec ligula pede, vulputate vitae, bibendum ac, pharetra in, elit. Pellentesque et mauris ut pede mattis commodo. Mauris massa odio, egestas eget, luctus id, suscipit sit amet, velit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse ac sem. Cras nec dolor a ipsum consectetur lobortis. In blandit erat. Fusce mollis ultrices ipsum.
Obligatory browser screenshot:

For more information, please have a look at Reflection Plugin web page.
Update (07/12/2008): I’m starting to think that this plugin can actually be an image effect plugin. Not only reflection, something like rounded corner effect can easily be done with Raphael, along with many other effects. The underlying work is basically to apply client side image effect by using class attribute values as meta data (hmm, shouldn’t future version of CSS support this?). Oh well, let’s see how Reflection Plugin goes.
Blojsom 3 Plugins Update Wrap Up
Blojsom 3 was first mentioned on March 23rd 2006, and it was finally released (post milestone releases) on September 29th 2006.
The first time I mentioned about updating my plugins was on March 27th 2006. And today, March 25th 2007, almost a year later, I finally finished updating all plugins with necessary improvements along with documentation updates. Phew.
Here are some notes of each plugin:
BlogTimes Plugin
In Blojsom 2, BlogTimes Plugin only draws the current entries on the page, which means it only draws one blog time on a permalink view. This doesn’t give a good indication on the user’s blogging time pattern. In Blojsom 3, it draws a configurable number of N latest entries. So if you set it to a large value, e.g. 100, then you’ll get better graph on the time you post your last 100 blogs regardless whether you’re on a permalink view or not.
Galleryr Plugin
I was planning to upgrade Flickrj library from 1.0a8 to 1.0a9 for Galleryr Plugin for Blojsom 3, but I hit a problem with URL retrieval to which no one on Flickrj mailing list replied. I tried checking the source code to figure out the root cause of the problem, but SourceForge’s CVS was down all the time. I remember that I checked it on 3 different occasions. I also tried decompiling the binary class one by one, but at the end it was just a waste of time. I decided that I could live with 1.0a8 as long as it works as expected, though I really wanted to ditch the need to have GalleryrPhoto class.
Gravatar Plugin
In Blojsom 3, Gravatar Plugin stores Gravatar ID as comment metadata. This is to ensure Gravatar ID calculation is done only once, either when the comment is first posted or (for comments migrated from Blojsom 2 installation) when it’s viewed the first time. In Blojsom 2, Gravatar ID calculation is done every time the comment is viewed.
IpToCountry Plugin
The biggest problem with Blojsom 2’s IpToCountry Plugin is with data storage (country data stored in a large memory footprint) and retrieval process (pulling the country data repetitively on every comment view). While in Blojsom 3, this plugin stores the country data in the database, while country information is retrieved just once (similar to Gravatar Plugin approach) and stored as comment metadata. In short, IpToCountry Plugin no longer has a performance problem in Blojsom 3.
Pager Plugin
Pager Plugin is no more, it’s basically replaced by SkipFilterHelper Plugin in Blojsom 3. But I still did port pager.vm to work with SkipFilterHelper Plugin so you can still have the good ole page based navigation in Blojsom 3.
Param2Ctx Plugin
Still alive in Blojsom 3, still the simplest plugin ever.
SCode Plugin
I upgraded JCaptcha library from 1.0-RC1 in Blojsom 2’s SCode Plugin to 1.0-RC2.0.1 in Blojsom 3. This plugin still has all 3 of the original flavours (simple, gradient, and funky), I was thinking of adding more flavours but ended up wanting to finish the implementation a.s.a.p and stuck with the existing flavours. One problem that I’m starting to regret is the use of class loader in ImageFactory, I should’ve just injected the image engines via ImageFactory constructor instead.
TrackbackKeyword Plugin
TrackbackKeyword Plugin has some minor improvements in its Blojsom 3 implementation where it’s now possible to specify between checking all keywords or just one of the keywords to determine a trackback spam suspect, other than that it’s also now possible to configure proxy authentication for the plugin.
Plugins Update For Blojsom 3
Update: all plugins are now available for download from Source Forge.
I’ve finished updating most of my plugins to work with Blojsom 3, they’re currently in testing on both this blog and Melbourne Photoblog.
If you want to try the SNAPSHOT versions on your Blojsom 3 installation, you can download them temporarily from my server (I’ll add the released versions to SourceForge later on): blogtimesplugin-0.2-SNAPSHOT.jar, galleryrplugin-0.2-SNAPSHOT.jar, gravatarplugin-0.2-SNAPSHOT.jar, param2ctxplugin-0.2-SNAPSHOT.jar, scodeplugin-0.4-SNAPSHOT.jar, trackbackkeywordplugin-0.2-SNAPSHOT.jar.
I’ve also updated the wiki pages for Blojsom 3 plugins: BlogTimes Plugin, Galleryr Plugin, Gravatar Plugin, Param2Ctx Plugin, SCode Plugin, TrackbackKeyword Plugin. The source code is available at Google Code SVN, use Maven 2 to build the packages.
Overall, there isn’t much impact to my plugins with the change of Blojsom plugin API in version 3 compared to Blojsom 2 apart from method signature changes and some new events. Most of my effort was spent on adding unit tests which paid off when I started testing the plugins on a real Blojsom 3.0 installation and needed to 1) modify the configurations implementation, 2) add event broadcaster, and 3) change the event handling.
There were several minor improvements, code cleanup, and library dependencies upgrade (Flickrj for Galleryr Plugin and JCaptcha for SCode Plugin), but with only few hours per week spent on these plugins, I had to leave many of them out for later (most notably, I want to add more image engines and introduce audio engine capability to SCode Plugin).
Next on the list would be IpToCountry Plugin. This time we have database storage in Blojsom 3, whereas IpToCountry Plugin for Blojsom 2 was a memory hog where data is stored in a flat file and country search is done in-memory.
Pager Plugin is almost certainly discontinued with the existence of Skip Filter Helper Plugin in Blojsom 3.1, though I can still see the use of pager.vm file integrated with the data from Skip Filter Helper Plugin to generate the page navigation, maybe this can be done via a macro.