Skip to content

Instantly share code, notes, and snippets.

View cab's full-sized avatar

Conner Bryan cab

View GitHub Profile
$ cat test.js
import R from 'ramda';
R.map(
function(f)
{
return 2*f},
[0,1,2])
$ time ied install babel-cli
real 0m14.378s
user 0m6.914s
sys 0m3.525s
$ time ied install babel-cli
real 0m1.020s
user 0m0.512s

lodash (no safety)

_(comments)
  .head()
  .pluck('examples')
  .head()
  .pluck('code')
  .value()
/* File: slate.example.js
* Author: lunixbochs (Ryan Hileman)
* Project: http://github.com/lunixbochs/reslate
*/
S.src('.reslate.js');
// enable to see debug messages in Console.app
// $.debug = true;
slate.alias('hyper', 'ctrl;alt;cmd');

Keybase proof

I hereby claim:

  • I am cab on github.
  • I am connerbryan (https://keybase.io/connerbryan) on keybase.
  • I have a public key ASDmFWDPqbBUjn7xWv1RMPSO1TVpbMVqV7X51NdnnmHF1wo

To claim this, I am signing this object:

// where `A` is a type and `a` is an instance of that type
data = (
(a, b, c),
(a, b),
(a, c, d),
(b, c, d, e),
(b, a),
(c, a, f, d),
(b, a, c)
// where `A` is a type and `a` is an instance of that type
data = [
(a, b, c),
(a, b),
(a, c, d),
(b, c, d, e),
(b, a),
(c, a, f, d),
(b, a, c)
object tester extends Poly1 {
implicit def hlistCase[T <: HList](implicit mapper : Mapper[tester.type, T]) = at[T](x => {
testMap(x)
})
implicit def anyCase[T] = at[T](x => 1)
}
def testMap[T <: HList](t: T)(implicit mapper : Mapper[tester.type, T]) = t.map(tester)
#! /usr/bin/env node
var execFile = require('child_process').execFileSync;
var filters = [
function replaceMasterWithMaester(word) {
if(word === "maester") {
return "master";
}
},
@cab
cab / split.py
Last active August 29, 2015 14:18
Split PDF spreads into pages. Arguments are: <pdf> <minimum_width_of_pages_to_split>
from PyPDF2 import PdfFileWriter, PdfFileReader
import sys
original_name = sys.argv[1]
min_spread_width = int(sys.argv[2])
original = PdfFileReader(open(original_name, 'rb'))
output = PdfFileWriter()
def getBoxSize(box):