This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Swap classes onload and domready | |
$(function(){ $('html').removeClass('not-ready').addClass('ready'); }); // jQuery | |
$(window).load(function(){ $('html').removeClass('loading').addClass('loaded'); }); | |
// target a specific version | |
if (navigator.isIE == 6){ | |
// do stuff for IE6 | |
} | |
// Deliever different behaviour for a group of IE versions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var css = [ | |
'/css/default.css', | |
'/css/section.css', | |
'/css/custom.css' | |
], | |
i = 0, | |
link = document.createElement('link'); | |
link.rel = 'stylesheet', | |
head = document.getElementsByTagName('head')[0], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Simple preforking echo server in Python. | |
Python port of http://tomayko.com/writings/unicorn-is-unix. | |
""" | |
import os | |
import sys | |
import socket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Simple forking echo server built with Python's SocketServer library. A more | |
Pythonic version of http://gist.github.com/203520, which itself was inspired | |
by http://tomayko.com/writings/unicorn-is-unix. | |
""" | |
import os | |
import SocketServer | |
class EchoHandler(SocketServer.StreamRequestHandler): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!sessionStorage && JSON) { | |
sessionStorage = (function () { | |
var data = window.name ? JSON.parse(window.name) : {}; | |
return { | |
clear: function () { | |
data = {}; | |
window.name = ''; | |
}, | |
getItem: function (key) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!window.localStorage || !window.sessionStorage) (function () { | |
var Storage = function (type) { | |
function createCookie(name, value, days) { | |
var date, expires; | |
if (days) { | |
date = new Date(); | |
date.setTime(date.getTime()+(days*24*60*60*1000)); | |
expires = "; expires="+date.toGMTString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* JavaScript Core Object v0.53 | |
* | |
* Licensed under the new BSD License. | |
* Copyright 2008-2009, Bram Stein | |
* All rights reserved. | |
*/ | |
(function() { | |
function getInternalType(value) { | |
return Object.prototype.toString.apply(value); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Note that this script is intended to be included at the *end* of the document, before </body> | |
*/ | |
(function (window, document) { | |
if ('open' in document.createElement('details')) return; | |
// made global by myself to be reused elsewhere | |
var addEvent = (function () { | |
if (document.addEventListener) { | |
return function (el, type, fn) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* JavaScript preload() function | |
* Preload images, CSS and JavaScript files without executing them | |
* Script by Stoyan Stefanov – http://www.phpied.com/preload-cssjavascript-without-execution/ | |
* Slightly rewritten by Mathias Bynens – http://mathiasbynens.be/ | |
* Demo: http://mathiasbynens.be/demo/javascript-preload | |
*/ | |
function preload(arr) { | |
var i = arr.length, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Simple preforking echo server in Python. | |
Python port of http://tomayko.com/writings/unicorn-is-unix. | |
""" | |
import os | |
import sys | |
import socket |
OlderNewer