Skip to content

Instantly share code, notes, and snippets.

@karlbright
karlbright / 16step.coffee
Created December 7, 2012 03:03 — forked from peterc/16step.coffee
Simple 16 step drum machine using CoffeeScript and Node
# Simple 16 step drum machine experiment with Node and CoffeeScript
# by Peter Cooper - @peterc
#
# Inspired by Giles Bowkett's screencast at
# http://gilesbowkett.blogspot.com/2012/02/making-music-with-javascript-is-easy.html
#
# Screencast demo of this code at http://www.youtube.com/watch?v=qWKkEaKL6DQ
#
# Required:
# node, npm and coffee-script installed
$('#search').keyup(function () {
var searchField = $('#search').val();
var regExp = new RegExp(searchField, 'i');
$.getJSON('data.json', function (data) {
var results = [];
var output = $('<ul>').addClass('output');
var results = $.map(data, function(value, key) {
// GV Slider
"use strict";
var gvcharts = gvcharts || {};
gvcharts.defaults = {
margin: {top: 80, right: 80, bottom: 240, left: 200},
padding: 20,
axisBorder: 4,
;(function($, window) {
var defaults = {
duration: 1000,
delay: 500,
hideTree: 'hideTree',
showTree: 'showTree'
}
function accordion(el,options) {
function pullProperties = function(obj, props) {
return _.filter(obj, function(prop) {
return _.includes(props, prop);
})
}
Slider.prototype.getActual = function(dataset) {
if(!dataset.actual) return [];
_.map(dataset.actual, function(item) {
return pullProperties(item, ['output', 'minValue','maxValue']);
@karlbright
karlbright / playground.rs
Created January 16, 2020 02:59 — forked from rust-play/playground.rs
Code shared from the Rust Playground
#![allow(dead_code)]
use std::fmt::Debug;
#[derive(Debug)]
struct Matchbook {
matchers: Vec<Box<dyn Matcher>>,
}
impl Matchbook {