Skip to content

Instantly share code, notes, and snippets.

rektide / direnv-launch
Created Jul 21, 2016 — forked from mfowlewebs/direnv-launch
View direnv-launch
. ./.envrc
eval $*
View Makefile
# Base dirs
SRC_DIR = src
TMP_DIR = tmp
DEV_DIR = dev
rektide / gist:bb6cec805fe73ae3875c
Last active Aug 29, 2015
View gist:bb6cec805fe73ae3875c

My feedback from the perspective of a framework developer is quite different. I found the tone and attitude towards express.js to be concerning and somewhat offensive. Here was a developer blaming the framework he chose for poor architecture when they never bothered to actually learn how the framework works in the first place. Everything that followed originated from this basic lack of understanding.

Express is designed with from a classic framework-developer perspective, exposing primarily a 'consumption-only' that allows developers to assemble together complex routing structures.

Express uses a very simple router logic which is at the core of how express works, so let’s examine that first (my knowledge of express is somewhat dated but I think the principal is still the same). Express keeps a hash of the various HTTP methods (GET, POST, etc.) and for each method, an array of middlewares. Each middleware is just a function with signature function(req, res, next) and an regular expression used to decid

View codeschoolfix.console.js
// ==UserScript==
// @name monkeybusiness-codeschool
// @namespace
// @include http://**
// ==/UserScript==
// this is not actually a UserScript. because `getEventListeners` only exists in the dev-consoles.
// so copy paste this content in rather than actually running it as a userscript
// the capability not actually in HTML.
View pedantically_commented_playbook.yml
# ^^^ YAML documents must begin with the document separator "---"
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
View gist:6890303
<unit id='toolingorg.eclipse.e4.fix.jvmArg' version='4.2.0.I20120131-2200' singleton='false'>
<provides size='2'>
<provided namespace='org.eclipse.equinox.p2.iu' name='toolingorg.eclipse.e4.fix.jvmArg' version='4.2.0.I20120131-2200'/>
<provided namespace='toolingorg.eclipse.sdk.ide' name='org.eclipse.e4.fix.jvmArg' version='4.2.0.I20120131-2200'/>
<required namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.sdk.ide' range='[0.0.0,5.0.0)'/>
<touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
<touchpointData size='1'>
rektide / gist:3202107
Created Jul 29, 2012 — forked from aphyr/gist:3200829
Node.js message passing test
View gist:3202107
var cluster = require('cluster');
var m = 1000000;
function bounce(msg, out) {
if (msg < m) {
out.send(msg + 1);
return null;
} else {
console.log("Finished with", msg);
View gist:1410258
> Not being able to rely on a strong community presence meant we had to fend for
> ourselves in figuring out what "good" Scala was. In hindsight, I definitely
> underestimated both the difficulty and importance of learning (and teaching)
> Scala. Because it's effectively impossible to hire people with prior Scala
> experience (of the hundreds of people we've interviewed perhaps three had Scala
> experience, of those three we hired one), this matters much more than it might
rektide /
Created Oct 19, 2011 — forked from maxogden/

Your API does REST, but can it SLEEP?

SLEEP (Syncable Lightweight Event Emitting Persistence) is an emerging standard for distributed data sync using HTTP and JSON. A generalized version of CouchDB's much lauded built-in replication, SLEEP extends the REST architecture to define a way in which databases can offer syncable JSON APIs that foster open data innovation by allowing developers to replicate entire databases over the net.

SLEEP comes from the Apache CouchDB project which is now widely known for it's multi-master streaming HTTP + JSON replication. This is possible in part because of the CouchDB _changes feed, which is a particular API that lets you see if there have been any changes made to the database since last time you synchronized. CouchDB can efficiently implement the _changes feed because of one subtle difference between it and most other databases: it stores a history of all changes that happen to the database, including deletes.

If you synchronize data from a remote source and then the