Author Archives

Mailto Hyperlinks Stop Spam Bots!

Everyone hates spam, I hate it even more than most people. If you put an email address on a website, as a mailto hyperlink, then it's likely that spam bots will find this address and start sending annoying emails.
One way to get around this is to use a clever technique which I discovered over at [...]

Vim Key Mappings

One of the things I always found awkward about Vim is stretching for the ESC key to get out of insert mode.
Here's a little trick that I like to add into my .vimrc file:
PLAIN TEXT
CODE:

map  <space> i

imap <S-space> <esc>

This will let you escape insert mode by pressing shift and space and enter insert mode [...]

IE7 Clicky Sounds Do my Nut in!

I'm not a fan of applications that use sounds effects, one of the first things I do when configuring a new PC is to set the Windows Sound scheme to 'No Sounds'. IE7 has the hugely annoying feature where a click sound is made when you click a link with the middle mouse button (this [...]

PHP: File Downloads HTTP Headers

In PHP you can provide file downloads by using a PHP page to “pass through” the file. Of course you could just link to the actual file, however this technique means your file can kept outside of your website root. Another advantage is you can integrate this system into a PHP based user/password system easily.
Now [...]

Away with Applications: The Death of Desktop

There is a great talk that went up on Google Videos earlier this month called Away with Applications: The Death of Deskop. In it the speaker, Aza Raskin points out that no work is carried out actually using the computers desktop. He also points out the failing of desktop applications, that you frequently need to [...]

PHP: Get First Index in Associative Array

The other day I was programming in PHP and needed to get the first index in an associative array. There doesn’t appear to be a built in function to deal with this so I wrote my own.
PLAIN TEXT
PHP:

function getArrayFirstIndex($arr)

{

foreach ($arr as $key => $value)

return $key;

}

Here's a bit of code you can test it on:
PLAIN [...]

JS: Execute JavaScript on Page Load

Recently I’ve been making an effort to improve my JavaScript skills, I’m not a JavaScript-Jedi yet but I have been picking up a few, tips, tricks and techniques.
One thing that I find extremely useful is using an init function to call other functions when the page has loaded. I have been using the nifty function [...]

Vim: Search and Replace, Insert new line

Vim has some really useful commands, especially search and replace ones. Unfortunately I'm always forgetting the finer details of how to use them so here's an example:
PLAIN TEXT
CODE:

:%s/$/\rthis is a new line

To break down whats happening above:

: switches Vim into command mode
% means we're going to apply this command to every line in our [...]

It’s internet with a small ‘i’ now

When I was doing my Computer Science degree our lectures used to make a big deal about making sure you spell Internet with a capital ‘I’, because it’s important and it’s the name of a thing. Apparently it’s now been decided that it should be spelt with a lowercase ‘i’, I wish bloody linguists would [...]

Death to Spammers!

I've starting getting lots of Spam comments on my blogs recently. This was becoming increasing annoying because each time someone comments on my blog I get sent an email. Not only were the comments sections, on some of my articles, full of viagra advertisements but my inbox was also full of notification about these comments.

I [...]