Skip to content

Instantly share code, notes, and snippets.

@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 {
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']);
;(function($, window) {
var defaults = {
duration: 1000,
delay: 500,
hideTree: 'hideTree',
showTree: 'showTree'
}
function accordion(el,options) {
// GV Slider
"use strict";
var gvcharts = gvcharts || {};
gvcharts.defaults = {
margin: {top: 80, right: 80, bottom: 240, left: 200},
padding: 20,
axisBorder: 4,
$('#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) {
@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
@karlbright
karlbright / pop-stripe.md
Created July 19, 2012 04:38
Rainbow stripe mixin with SCSS + Compass

Rainbow stripe mixin with SCSS + Compass

Usage

div
  height: 100px
  width: 100px

div.rainbow-1
@karlbright
karlbright / build.js
Created June 7, 2012 23:02 — forked from millermedeiros/build.js
sample node.js build script including RequireJS optimizer (r.js) and copy/delete/filter files
var _cli = require('commander'),
_glob = require('glob'),
_minimatch = require('minimatch'),
_wrench = require('wrench'),
_fs = require('fs'),
_path = require('path'),
_requirejs = require('requirejs');
@karlbright
karlbright / border.css
Created May 2, 2012 23:47 — forked from nrrrdcore/border.css
Faded/Gradient Borders in Pure CSS
.border-container {
width: 28%; /* border will be on the left on this container */
float: right;
overflow: hidden; /* only needed if floating container */
min-height: 600px; /* static height if you want your container to be taller than its content */
-moz-box-shadow: inset 15px 0 5px -16px rgba(0,0,0,.1), -1px 0 0 #FFF;
-webkit-box-shadow: inset 15px 0 5px -16px rgba(0,0,0,.1), -1px 0 0 #FFF;
box-shadow: inset 15px 0 5px -16px rgba(0,0,0,.1), -1px 0 0 #FFF;
border-width: 0 0 0 1px;
-webkit-border-image:
@karlbright
karlbright / gist:2020188
Created March 12, 2012 06:10 — forked from dx7/gist:1333785
Installing ruby-debug with ruby-1.9.3-p0
# Install with:
# bash < <(curl -L https://raw.github.com/gist/1333785)
#
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug
echo "Installing ruby-debug with ruby-1.9.3-p0 ..."
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem