Skip to content

Instantly share code, notes, and snippets.

@luk-
luk- / docs.diff
Last active December 10, 2015 03:08
diff out/doc/api/all.html /Users/luke/Repos/node/out/doc/api/all.html
1004,1007d1003
< <p>The notices look like this:
<
< </p>
< <pre><code>Stability: 1 Experimental</code></pre>
1011c1007
< <ul>
---
> <pre class="api_stability_0">Stability: 0 - Deprecated</pre><ul>
@luk-
luk- / sh.css
Last active December 10, 2015 02:58
.sh_sourceCode {
font-weight: normal;
font-style: normal;
}
.sh_sourceCode .sh_symbol,
.sh_sourceCode .sh_cbracket {
color: #333;
}
@luk-
luk- / gist:4270276
Created December 12, 2012 18:26
What if it was written in ruby?
13:22 luke_: what if it was written in ruby
13:22 mstyne: oh jesus
13:23 mstyne: $ rake freeballin/dolphin_pants.rb --test --noop --trace --gemsgemsgems
13:23 luke_: ruby -ivrq rake::run_test_env guacamole:-:machine:fulfill --env=production_test_mock --debug-level-low=2 --debug=semi-true
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 5984
@luk-
luk- / install_couch.sh
Created November 29, 2012 03:22
Debian 6.0 CouchDB install script
#!/usr/bin/env bash
##
## Simple couchdb install script for Debian Squeeze.
## Created by Luke Arduini <luke.arduini@me.com>
## 2012-11-29T03:15:15.494Z
## License: MIT/X11
##
echo -e 'Installing dependencies...\n'
@luk-
luk- / replicate_db.json
Created November 29, 2012 00:26
couch db replication using /_replicator db instead of /_replicate endpoint
{
"_id": "whatever",
"source": "http://some.couch.url/dbname",
"target": "local_dbname",
"continuous": true,
"user_ctx": {
"name": "user",
"roles": [
"_admin"
]
@luk-
luk- / gist:4158931
Created November 28, 2012 03:56 — forked from fdmanana/gist:832610
The CouchDB replicator database

1. Introduction to the replicator database

A database where you PUT/POST documents to trigger replications and you DELETE to cancel ongoing replications. These documents have exactly the same content as the JSON objects we used to POST to /_replicate/ (fields "source", "target", "create_target", "continuous", "doc_ids", "filter", "query_params".

Replication documents can have a user defined "_id". Design documents (and _local documents) added to the replicator database are ignored.

The default name of this database is _replicator. The name can be changed in the .ini configuration, section [replicator], parameter db.

2. Basics

@luk-
luk- / index.html
Created November 8, 2012 06:20 — forked from mbostock/.block
SVG Linear Gradient (D3)
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.27.1"></script>
</head>
<body>
<script type="text/javascript">
var w = 960,
h = 500;
d3.json('file.json', function (data) {
data_gobal = data
})
@luk-
luk- / process.js
Created October 17, 2012 16:24 — forked from rwaldron/process.js
// https://github.com/joyent/node/blob/master/src/node.cc#L2103
//
console.log(
typeof process !== "undefined" && {}.toString.call(process) === '[object process]'
);