Skip to content

Instantly share code, notes, and snippets.

View kemitchell's full-sized avatar

Kyle E. Mitchell kemitchell

View GitHub Profile
@kemitchell
kemitchell / database.coffee
Created February 2, 2014 07:27
Node + CouchDB + Design Documents + NPM postinstall
# TODO: Connect to CouchDB using process.env properties
module.exports = {}
@kemitchell
kemitchell / A Few Notes.md
Last active August 29, 2015 13:56
A Legal English Macro Language

An experiment in extending the idea of mutatis mutandis agreements to a legal English macro language for repeatable, tailored contracts without software.

The idea is that a form agreement requiring dickered terms (e.g. interest rate on a note), alternative provisions (e.g. single or double trigger vesting), and optional provisions (e.g. stock redemption rights) could be appended verbatim to a cover sheet that applies substitutions to the form, resulting in a tailored agreement. Ideally, the cover sheet approaches the look of a term sheet with the addition of an agreement as to the form to be used, and reproducing still fewer "standard" terms.

Because the tailoring mechanism is textual replacement, rather than cross-references or defined terms---syntactic, rather than semantic---existing forms can be adapted to exhibits quickly. It doesn't matter what the agreement says, as long as chunks of it can be replaced.

@kemitchell
kemitchell / Makefile
Created April 3, 2014 14:56
Single Source File CoffeeScript Makefile
NODE_MODULES := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))node_modules
NODE = $(shell which node)
COFFEE = $(NODE_MODULES)/coffee-script/bin/coffee
UGLIFY = $(NODE_MODULES)/uglify-js/bin/uglifyjs
MOCHA_PHANTOM = $(NODE_MODULES)/mocha-phantomjs/bin/mocha-phantomjs
DOCCO = $(NODE_MODULES)/docco/bin/docco
BUILD_TOOLS = $(COFFEE) $(UGLIFY) $(MOCHA_PHANTOM) $(DOCCO)
BASE = index
SOURCE = $(BASE).coffee
@kemitchell
kemitchell / Notes.md
Created June 1, 2014 06:14
Conventionally Permissible Circularity in Contracts
  • Survival provision cross-references itself among list of surviving provisions
@kemitchell
kemitchell / Placeholders.bas
Last active August 29, 2015 14:02
Word Placeholder Replacement Macro
Attribute VB_Name = "Placeholders"
Function ValidateInput(value As String) As Boolean
ValidateInput = Len(Trim(value)) > 0
End Function
' Replace {Placeholders} with text entered by the user
Public Sub ReplacePlaceholders()
' VBA Collection does not have .Exists()
Dim dictionary
Set dictionary = CreateObject("Scripting.Dictionary")
@kemitchell
kemitchell / index.js
Last active August 29, 2015 14:07
levelgraph level-sublevel approximateSize issue
(function() {
var data, db, graph, graphSubLevel, level, levelgraph, levelup, otherSubLevel, search, sublevel;
levelup = require('level');
sublevel = require('level-sublevel');
levelgraph = require('levelgraph');
level = levelup('yourdb');
@kemitchell
kemitchell / pdfpages2jpg.sh
Created November 9, 2014 21:30
PDF Conversions
#!/bin/sh
gs -dNOPAUSE -sDEVICE=jpeg -dFirstPage=1 -sOutputFile=`basename $1 .pdf`-page-%d.jpg -dJPEGQ=100 -r600 -q $1 -c quit
@kemitchell
kemitchell / .jscsrc
Last active August 29, 2015 14:10
JSCS Configuration
{
"disallowEmptyBlocks": true,
"disallowFunctionDeclarations": true,
"disallowImplicitTypeConversion": [
"numeric",
"boolean",
"binary",
"string"
],
"disallowKeywords": [
@kemitchell
kemitchell / gist:9267c5831be2e88f3b08
Created December 7, 2014 08:39
JSHint Configuration
{
"node": true,
"esnext": true,
"bitwise": true,
"browser": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
@kemitchell
kemitchell / default
Created January 25, 2015 03:08
Remote NGINX reverse proxy for development use
upstream development {
server 127.0.0.1:8080;
server 127.0.0.1:4000;
}
server {
listen 80;
server_name dev.kemitchell.com;
location / {