Pragmatism in the real world

Dynamic JavaScript Tabs v1.0.2

I received a patch from Imobach González Sosa to allow the Dynamic JavaScript Tabs code to support more than one tab container set on a single page. I've applied the patch and this is version 1.0.2! Thanks Imobach! Update: I've created a separate page to hold the download link

Active Record

I've recently been working through the PHP|Architect's Guide to PHP Design Patterns and have decided to build my own version of an active record along the lines of the one in Ruby on Rails. It's turning into an interesting experience as I'm doing using Test Driven Development methodology. This is proving very useful as I don't really have a clue where I'm going with the design, and so having a series of tests for each… continue reading.

PHP Collaboration Project

Everyone else is talking about the PHP Collaboration Project, so I thought I would too! I think this should be fun. There are two strands from what I can tell: A framework. A Zend plugin for Eclipse I currently use Zend's Studio and think it's great. it's expensive though and, to be honest, the problems revolving around editing have long been solved. Eclipse is a nice enough IDE and I think it would be better… continue reading.

Quick and Dirty Profiling

Profiling the quick and dirty way works for me a lot of the time. Other times, Zend's profiler is better, but when I just want to work out which function is taking all the time, the following function peppered throughout my code tells me what's going on:

10 Years of PHP

Seems hard to believe that PHP is 10 years old! I know it's quirky and not "elegant" in a lot of ways, but it fits what I need to get done like a glove. I especially like how it doesn't get in the way of creating kick-ass applications for the web!

Bug in Dynamic JavaScript Tabs

There's a bug in the Dynamic JavaScript Tabs code that I wrote. If you have "too many" tabs then they go onto a new line and look really ugly. It's a CSS issue that I haven't solved yet.. Anyone out there have any idea why I can't have 7 tabs? If you do, I'd appreciate a pointer! Update I've now worked out what it is and I'm being brain dead :) I set the width… continue reading.

Dynamic JavaScript Tabs v1.0.1

Using the Dynamic JavaScript Tabs in CMS Made Simple has shown up a small bug if you include the tabs.js file on a page that does not have an element with an id of "tabcontainer". Hence, I've released version 1.0.1 to fix this. No new features have been added. Update: I've created a separate page to hold the download link

Dynamic JavaScript Tabs

This is some code that I wrote to create dynamic tabs. I use it for forms where I have a lot of fields and a good percentage are "advanced" or otherwise not important enough to have visible immediately. The CSS is based on ideas from Silverorange Labs and the JS code is mine. The code is released under the MIT license which basically means you can do what you like with it as long as… continue reading.

Version Control

Apart from my day-job, I also do a very small amount of freelance work, mainly for my old company. The weirdest thing about this work is that they don't use any version control system for their websites. So far, I've fixed one particular bug 4 times… It's got to the point where I keep their sites in my version control system so that I can find out which bits of my code they have broken… continue reading.

Runtime Variable Inspection

The most common way to debug is to stick echo statements into your code at strategic places. If you are feeling clever, you might even output a variable's value too: echo "<p>here: $myvar = $myvar";</p> I call this runtime variable inspection and as PHP is a script language, it's a very fast way to debug a script. You stick the echo statement at strategic points and with a few page refreshes in the browser, you… continue reading.