Skip to content

Instantly share code, notes, and snippets.

View wilmoore's full-sized avatar

Wil (₩) Moore III wilmoore

View GitHub Profile
@wilmoore
wilmoore / jasmine-node.rb
Last active August 29, 2015 14:05
jasmine-node
require 'formula'
class JasmineNode < Formula
homepage 'https://github.com/mhevery/jasmine-node'
url 'https://github.com/mhevery/jasmine-node/archive/1.14.5.tar.gz'
sha1 'd4f4776476a114ba6a1d0d368cdb4988d39e4cf0'
depends_on "node"
def install
@wilmoore
wilmoore / snowcrash.rb
Last active August 29, 2015 14:05
snowcrash.rb
require 'formula'
class Snowcrash < Formula
homepage 'http://apiblueprint.org'
head 'https://github.com/apiaryio/snowcrash.git', :tag => 'v0.12.1'
def install
system "./configure"
system "make", "snowcrash"
bin.install Dir["bin/snowcrash"]
@wilmoore
wilmoore / server.js
Last active March 31, 2016 08:33
Simple KOA service.
#!/usr/bin/env node --harmony
/**
* Creates an http server that responds to a POST with a JSON payload ({ id: "<string>" }).
*
* Example:
*
* % ORIGIN='http://127.0.0.1:8000' ./server.js
* //=> service running @ http://127.0.0.1:3000/echo
* //=> Access-Control-Allow-Origin: http://127.0.0.1:8000
@wilmoore
wilmoore / dabblet.css
Created March 29, 2014 19:47
CSS3 Border-Radius with Border - Circle Avatars
/**
* CSS3 Border-Radius with Border - Circle Avatars
*/
/* General Styles */
body {
background: url(http://subtlepatterns.com/patterns/white_texture.png);
font: 100 14px sans-serif;
color: #444555; text-shadow: 0 2px white;
@wilmoore
wilmoore / index.js
Created February 17, 2014 00:40
requirebin sketch
var selectn = require('selectn');
var talk = {
info: { name: 'Go Ahead, Make a Mess' }
};
var talk = selectn('info.name', talk);
console.log(talk);
@wilmoore
wilmoore / qw.sweet.js
Last active August 29, 2015 13:56
First Attempt at SweetJS macro development.
macro makeString {
case { _ $tok } => {
return [makeValue(#{$tok}[0].token.value, #{here})]
}
}
macro qw {
rule { ($delimited ...) } => { [$(makeString $delimited) (,) ...] }
}
module.exports = spacify;
/**
* Separate characters in a string with a space.
*
* @param {String} str
* string to transform.
*
* @return {String}
* Space separated string.
@wilmoore
wilmoore / gist:7935485
Created December 12, 2013 21:09
Unit Testable Fizz Buzz
function isMod0(a, b) {
return a % b === 0;
}
function fb(n) {
var out = '';
if (isMod0(n, 3)) out += 'Fizz';
if (isMod0(n, 5)) out += 'Buzz';
@wilmoore
wilmoore / ideal.js
Last active December 29, 2015 11:39
Avoid closure creation within a non-lexically scoped loop.
var idx = -1;
var end = 10;
function eventually(fn, timeout) {
setTimeout(fn, timeout);
}
while (++idx < 10) {
eventually(console.log.bind(console, idx));
}
@wilmoore
wilmoore / 2013-11-18.md
Last active December 28, 2015 15:49
My Open Source Report Cards Over Time (http://osrc.dfm.io/wilmoore)

2013-11-18