Skip to content

Instantly share code, notes, and snippets.

View gist:1088310
$ npm install --verbose
npm info it worked if it ends with ok
npm verb cli [ 'install',
npm verb cli '--loglevel',
npm verb cli 'verbose' ]
npm info using npm@0.2.19
npm info using node@v0.5.2-pre
npm verb /usr/local/bin/node node symlink
npm verb config file /home/rektide/.npmrc
npm verb config file /etc/npm/userrc
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

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 / trial1.html
Created Jul 9, 2012
Web Components attempt
View trial1.html
<?xml version="1.0"?>
<!DOCTYPE html>
<html xmlns="">
<meta charset="utf-8"/>
<title>ping pong component</title>
View gist:3202038
var Q= require("q")
// show time going by
var n= 0
function log(){console.log("..."+(++n))}
// we have to deferreds
var a= Q.defer(),
b= Q.defer()
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);
rektide / gist:3542173
Created Aug 30, 2012
Chainable error-resulting functions
View gist:3542173
// option 1: use Q.when/Q.fcall along with a normal error throw
function doWork(){
throw "bad"
// option 2: craft a rejected promise & return that
function badPromise(err){
// note: reject(err) returns the now-rejected promise, not the defer.
rektide / gist:4156037
Created Nov 27, 2012
vm_core.h for debugger-linecache (1.1.2)
View gist:4156037
strace -f -e trace=file bundle install 2>&1|grep vm_core.h
[pid 16417] open("/home/rektide/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/x86_64-linux/vm_core.h", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or directory)
[pid 16417] open("/home/rektide/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/ruby/backward/vm_core.h", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or directory)
[pid 16417] open("/home/rektide/.rvm/rubies/ruby-1.9.3-p327/include/ruby-1.9.1/vm_core.h", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or directory)
[pid 16417] open("./vm_core.h", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or directory)
[pid 16417] open("/home/rektide/.rvm/usr/include/vm_core.h", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or directory)
[pid 16417] open("/usr/lib/gcc/x86_64-linux-gnu/4.6/include/vm_core.h", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or directory)
[pid 16417] open("/usr/local/include/vm_core.h", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or directory)
[pid 16417] open("/usr/lib/gcc/x86_64-
View gist:4513985
tmprow msg%ROWTYPE;
-- [error: relation "tmprow" does not exist]
INSERT INTO msg (forChan,usr,t,msg)
rektide / gist:4540600
Last active Dec 11, 2015
So you're interested in JS, eh? Well, you are not alone!
View gist:4540600

What is the first step to learn JS? I really want to learn. Please give me URL for video etc. +Almaz Uson Uulu

Does anyone have any books or websites they recommend for JavaScript newcomers? I want to familiarize myself with Node and Backbone specifically. +James Brewer

I'am very new in Javascript, so I wanted to know what node.js is, does somebody know ? +muffin muffin

how i learn this language plzzzzzz tell me. +vivek nehra