Chris Tate-Davies

An archive of helpful tit bits of information for development, and probably some stuff that is incomplete, wrong or boring…

Using mod_rewrite for clean URLs

Say your message board on your blog uses the following request URL to find and display the correct data: http://www.mysite.com/blog/index.php?category=news&year=2012&month=1 This is a rather simple request, but it is not very nice looking or easy on the eye, and it can be improved, for the user end experience. Take this for instance: http://www.mysite.com/blog/news/2012/1 That’s much [...]

HEX colour chart with RGB reference

I need this quite often so I thought I would put it on my site. Nothing more, nothing less. (Click it to make it bigger)                    

CSS properties direction (padding, margins, etc)

You’ll have no doubt seen: padding: 5px 10px 5px 10px; in a CSS file. Do you ever wonder which of the properties are which? Just start at the top and move clockwise until you reach the left side. Top Right Bottom Left It saves doing this:- padding-top: 5px; padding-right: 10px; padding-bottom: 5px; padding-left: 10px; Just [...]

A-Z list of CSS features

Found this great list of CSS features. https://developer.mozilla.org/en/CSS/CSS_Reference

Viewing events attached to elements via JavaScript

If like myself, you often attach functions to elements using jQuery, for example: $(‘.btnName’).live(‘click’, function() { //do something }); There is a nice little browser extension that will show all the elements on the page with a little bubble outlining the attached events/functions. It is written by Allan Jardine, and you can get it from [...]

JQuery – bind event to non existant element

We all have to bind events to elements: $(‘#link).click(function(){     do some stuff }); But, what if that element doesn’t exist yet? Well, you can use the “live” handler: $(‘#link’).live(‘click’, function(){     do some stuff }); This will carry the event handler on and will match any future element that matches the selector. More information [...]

Sorting a SELECT with JQuery

Just a simple function to sort an already populated list. Obviously it would be easier to sort before populating, but there are the odd occasion where this is more complicated than you thought. Requirements : JQuery var selectOptions = $(“#selectId option”); Then, we just run the sort command on the options array – and this [...]

I wrote one of the first social networking sites

Its not a claim to fame, or a preempt to a court case to a ‘big hitter’, but back in the year 2000, when I was a fledgling junior programmer, I wrote an ASP web site based around a bunch of ‘buddies’. You could add people to your list, message them, upload a picture (just [...]

TabIndex in HTML

TabIndex is an attribute to HTML elements that tells the browser which control takes focus next when TAB is pressed. <input id=”one” tabindex=”3″ /> <input id=”two” tabindex=”1″ /> <input id=”three” tabindex=”2″ /> <input id=”four” tabindex=”4″ /> Here, once the page is loaded, the first TAB press will set focus to input two, and then subsequent [...]

  • Chris Tate-Davies

    Hello there. This is my little "repository" on the world wide web. Its for nothing more than documenting things that I might need again in the future. You could describe it as an extension to my memory.

    Also an online collaboration of my thoughts through the day. I'll try to keep the real random stuff out and keep the blog on course.

    Thanks for stopping by... Hope you find what you're looking for...

  • Tags