Wednesday, April 21st, 2010
var getArrayIndex = function(array, item){
for (var i = 0; i < array.length; i++) {
if (array[i] === item) {
return i;
}
}
return -1;
};
var deleteArrayItem = function(array, item){
var index = getArrayIndex(array, item);
if (index > -1) {
return array.splice(index, 1);
}
return array;
READ MORE»
Monday, April 19th, 2010
var typefacehover = function (){
$(".typeface-js").each(function(){
//Get all the classes for an element.
var elementStyles = $(this).attr('class');
elementStyles = elementStyles.split(' ');
//Run through them and check for a :hover color property.
var hoverColor;
for (var i ... READ MORE»
Friday, January 8th, 2010
Wednesday, January 6th, 2010
$.ajax({
url:'http://www.example.com/somefile.ext',
type:'HEAD',
error:
function(){
//do something depressing
},
success:
function(){
//do something cheerful :)
}
});Tags: code snippet
View Comments
Monday, December 14th, 2009
function example($args="") {
$variable1 = $args['variable1']? $args['variable1'] : 'default';
}$args = array(
'variable1' => 'value',
'variable2' => 2,
'variable3' => $etc
READ MORE»
Wednesday, December 9th, 2009
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /yourcode.php [L]
$uri = $_SERVER['REQUEST_URI'];
$vars = explode('/', $uri);
Tuesday, May 26th, 2009
Will it be love at first sight or a bitter, bitter marriage with no possibility of divorce?
Pandora’s little black box is about to be opened. Soon, very soon, most common browsers will support the @font-face CSS directive. Web designers will have at their disposal any TrueType or OpenType font that legally allows for web embedding. What does that mean to you? Well, brace yourself for a web full of unreadable, kooky typefaces, messy grunge fonts, and lots and lots of imitation handwriting.
Tags: font-face, typography
View Comments