This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ npm i | |
> node-protobuf@1.2.7 install /Users/bdonovan/code/node/node-protobuf | |
> node-gyp rebuild | |
CXX(target) Release/obj.target/protobuf/src/init.o | |
CXX(target) Release/obj.target/protobuf/src/native.o | |
../src/native.cpp:11:32: error: use of undeclared identifier 'NanNew' | |
Local<FunctionTemplate> tpl = NanNew<FunctionTemplate>(New); | |
^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bdonovan /tmp $ npm i node-protobuf | |
| | |
> node-protobuf@1.2.7 install /private/tmp/node_modules/node-protobuf | |
> node-gyp rebuild | |
CXX(target) Release/obj.target/protobuf/src/init.o | |
In file included from ../src/init.cpp:1: | |
In file included from ../src/common.h:7: | |
../node_modules/nan/nan.h:324:27: error: redefinition of 'NanEnsureHandleOrPersistent' | |
NAN_INLINE v8::Local<T> NanEnsureHandleOrPersistent(const v8::Local<T> &val) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// setup: | |
// npm i restify@3.0.3 request@2.58.0 http-proxy@1.11.1 | |
// | |
var assert = require('assert'); | |
var http = require("http"); | |
var restify = require('restify'); | |
var request = require('request'); | |
var httpProxy = require('http-proxy'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
client = MegaMusic::Client.new(:app_token => 'foo') | |
client.log_in | |
client.playlists.get_collection(:user_id => client.user.id) | |
module MegaMusic | |
class Client | |
def initialize(args={}) | |
@app_token = args[:app_token] | |
# etc. | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function immediate(cb) { | |
cb(new Error('immediate')); | |
} | |
function err_inside_next_tick(cb) { | |
process.nextTick(function() { | |
cb(new Error('next_tick')); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Mocha = require('mocha'); | |
var mocha = new Mocha({reporter: 'spec', ui: 'bdd'}); | |
function run_tests(cb) { | |
mocha.addFile('./test/foo.unit.js'); | |
mocha.run(function(failures) { | |
cb(failures); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis_client.set(key, JSON.stringify(doc), function(redis_err, response) { | |
}); | |
var url = "/"+user_id+"/likes?access_token="+offline_token; | |
// the above becomes | |
// var url = " /"+ user_id + "/likes?access_token ="+ offline_token; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.nestedTestCases = function (test) { | |
var call_order = []; | |
var s = { | |
setUp: function (callback) { | |
call_order.push('setUp'); | |
callback(); | |
}, | |
tearDown: function (callback) { | |
call_order.push('tearDown'); | |
callback(); |