Array to Table

Posted on: June 19th, 2013 by admin No Comments

I keep finding myself writing functions like this again and again so putting up here for future reference as this just does what it says on the tin: 1 2 function array_to_table($array) { $out = ‘function array_to_table($array) { $out = ‘ ‘.PHP_EOL.”.PHP_EOL; $first = true; foreach($array as $row) { if($first) { $out .= ”.PHP_EOL; foreach($row […]

Suzuki Supercarry

Posted on: June 8th, 2013 by admin No Comments

I’m selling my van as I now have a smart car. Will miss this van – has been great fun. This van could be yours for £1200. Here are some pics…

My Fishtank

Posted on: April 27th, 2013 by admin 1 Comment


2 x 100 litre tanks – water flows round in a circuit
Filtering and heating all takes place in bottom tank
Huge filter made out of drainpipe
Deep Sand Bed filter – find out more
Algae Scrubber- find out more
Beananimal overflow- find out more

The filtering is so good on this tank that I never need to do any water changes and the water always tests 0 for nitrates. The angel fish have laid eggs a couple of times so they must be happy. The sword tails and guppies have babies on a regular basis. In fact they used to be too many sword tails and guppies so I got the angel fish to keep the population down!

Save Previous HSBC Statements as CSV

Posted on: March 2nd, 2013 by admin 8 Comments

Annoying HSBC has no way to download previous statements as csv, any any other file type come to that. I’ve written a bookmarklet that allows you to download previous statements as a csv. At the moment only Chome supports naming a download using data: uri so it works best in Chrome. All the code is […]

Easily find specific block from ID in huge list of Drupal 6 blocks

Posted on: February 8th, 2013 by admin No Comments

Ever tried to find a specific block from it’s ID in a huge list of blocks in Drupal 6 admin? As it only shows block title, not ID’s in the admin screen it can be really tricky. This bookmarklet changes the configure link on the /admin/build/block page so it says the ID of the block […]

Drupal urlencode and Drupal urldecode

Posted on: February 7th, 2013 by admin No Comments

In Drupal when even I try to urlencode a url and pass it as an argument to a function then I get the error Not Found. It seems drupal does like the forward slashes, even if they are url encoded. To get round this I’ve written these two functions: 1 2 3 4 5 6 […]

Example of a complex dynamic query with subqueries in Drupal 7

Posted on: February 6th, 2013 by admin 2 Comments

I often find it hard to find good examples of Drupal 7 dynamic queries – especially when you are joining on to dynamically created tables so have put this up here for reference: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 […]

Pdie and Vdie

Posted on: January 7th, 2013 by admin No Comments

My two most used PHP functions are probably pdie and vdie. How many times have you written: print_r($var); die(); Or if it’s a big array and you want to see more clearly what it contains maybe: echo ‘</pre>’; print_r($var); echo ‘</pre>’; die(); And if you need to see more information then about the object / […]

How to plot trajectory based on inital angle and speed with jQuery and javascript

Posted on: November 3rd, 2012 by admin No Comments

I spent a long time looking for any information on this and anything I did find was too complicated for me to understand so hopefully this is a simple explanation. Fist we need to create an object to hold all our variables. 1 2 3 4 5 6 7 8 var ball = { x: […]

How to rotate a point around an origin with javascript

Posted on: November 3rd, 2012 by admin 1 Comment

Whilst this is quite simple I had trouble finding a easy to understand tutorial on this so put this up here for reference. Step 1 – Convert the angle you are rotating to from degrees to radians. To do this we just times the angle by PI and divide by 180. 1 angle = angle […]