Skip to content

Instantly share code, notes, and snippets.

$ 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
rektide / readme.md
Created October 19, 2011 21:34 — forked from max-mapper/readme.md
SLEEP - syncable.org

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

Originally:
https://gist.github.com/7565976a89d5da1511ce
> 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
rektide / trial1.html
Created July 9, 2012 18:51
Web Components attempt
<?xml version="1.0"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
<title>ping pong component</title>
</head>
<body>
<script>
@rektide
rektide / gist:3202038
Created July 29, 2012 21:48
Q's spread
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
rektide / gist:3202107
Created July 29, 2012 22:07 — forked from aphyr/gist:3200829
Node.js message passing test
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
rektide / gist:3542173
Created August 30, 2012 21:52
Chainable error-resulting functions
// option 1: use Q.when/Q.fcall along with a normal error throw
function doWork(){
throw "bad"
}
Q.when(doWork(),next)
Q.fcall(doWork()).then(next)
// option 2: craft a rejected promise & return that
function badPromise(err){
// note: reject(err) returns the now-rejected promise, not the defer.
@rektide
rektide / gist:4156037
Created November 27, 2012 18:23
vm_core.h for debugger-linecache (1.1.2)
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-
CREATE OR REPLACE FUNCTION SPROC_UA_MSG(_forChan INTEGER, _usr INTEGER, _t TIMESTAMP, _msg TEXT)
RETURNS void AS
$$
DECLARE
tmprow msg%ROWTYPE;
BEGIN
-- [error: relation "tmprow" does not exist]
INSERT INTO msg (forChan,usr,t,msg)
VALUES(_forChan,_usr,_t,_msg)
RETURNING *
@rektide
rektide / gist:4540600
Last active December 11, 2015 03:48
So you're interested in JS, eh? Well, you are not alone!

What is the first step to learn JS? I really want to learn. Please give me URL for video etc. +Almaz Uson Uulu https://plus.google.com/114157700890245066843/posts/fMR1AvWrSGv

Does anyone have any books or websites they recommend for JavaScript newcomers? I want to familiarize myself with Node and Backbone specifically. +James Brewer https://plus.google.com/102941808568962469596/posts/fyaLZ2s5UUu

I'am very new in Javascript, so I wanted to know what node.js is, does somebody know ? +muffin muffin https://plus.google.com/113538489002545066013/posts/aD8Yy4jHKz1

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