Skip to content

Instantly share code, notes, and snippets.

View davidchambers's full-sized avatar

David Chambers davidchambers

View GitHub Profile
var alib = require('alib');
var blib = require('blib');
var clib = require('clib');
+var zlib = require('zlib');
var fruits = [
'apples',
'bananas',
'cherries',

Keybase proof

I hereby claim:

  • I am davidchambers on github.
  • I am davidchambers (https://keybase.io/davidchambers) on keybase.
  • I have the public key with fingerprint CC3A 9C98 F8FA 1729 D1ED  C345 1625 E2CF 0BD0 FE42

To claim this, I am signing this object:

@davidchambers
davidchambers / Makefile
Created March 8, 2014 00:32
Exclude files with "doctest ignore" in first line when running doctests
DOCTEST = node_modules/.bin/doctest --module commonjs
.PHONY: test
test: JS_FILES = $(shell find . -name '*.js' -not -path './node_modules/*' -not -path './test/*')
test:
@$(foreach file,$(JS_FILES),head -n 1 -- $(file) | grep --silent 'doctest ignore' - || $(DOCTEST) $(file) || exit 1;)
@davidchambers
davidchambers / DETAILS
Last active August 29, 2015 14:00
Single-Set Constructed (Teams)
DATE
9am, Sunday 15 June 2014 (NZ time)
VENUE
Level 2
5 High Street
Auckland 1010
findX :: (MatchObj -> Maybe MatchObj) -> [String] -> Maybe MatchObj
findX matcher words = head xs
where
xs = do len <- length words .. 1
idx <- 0 .. length words - len
let m = matcher { before: take idx words
, group: (drop idx >>> take len) words
, after: drop (idx + len) words
, matches: defaultTransaction
, context: []
@davidchambers
davidchambers / standard-super-league-s1.md
Last active August 29, 2015 14:22
Standard Super League

Standings

Player Points
David 9
Darryn 6
Matt 3
Koray 3

Round 1

@davidchambers
davidchambers / open_in_hashify.rb
Created May 15, 2011 23:10 — forked from adrusi/open_in_hashify.rb
TextMate command to open a markdown document in hashify.me
#!/usr/bin/env ruby
require "base64"
message = "HG: Enter commit message. Lines beginning with 'HG:' are removed."
data = STDIN.read
data.gsub!(/^HG: .+\n/, '') if data.include? message
%x[open http://hashify.me/#{Base64.encode64(data).gsub(/\n/, '')}]
=begin
+-[ COMMAND SETTINGS ]------------+
@davidchambers
davidchambers / io.js
Last active September 26, 2015 01:17
Sketch of possible (synchronous) IO and AsyncIO types in JavaScript
'use strict';
const fs = require('fs');
const R = require('ramda');
const S = require('sanctuary');
// unit :: ()
const unit = void 0;
<?xml version="1.0" encoding="UTF-8"?>
<seestyle>
<mode id="SEEMode.Javascript">
<style id="_Default"
color="#657b83" font-style="normal" font-weight="normal" background-color="#fdf6e3" />
<style id="/Javascript/Keywords"
color="#859900" font-style="normal" font-weight="normal" />
<style id="/Javascript/this"
color="#586e75" font-style="normal" font-weight="normal" />
<style id="/Javascript/Numbers"
@davidchambers
davidchambers / nginx.conf
Created July 12, 2011 16:37
Hashify nginx config
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;