Tips of the Week

Compare versions of a file in git

September 28, 2010
Thumbnail image for Compare versions of a file in git

Super quick tip because I’m always forgetting – if you want to compare an older version of a file with the most recent version in your git repository:

How to access array data from SilverStripe sessions easily

September 14, 2010
Thumbnail image for How to access array data from SilverStripe sessions easily

Its not evident from the SilverStripe documentation on sessions, but you can access nested array data from SilverStripe sessions using dot notation.

How to change the breadcrumb separator on SilverStripe

September 13, 2010
Thumbnail image for How to change the breadcrumb separator on SilverStripe

Quick tip to change the separator used by SilverStripe to separate the links of the breadcrumb.

Jquery Lightbox Not Working?

August 13, 2010
Thumbnail image for Jquery Lightbox Not Working?

Had a struggle getting this jquery lightbox working recently, the solution for me was to alter the markup of the popup div because some divs were not closing correctly with />.

Call user function for magic method PHP

August 11, 2010
Thumbnail image for Call user function for magic method PHP

Put a bit of work into upgrading the blog and might as well make a quick post now. Heres a trick to test if a class variable exists, isset or has a particular value dynamically. Call the magic method __get() for the variable name which you can generate on the fly.

vnStat hack to measure data usage in a given billing cycle

June 9, 2010
Thumbnail image for vnStat hack to measure data usage in a given billing cycle

I’m using vnStat to measure internet usage on my Ubuntu 10.04 laptop, coupled with the vnStat PHP frontend it works nicely. Only problem was the summaries of disk usage started at the beginning of the month (sensibly) and we get billed on the 23rd, which is when our month ticks over and we get a [...]

Non capturing groups in Perl regular expressions

May 20, 2009

Non capturing groups are very handy, recently I was working on grabbing a portion of xml out of a document. After trying the PHP 5 xmlReader() class I opted for the quick and dirty Perl regular expressions for this script. Problem is with the dot/period operator . which matches any character except for newlines \n.

Blackberry 8800 html checkbox issues

March 30, 2009

This was such a mission to fix, it deserves a post. Starting with a very basic login page using standard html form elements, a couple of text inputs for username and password, a checkbox to accept terms and conditions and a submit button. The login system would work fine on very early blackberries version 3.7.0 [...]

Fix Eclipse crashing on Ubuntu 8.04

January 28, 2009

I’ve had some problems with Eclipse 3.3, Ubuntu 8.04 and Java JVM 1.6, just crashing mostly. There are a slew of fixes out there, but this simple fix has seemed to work so far…

How to switch off compiz and keep your settings

December 19, 2008

I was noticing some flickering watching dvds on Ubuntu 8.04 whilst running compiz. The flickering was even worse on those rare occassions I play a game. All this flickering went away when I disabled compiz, however, when enabling compiz again all the settings had been reset to defaults which was really annoying! Here is the [...]