My track featured on PlanetBadminton Video
My track “Cosmopolitan” features on a PlanetBadminton video – thanks to Simon Pollock.
My track “Cosmopolitan” features on a PlanetBadminton video – thanks to Simon Pollock.
3 asked me to make a video with my thoughts on using Skype with their handsets. I am a big supporter of anything that gives me free phone calls! You can see the video on the 3 Bebo page.
A regular expression to match UK residential telephone numbers. It understands the difference between 02 and 01 numbers, as well as that 076 is not a valid prefix. It will accept all common formats and international numbers.
Examples of accepted numbers:
Examples of numbers that will not be accepted:
This is my first submission to the excellent regexlib.com regular expression library – I’d appreciate if you could vote for it!
/^((\(44\))( )?|(\(\+44\))( )?|(\+44)( )?|(44)( )?)?((0)|(\(0\)))?( )?(((1[0-9]{3})|(7[1-57-9][0-9]{2}))( )?([0-9]{3}[ -]?[0-9]{3})|(2[0-9]{2}( )?[0-9]{3}[ -]?[0-9]{4}))$/
Let me know if I’ve missed anything!
Amber Mac recently asked on Twitter if anyone had experience with Nicecast. I chimed in, and she asked if she could quote me in an article she was writing. I was only too happy to oblige, and here is the result.
In a previous post I showed you how to center a div on screen regardless of if it was inside an iframe or not. This is the second version, which should work regardless of if the div is in the top level window, an iframe, or a regular frame.
/******************************************************************
Name: center
Description: Center a div on page, no matter what!
Author: AK (www.zeroedandnoughted.com)
Date: 22nd April 2009
Version: 0.2
Dependencies: jQuery
Notes:
******************************************************************/
(function($) {
$.fn.center = function() {
return this.each(function() {
var $this = $(this);
var frameXOffset = 0, frameYOffset = 0, windowHeight = 0, windowWidth = 0;
//Are we in a frame?
if (top.document != window.document) {
var frm = $('iframe',top.document.body);
if (frm.length == 0) {
//regular frame
frm = $('frame',top.document.body);
}
var i=frm.length;
while (i--) {
if (frm[i].contentDocument) {
doc = frm[i].contentDocument;
} else {
doc = frm[i].contentWindow.document;
}
if (doc === document) {
//located our frame!
frameXOffset = $(frm[i]).offset().left;
frameYOffset = $(frm[i]).offset().top;
break;
}
};
if (jQuery.browser.msie) {
windowWidth = top.window.document.documentElement.clientWidth;
windowHeight = top.window.document.documentElement.clientHeight;
} else {
windowWidth = top.window.innerWidth;
windowHeight = top.window.innerHeight;
}
} else {
//we are not in a frame
if (jQuery.browser.msie) {
windowWidth = window.document.documentElement.clientWidth;
windowHeight = window.document.documentElement.clientHeight;
} else {
windowWidth = window.innerWidth;
windowHeight = window.innerHeight;
}
}
var elHeight = $this.height();
var newTop = ((windowHeight/2) - (elHeight/2)) - frameYOffset + $(parent.document.documentElement).scrollTop();
if ((newTop + elHeight) > $(document).height()) {
newTop = $(document).height() - elHeight;
}
$this.css ({
left: ((windowWidth/2) - ($this.width()/2)) - frameXOffset + $(parent.document.documentElement).scrollLeft(),
top: newTop
});
});
};
})(jQuery);
Recently Noughted