Skip to content

Instantly share code, notes, and snippets.

View davidguttman's full-sized avatar

David Guttman davidguttman

View GitHub Profile
var test = require('tape');
test('setup', function (t) {
// ...
t.end();
});
// tests go here
test('teardown', function (t) {
var multilevel = require('multilevel');
var shoe = require('shoe');
var sock = shoe('/sock');
var db = multilevel.client();
window.db = db;
sock.pipe(db.createRpcStream()).pipe(sock);

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/

So you might have set up dnsmasq with this tutorial but then you notice that you can't set cookies to subdomains of localhost or for all of localhost's subdomains (see why).

So we set up a custom "localhost", that I'll call local.host, but you can pick whatever you want, as long as it contains at least one dot. Just adapt the first two commands.

$ # add to hosts list
$ sudo echo "127.0.0.1 local.host" >> /private/etc/hosts
$ # tell your dns server about it

First, install dnsmasq using brew:

$ brew update
$ brew install dnsmasq

Then create your configuration

// data comes from here http://stat-computing.org/dataexpo/2009/the-data.html
// download 1994.csv.bz2 and unpack by running: cat 1994.csv.bz2 | bzip2 -d > 1994.csv
// 1994.csv should be ~5.2 million lines and 500MB
// importing all rows into leveldb took ~50 seconds on my machine
// there are two main techniques at work here:
// 1: never create JS objects, leave the data as binary the entire time (binary-split does this)
// 2: group lines into 16 MB batches, to take advantage of leveldbs batch API (byte-stream does this)
var level = require('level')
{
"name": "example",
"version": "0.0.1",
"devDependencies": {
"hbsfy": "~0.1.5"
},
"browserify": {
"transform": "hbsfy"
}
}

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

window.addEventListener("load",function() {
setTimeout(function(){
window.scrollTo(0, 1);
}, 0);
});