Skip to content

Instantly share code, notes, and snippets.

View ghinda's full-sized avatar

Ionuț Colceriu ghinda

View GitHub Profile
@ghinda
ghinda / gist:6036998
Last active June 9, 2020 20:55 — forked from remy/gist:350433
local/session storage polyfill (@Rem's version + with support for opera mini)
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();