Skip to content

Instantly share code, notes, and snippets.

View erikfried's full-sized avatar

Erik Fried erikfried

View GitHub Profile
@erikfried
erikfried / gist:1067011
Created July 6, 2011 11:05 — forked from remy/gist:350433
Storage polyfill
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (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();