Skip to content

Instantly share code, notes, and snippets.

@a-s-o
a-s-o / collection.js
Last active August 29, 2015 14:11
Unique Sorted Set with binary search
class Collection {
constructor (opts = {}) {
this.list = [];
this.length = 0;
var isFn = $.is.function;
if (opts.key) {
var keyType = $.object.type(opts.key);
@a-s-o
a-s-o / example-usage.js
Last active August 29, 2015 14:10
grid component for mithril (panels flow vertically, are absolutely positioned within the containing element and follow specified order)
import Grid from './grid.js';
var grid = new Grid();
m.module(document.getElementById("grid-container"), {
controller: function () {
grid.init();
// Generate a random number of panels (with random
// number of child tiles to create variations in height)