ThingyMaJig

Thingy Ma Jig is the blog of Nicholas Thompson and contains any useful tips, sites and general blog-stuff which are considered interesting or handy!

Connect

LinkedIn GitHub

Topics

announcement 25 apache 3 Apple 1 bash 8 code 7 cool 30 Days Out 8 Dark Basic Pro 4 design 12 doctor who 1 Drupal 74 E4600 1 EOS 400D 3 firefox 2 Flickr 3 free 21 games 5 geek 38 git 2 GreaseMonkey 1 hardware 7 Homebrew 1 How to 37 humour 5 iphone 1 javascript 1 jquery 1 K800i 6 k850i 4 lighttpd 3 linux 33 mac 9 miscellaneous 4 mobile phone 9 music 4 mysql 8 n73 1 n95 1 New Relic 1 Ogre3D 1 OS X 2 performance 3 photos 10 programming 40 Quicksilver 1 review 19 security 3 SEO 6 software 12 svn 2 technology 4 tip 7 tips 10 tv 3 video 3 vim 7 webdev 2 websites 33 wii 1 windows 1 YADS 10

Thingy Ma Jig

Patching can cause permission denied errors

11 August 2009
linux How to geek Drupal

I just updated this server to PHP 5.3. As all my sites are Drupal 6 it seems I have a few issues ahead which mean I need to patch Drupal to stop PHP complaining about deprecated stuff…

So I headed over to the post on drupal.org which is discussing 5.3 compatibility in Drupal 6 (which I personally think SHOULD go in) to grab a patch. I applied the patch with no problems. I refreshed a page and got a white screen so I checked the logs only to see…

Vim Tips: Replace 0px with 0

23 June 2009
vim tips programming Drupal

I like little wins. I was just looking through the CSS file for this site and noticed that - for some reason - I'd used 0px instead of 0 a LOT of times. Most values need numbers (10em, 10px, 10% and 10pt are all very difference sizes) however 0 is one of the few valeus which is the same in all cases (0px, 0pt, 0% and 0 are all zero!). This adds up to wasted data and bandwidth; admitedly not a lot, but still Every Little Helps!

So I fired up Vim. Initially, I just did:

Indenting in Vim

27 May 2009
vim linux How to

Ever had that situation where you've enabled :set paste and pasted in hundred of lines of code into vim only to see it all fully left aligned? I just did… And bugger going over each line and manually indenting it! Want know how to indent a visual block of text?

How to use "sed" to find and replace

26 May 2009
tip linux How to bash

After Worldpay recently changed to use the RBS system, I was tasked with finding every instance of select.worldpay.com/wcc/purchase in our forms and replacing it with select.wp3.rbsworldpay.com/wcc/purchase. There appeared to be thousands of files and I wasn't going to do it manually…

PHP's display_error, not always a good thing!

19 May 2009
programming geek Drupal

I just hit an interesting issue while trying to upgrade a Drupal 5.18 site to Drupal 6.12. I went to the update.php page and noticed an error at the top implying the url_aliastable was having issues due to Drupal 6 expecting a language column which wasn't present in Drupal 5. "No problem" I thought, "That'll get fixed during the update!". This was the beginning of a long learning curve through the new Batch API system!

Backing up a Drupal Database: Redux

27 April 2009
tip linux How to geek Drupal code bash

Back in November last year, I wrote a script which handled backing up a drupal database. There were quite a few comments and I've taken some on board and developed the script on a little further to be more "generic".

One of the main complaints/suggestions about my previous snippet was the hard coded nature of it. The follow script offers far more configuration through the command line itself.

I'm a lazy linux piper

11 March 2009
tip svn linux How to geek Drupal

This morning I updated a site to the latest release of Drupal 5.16. Nothing special there at all. I’ve done that many times as has (hopefully) mabye other drupal devs… However, I’m a bit of a newbie when it comes to SVN. Didn’t I mention this drupal site was in an SVN repository? ;-)

How to import users into Drupal using Devel

15 January 2009
tip programming How to Drupal

The first test is a valid email address test. The second test is if an account exists for that email address. The third is if the username, generated by the “user” part of the email address, exists. If there are any issues, the “error” is logged into and array and printed at the end.

Neat commenting in Vim

12 January 2009
vim programming linux Drupal

I am a bit of a "neat geek" when it comes to coding. Things should be indented neatly and should have well laid out comments! Why? Well… It's easy to do and in 6 months time when you look at your code you will appreciate it! It will also me even more appreciated by another developer in less than 6 months time ;-)