Nathan Pitmanhello, my name is
nathan pitman.

Category: Code

Adding on hover copyright to Lightbox Feb 13. 062

I’ve been using Lightbox by Lokesh Dakar on a current project and needed to add a simple copyright message on hover just to remind those nice users that they really shouldn’t simply rip my client off by printing little snap shots directly from his website.

Obviosuly this won’t deter the determined, it’s by no means bulletproof, but perhaps will serve as a gentle reminder to others.

#lightbox {
 background-imageurl(/assets/copyright.gif);
 
background-positioncenter;
 
background-repeatno-repeat;
}

#lightbox a:hover img#lightboxImage {
 filter:alpha(opacity=50);   
 -
moz-opacity0.50;   
 
opacity0.50;
}

At first I was looking for an easy way to script the overlay of a PNG with a copyright text but in the end I just went with a nice little opacity effect on the photo in question, thus revealing a copyright message which had been set as the containing DIV background image. Keep it simple stupid.

Of course, if you know of a better method, let me know. :)

Tagged: Code

CSSVista Launched Nov 08. 050

A while back the lads over at salted gave us a sneak peek at CSSVista, their standalone Windows application for web developers which allows you to edit raw CSS whilst live previewing the results in a tabbed IE and Firefox browser interface.

Well CSSVista is now available, even better, it’s free. Go grab yourself a copy and give it a whirl. I think this liitle application has some great potential! :)

New tricks with Textile Oct 19. 050

I’m using textile on a project I’m currently working on and having come up against a bit of an issue I discovered a nifty little feature of textile which I’d never used before.

The problem I was having is as follows.

I’m pulling a field out of a database which is marked up using textile, I then call the ‘TextileThis’ function to render it back as XHTML. This is all good except for one thing. The text I’m pulling back is wrapped in an ‘href’ in order to link the entire body of text to another part of the site. When the textile ‘XHTML’s my text it’s auto wrapped in an opening and closing paragragh tag, that’s fine in most cases but in this situation it messes up the visual rendering of the link element:

<a href="http://ninefour.co.uk"><p>This is my sample text</p></a>

Obviously this isn’t ideal.

So, I took a poke about in the textile class file and discovered that ‘TextileThis’ accepts a number of arguments. Wow, never realised that before.

function TextileThis($text$lite=''$encode=''$noimage=''$strict='')

Well I have no idea what ‘encode’ (URL encode maybe) and ‘strict’ do but ‘image’ will remove images and ‘lite’ prevents textile from wrapping it’s output in paragraph tags.

Success!

Getting on Google Maps May 03. 054

So, my mission should I choose to accept it, (which I have) is to have myself (or my domain name) appear on a Google Maps search for ‘nathan pitman berkshire’. Right now I’m listed... well, my work place is anyhow. But I want my house to be highlighted! That would be super neat.

I'm here!!!

So, here’s how I think I’m going to make it happen. The business look up is provided by yell, this is how google know what to display in the business list on the right, so I’m thinking I just need to be listed on yell right? Right!

I trot off to yell.co.uk thinking that this is going to cost me some £‘s but discover that you can actually apply for a free basic listing that appears not only on yell.co.uk but also in ‘the book’. Wow, how neat is that.

I enter my details, list my business as ‘nathanpitman.com’ select the relevant categorisation, enter my address… blah blah blah… eventually I get to complete my listing and then get my confirmation email. My listing is being ‘processed’!

All I can do now is wait, will I get listed, and when I do, will I show up on the Google Map… only time will tell!

Update: I’m listed on yell but still not showing up on the google map… :/

Adding geographical tags to your website Apr 23. 0516

Having noticed geographical data in the meta tags of many blogs recently I decided to investigate a little further and work out how to indicate the geographical location associated with my website. It took a bit of digging about, so I thought I’d share the results with you all.

Step 1 – Your Longitude and Latitude

First off you need to discover your longitude and latitude. If like me you don’t have a GPS device then you can use a number of online resources. I plumped for Streetmap. Simply enter your postcode and then on the map screen scroll down to find the line of text that reads “Click here to convert/measure coordinates”. Click on the link and make a note of the latitude and longitude figures that are returned.

LatN 51:23:31 51.391924 LongW 0:44:45 ( -0.745941 )

Step 2 – Generate ‘Geo’ or ‘ICBM’ tags

Now we can generate the most commonly used geographical tags to place in the head of our web pages. I used the Geo Tag Generator at ‘Geotags.com’ to generate by ‘geo’ tags and the instructions for adding a site to the GeoURL database at ‘GeoURL.org’ to generate my ICBM tags.

Your tags should look something like this:

<meta name="ICBM" content="51.391924, -0.745941">
<
meta name="DC.title" content="nathanpitman.com">
<
meta name="geo.position" content="51.3919;-0.7458">
<
meta name="geo.region" content="GB-BRC">
<
meta name="geo.placename" content="Bracknell">

Step 3 – Use those tags!

Now simply place your tags in you document head and start adding yourself to geographical databases such as:

Hoorah!

Tagged: Code