Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
if [ "$1" == "init" ]; then
brew install opam golang
opam init
eval `opam config env`
opam pin add qcow-format git://github.com/mirage/ocaml-qcow#master
opam install uri qcow-format
go get -u github.com/jteeuwen/go-bindata/...
git submodule init
@eden
eden / crashy.py
Created March 21, 2016 15:59
rethinkdb crash repro
import rethinkdb as r
conn = r.connect()
tables = r.db('test').table_list().run(conn)
if 'random' not in tables:
r.db('test').table_create('random').run(conn)
r.db('test').table('random').insert(dict(a=1)).run(conn)
r.db('test').table('random').insert(dict(b=2)).run(conn)
r.db('test').table('random').insert(dict(c=3)).run(conn)

Keybase proof

I hereby claim:

  • I am eden on github.
  • I am edenli (https://keybase.io/edenli) on keybase.
  • I have a public key whose fingerprint is 1735 49F0 8D60 625F F6F9 1080 92EA 9AEA 1A20 4A6F

To claim this, I am signing this object:

@eden
eden / dirty.py
Created May 24, 2013 16:02
Find dirty git repos in current directory
import stat
import os
for f in os.listdir("."):
if stat.S_ISDIR(os.stat(f).st_mode):
if not os.path.isdir(f + "/.git"):
continue
os.chdir(f)
sin, sout, serr = os.popen3("git branch")
branches = [b for b in map(str.strip, sout.readlines()) if b != "* master"]
@eden
eden / gist:3729512
Created September 15, 2012 20:00
Retrofit homebrew with an older vips
diff --git a/Library/Formula/vips.rb b/Library/Formula/vips.rb
index e33f734..f9e7369 100644
--- a/Library/Formula/vips.rb
+++ b/Library/Formula/vips.rb
@@ -2,8 +2,8 @@ require 'formula'
class Vips < Formula
homepage 'http://www.vips.ecs.soton.ac.uk/'
- url 'http://www.vips.ecs.soton.ac.uk/supported/current/vips-7.30.2.tar.gz'
- sha1 '5fac9ca28660bb3457290709988911b161239f8c'
@eden
eden / node-result.txt
Created April 19, 2012 23:05
twisted vs node
httperf --client=0/1 --server=localhost --port=8081 --uri=/ --send-buffer=4096 --recv-buffer=16384 --num-conns=100 --num-calls=1000
Maximum connect burst length: 1
Total: connections 100 requests 100000 replies 100000 test-duration 15.187 s
Connection rate: 6.6 conn/s (151.9 ms/conn, <=1 concurrent connections)
Connection time [ms]: min 139.7 avg 151.9 max 215.4 median 148.5 stddev 12.2
Connection time [ms]: connect 0.2
Connection length [replies/conn]: 1000.000
@eden
eden / hack.sh
Created March 31, 2012 15:37 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2266262/hack.sh | sh
#
@eden
eden / vips.rb
Created October 6, 2011 17:40
VIPS without ImageMagick
require 'formula'
class Vips < Formula
url 'http://www.vips.ecs.soton.ac.uk/supported/current/vips-7.26.3.tar.gz'
homepage 'http://www.vips.ecs.soton.ac.uk/'
md5 '1fbf164ef0da8e835a036c56ff659e8e'
depends_on 'pkg-config' => :build
depends_on 'gettext'
@eden
eden / bench.js
Created July 23, 2011 16:50
JSON vs msgpack
var msgpack = require('msgpack-0.4');
var DATA_TEMPLATE = {
'abcdef' : Math.random(),
'qqq' : 13,
'19' : [1, 2, 3, 4]
};
var DATA = [];
for (var i = 0; i < 500000; i++) {