Skip to content

Instantly share code, notes, and snippets.

@yehosef
yehosef / 0_reuse_code.js
Last active August 29, 2015 14:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@yehosef
yehosef / gist:57df0ec37d5096222cf0
Last active August 29, 2015 14:04 — forked from remy/gist:350433
check for localStorage support and if its not there, make a polyfill based on cookies
// refer to https://gist.github.com/paulirish/5558557
try {
if (!window.localStorage || !window.sessionStorage) throw "exception";
localStorage.setItem('storage_test', 1);
localStorage.removeItem('storage_test');
} catch(e) {
(function () {
var Storage = function (type) {