Skip to content

Instantly share code, notes, and snippets.

@paulirish
paulirish / bling.js
Last active August 27, 2024 04:55
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
};
NodeList.prototype.__proto__ = Array.prototype;
@orneryd
orneryd / gist:909fa5c66002d92f1506
Last active August 29, 2015 14:10
Marionette securedRouter
define([
'underscore',
'marionette'
], function(_, Marionette) {
'use strict';
/**
* SecureRouter
*
* This class is similar to the marionette Approuter except
@cmaher
cmaher / in-memory-localstorage.js
Last active August 29, 2015 14:08
Basic in-memory localStorage API for use with cmaher/backbone.hoard
// around 5MB, matching common localStorage limit
var STORAGE_SIZE_DEFAULT_LIMIT = 5000000;
var InMemoryStorage = function () {
this.storage = {};
this.size = 0;
};
_.extend(InMemoryStorage.prototype, {
setItem: function (key, value) {