Comments

Scottish courts logo; strangely phalic

Posted by sh1mmer on Dec 20, 2006 in Photos

The sheriff has only got one ball…

 
Comments

Quick tip; firefox javascript debugging

Posted by sh1mmer on Dec 19, 2006 in JavaScript

While I totally advocate using Firebug sometimes you need a starting point. I’ve been doing a few things that use prevent default to repress page loads. However, if something fails before the prevent default then it’s difficult to debug because the console is cleared when the page reloads. In order to stop this and to give me a starting point for places to put break points I’ve been using Tamper Data to abort page requests.

Whoops! I don’t do Firebug enough credit. Just click on the ‘script’ tab and select ‘Break on all errors’ in the options menu. Now it breaks on any and all errors. Sweet.

 
Comments

Yet another meme; Books;

Posted by sh1mmer on Dec 17, 2006 in General

Since I don’t have what I wanted to blog ready, I’m going to follow in Suw’s footsteps and do a book meme, even though I didn’t get tagged.

“No more than I believe that throwing coins into the river will keep you from harm.” Cyndll came sliding down the embankment a moment later, their water skins over his shoulders. With one last look around, they pushed the boat out onto the green water and found their places.

The book is “The One Kingdom” by Sean Russell.

I’m going to tag Chris, Stu, and Joe.

 
Comments

Lech Beer

Posted by sh1mmer on Dec 16, 2006 in Photos

Lech Beer

For the man who knows drinking makes everyone attractive.

 
Comments

Yahoo cyborg web developers

Posted by sh1mmer on Dec 14, 2006 in Photos

Yahoo! teh winar. Cyb0r6 t4ke 0v3r!

 
Comments

Automatic merging and versioning of CSS/JS files with PHP

Posted by sh1mmer on Dec 14, 2006 in JavaScript

Ed at work has written a really awesome post on using PHP to version JavaScript and CSS files into a single versioned include. His post Automatic merging and versioning of CSS/JS files with PHP make this all really trivial. Nice one Ed!

 
Comments

Advertising 2.0 Mashup*

Posted by sh1mmer on Dec 14, 2006 in London Events

Went to the Mashup* on advertising 2.0 last night. It was pretty interesting, although nothing ground breaking. Dave Burrows, Yahoo’s head of Ad technology in Europe, gave a good talk on where we are and were we should be looking. It leaves me feeling better about advertising at work, because I actually trust Dave.

The main take away for me, aside from the assorted business cards, was that advertising has to be content. Maybe that’s comedy, maybe that is a widget that allows you to do something, but above all it’s something the user gets value from. As John Taysom put it, “No one wants advertising, and anyone that does can see me afterwards for a pill.”

While I’m slightly loathed to pimp work here, I really like what Sainsburys did with Yahoo! Answers. When they sponsored the Food category and asked some questions, they created a background to content without interrupting it. Everyone knows in the food category that they can buy their food from many supermarkets. The advertising helped create some content by asking questions, and it gave some bias to their product, but it didn’t interfere with the user experience, it became part of it.

When advertisers realise that the ads need to become small desirable products in themselves things might get better.

 
Comments

Best book ever; Best review ever

Posted by sh1mmer on Dec 13, 2006 in General

Steve found the best book ever. “Raising Meat Goats for Profit”, which is in itself a lovely topic. However, I really really like one of the Amazon reviews.

“Gail Bowman is obviously experienced in the craft she writes about and her love of the most cantankerous of farm critters shows through.”

One day I too will own a cantankerous farm critter.

 
Comments

Leicester Square; Best Busker Ever!

Posted by sh1mmer on Dec 12, 2006 in Photos

Santa playing an electric guitar with jeans and trainers under his robe

I gave him 40p. Bargain.

 
Comments

Loving the DOM; insert child nodes at any position

Posted by sh1mmer on Dec 11, 2006 in JavaScript

One day I was bitching about the lack of a way to insert something at an arbitrary point into a list of DOM nodes. "I don't want to walk the DOM, or walk with Dinosaurs, for that matter!" said I, or something equally witty. Steve Webster sick of my whining, no doubt, suggested I write one.

So I did (with a little help from Heilmann).

Here it is in all it's glory

JavaScript:
  1. insertAtPosition = function(root, el, pos) {
  2.  //remove any whitespace nodes
  3.  for(var i=0,j=root.childNodes.length;i<j ;i++){
  4.     if(x.childNodes[i]===undefined){break;}
  5.     if(x.childNodes[i].nodeType===3){
  6.         x.removeChild(x.childNodes[i]);
  7.         i--;
  8.     }
  9.  }
  10.  //if the position is out of the current scope of the element
  11.  if(pos>root.childNodes.length || pos<0) {
  12.  return false;
  13.  }
  14.  // if pos is the same as length then add to the end of the children array
  15.  if (pos===root.childNodes.length) {
  16.  root.appendChild(el);
  17.  }
  18.  // insert before works for all other cases
  19.  else {
  20.  root.insertBefore(el, root.childNodes[pos]);
  21.  }
  22.  return true;
  23. };

Copyright © 2012 Kid666 Blog All rights reserved. Base theme by Laptop Geek.