Skip to content

Instantly share code, notes, and snippets.

var wsock = require('websocket-stream');
var ws = wsock('ws://' + location.host);
var split = require('split2');
var through = require('through2');
var h = require('virtual-dom/h');
var state = { images: [] };
var createImage = require('./image.js');
var main = require('main-loop');
_.merge = wrapFunct(_.merge);
_.union = wrapFunct(_.union);
_.merge(AJAX.get('foo'), [ 'en' ], AJAX.get('bar'));
@sgimeno
sgimeno / parallel.js
Last active December 4, 2016 14:36 — forked from joseraya/parallel.js
var Q = require('q');
function printNumber(n) {
return Q.fcall(function () {
console.log("Number: ", n);
return n;
});
}
function printNumbers(numbers) {
@sgimeno
sgimeno / 0_reuse_code.js
Created March 11, 2014 06:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@sgimeno
sgimeno / nodeReadFile
Last active August 29, 2015 13:56
Async and sync ways to read files with FS in node.
var fs = require('fs');
var file = __dirname + '/test.json';
//Async read file
fs.readFile(file, 'utf8', function (err, data) {
if (err) {
console.log('Error: ' + err);
return;
}