Skip to content

Instantly share code, notes, and snippets.

@ericgj
ericgj / dev.sh
Last active May 23, 2016 16:24
tmux open session/window for project
#!/usr/bin/env sh
# loosely based on http://pastebin/D8y7prYV, except with windows not sessions
if [ ${#} -eq 3 ]; then
echo "You need to provide both a session and path" 2>&1
exit 1
fi
sess=${1}
@ericgj
ericgj / README.md
Last active December 24, 2015 20:16
Costs of task switching analysis

Costs of task switching

An exploratory data analysis using d3

@ericgj
ericgj / 0-INDEX.md
Last active December 17, 2015 12:09
DEFER LIST

2 Oct

  • update metalsmith plugins for metalsmith 1.x

30 Jan

  • json-schema-*: consider a different implementation strategy that makes "core" less core:
  • does not require pre-parsing the schema in order to dereference and validate
  • allows pluggable validators through a common interface, with a default validator
  • parses the schema only when building a correlation, which is where it is actually used
  • correlation prototype is extendable, as now, through a plugin interface
  • "model" functionality is implemented as a correlation plugin
# More or less direct translation of folktale.js data.task + control.async.parallel
# https://github.com/folktale/data.task/blob/master/lib/task.js
# https://github.com/folktale/control.async/blob/master/lib/core.js
module Monads
class Task
def self.of(x)
new {|_,res| res[x] }
@ericgj
ericgj / startapp.js
Last active October 28, 2015 15:13
// A translation of Elm's StartApp to js + ramda + flyd
// for comparison see https://github.com/evancz/start-app/blob/2.0.1/src/StartApp.elm
// Comments welcome
var curry = require('ramda/src/curry');
var map = require('ramda/src/map');
var concat = require('ramda/src/concat');
var reduce = require('ramda/src/reduce');
var commute = require('ramda/src/commute');
@ericgj
ericgj / gsubs.rb
Created September 14, 2012 00:25
rspec to minitest
# Usage
# ruby gsubs.rb './tests/**/*.rb'
ARGF.replace Dir[ARGV[0]] unless ARGV.empty?
require 'fileutils'
$GSUBS = \
[
[ /^(\s*)(.+)\.should\s+be_true/ , '\1assert \2' ],
@ericgj
ericgj / 0-INDEX.txt
Created February 27, 2012 16:04
Several things I learned this week: 27 Feb
1. Two different uses for DelegateClass [newman-scheduler]
2. Array() top-level function works on any Enumerable
@ericgj
ericgj / 0-INDEX.txt
Created February 14, 2012 18:15
Several things I learned this week: 13 Feb
1. Building a chainable lazy-iterator interface
2.
@ericgj
ericgj / 0-INDEX.txt
Created February 9, 2012 15:27
Several things I learned this week: 6 Feb
1. The ruby singleton, Greg's current thinking
2. Writing your own enumerator generator for fun and profit
3. There once was a project named Computer Programming For Everyone