Archive for January, 2009
jQuery SuperSelect
A little while back I was working on a project and wanted a selectbox to look a bit more pretty, but with complete backwards compatibility with regular select boxs.
I.E. If I already had a select box on the page, and it had various JavaScript events hanging off it already, I wanted that to function still but I wanted the box to be prettier.
The first idea was to use CSS to just style the box. But then I realised that each browser and OS has it’s own different way of rendering the controls. So I turned to JavaScript, and the always useful jQuery library. I wrote a plugin that will immediately transform any selectboxes into prettier ones, allows icons for the options, all with valid xhtml and works completely fine with JavaScript (or the plugin) disabled. Pretty cool, eh?
Well, I put the original demo page I designed for it back online, so check out the plugin!.
CakePHP Evangelism and T-Cake
So I’ve had this blog for 3 posts now and none of them has a “cakephp” tag yet. Shocking. So here we go…
If you don’t know what CakePHP is and you’ve ever created a web application, or even a website that did more than show a static page, then you should check it out. CakePHP is a web application framework designed for rapid application development using the MVC Design Pattern and with a focus on Convention over Configuration.
What this means in practical terms is that you can built an access controlled, database driven, dynamic web sites/applications in a fraction of the time that it would to start from scratch. A simple blog could be built in a matter of minutes. I could go on for hours. So I won’t, but really – if you make web apps, consider using a framework and CakePHP is excellent.
Notes on the Culture
It recently found an essay written by Iain M. Banks regarding the society he so often writes about in his Science Fiction novels – the Culture. I found it interesting, as a fan of his books, because the Culture is so appealing.
Anyway to cut a long story short, I liked the essay but the presentation of it was upsettingly difficult to read. So I have produced a version of it myself, with improved markup.
Check it out for yourself: Iain M Banks: Notes on the Culture
Regular Expressions in MySQL
I like regular expressions. Anyone who has tried to understand them will understand the learning curve involved and in no way do I claim to be an expert. However, I use them all the time. They are possibly the most useful thing I have ever learnt to do with programming and are more powerful I imagined at first.
So what does this have to do with MySQL?
Well, I was recently dealing wit a table in which there is some inline JSON serialised data. This makes sense for the situation but of course if you want to query on something within the data you have to be a bit more careful. You have two options as I saw it yesterday:
- Pull all the data and parse it out outside of the database - which seems weak and inefficient.
- Use some LIKE query to pull likely candidates and then parse out of the data base - again not so good, but a bit better.
The First Post
So, I started using WordPress.
I have tried before, but never felt quite right. This time I braved the learning curve and dived right in.
The problem is that I want to control everything. I don’t know how WordPress was built because I didn’t write it. I don’t know how it’s templating works, because I didn’t write it. So I was wary…
This time I have taken a good look at the templating system, and manage to recreate the simplistic look that I had on my site beforehand. I am confident that I could also put more into as time goes on, but for now I am happy that it works.
So a blog eh? Well, I expect this one will be about code and what I’m currently writing, and my thoughts about it. I tend to write in PHP although innovation’s in other languages also pique my interest. On the last incarnation of this website, I had a link to some useful pieces of code that I had written, so I will create some static pages for those. Not very much, a couple of jQuery plugins, and some older Javascript Utilities that I used to use before jQuery but are pretty good all the same.