Clinton Montague

Developer, learner of things, functional programming enthusiast, hacker, and all round inquisitor.

Web development is a sack of shit

August 25, 2009

There are some developers out there who feel like they need to know the answers to everything before they can get started on even thinking about starting a project. For the most part, they’re right – but there are times in development when you just don’t know. Is it important to know that there will be exactly 7 links on a page? I argue that (from a development point of view), the only thing you need to care about is that it’s more than one and less than ‘lots’.

What is a browser?

June 19, 2009

Google went to Times Square in New York and posed (what we believe to be) a simple question – What is a browser? The answers were quite interesting – some people had no clue; others were painfully close, it just seemed like they didn’t have the right words to explain what they meant. Either way, it’s an interesting watch, and goes to show that what we take for granted isn’t always common knowledge.

2 Javascript lectures you need to watch

June 13, 2009

I can’t believe that I’m actually building one of those ‘XXX things you XXX about XXX’ lists, but I am. Although I’m letting myself off because this is not just (what I consider to be) filler material, but some links to some lectures which have genuinely improved my understanding and use of Javascript.

Flash and the z-index problem, solved

March 24, 2009

I was always told that Flash would render on top of everything else. That’s it. There’s no way around it. It meant that whenever I had a design using, say, suckerfish menus, I’d have to be careful to ensure that there was enough space below the menu to accommodate for Flash’s nasty little habit. It turns out that the notorious they were wrong. Again. It’s amazing just how many times ‘they’ don’t get it quote right, and that the majority of people still believe them.

Using a for loop, print the numbers from 0 to 5

March 16, 2009

I’ve been training for a ZCE certification, and found myself getting quite annoyed with some of the more obvious questions. One of the questions in the beginning of the test was which of the pieces of code would output the numbers 0 to 5 using a for loop. I mean, come on! I present some of my more creative and twisted ways of completing said task.

Operator precedence – what does (i=1)*i– – –i*(i=-3)*i++ + ++i equal and why?

February 22, 2009

I was looking at some code from a number of years ago and was horrified by the amount of ‘clever code’ in there. After decoding it, I immediately rewrote it. Then I set myself a challenge. Write the dirtiest expression ever to besmirch a hard-drive, then decode it in a blog post. I present to you with the fruit of my labour.

How to stop pesky spam by blocking IP addresses from visiting your blog

February 9, 2009

I had a lot of spam from a particular IP *cough* *cough* so I wanted to stop access to the site from the IP. Using only 3 lines in my htaccess file, I managed to cut down my spam by 4 an hour!

January 28, 2009

Quickly find the answer to one of the most important questions of all – is it the weekend yet?! It’s completely pointless, made by yours truely, and so easy to use that you just have to load the page to find the answer.

Creating your first jQuery plugin

January 26, 2009

It sounds like something that only javascript pros could do – make a plugin for jQuery. It took me a while before I even looked into it for the same reason. Around a year ago I tried it, and I want to show you just how easy it is.

AJAX is easy, but remember accessibility

January 18, 2009

AJAX is easy. It’s just javascript talking to your server to grab a little bit of content instead of the browser grabbing the whole thing. With this in mind, let’s get to work and build a simple AJAX application that will work with javascript turned off. We’ll do this by assuming that there is no javascript in your user’s browser, then use jQuery to change the DOM to add in the behaviours.