This file contains hidden or 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 levenshtein(s1, s2) { | |
// http://kevin.vanzonneveld.net | |
// + original by: Carlos R. L. Rodrigues (http://www.jsfromhell.com) | |
// + bugfixed by: Onno Marsman | |
// + revised by: Andrea Giammarchi (http://webreflection.blogspot.com) | |
// + reimplemented by: Brett Zamir (http://brett-zamir.me) | |
// + reimplemented by: Alexander M Beedie | |
// * example 1: levenshtein('Kevin van Zonneveld', 'Kevin van Sommeveld'); | |
// * returns 1: 3 |
This file contains hidden or 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 events = require('events'), | |
util = require('util'); | |
var MockReadWriteStream = helpers.MockReadWriteStream = function () { | |
// | |
// No need to do anything here, it's just a mock. | |
// | |
}; | |
util.inherits(MockReadWriteStream, events.EventEmitter); |
This file contains hidden or 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
$ require-analyzer | |
info: require-analyzer starting in /Users/Charlie/Experimental/foobar | |
warn: No dependencies found | |
info: Analyzing dependencies... | |
info: Done analyzing raw dependencies | |
{ | |
target: '/Users/Charlie/Experimental/foobar/app.js', | |
reduce: true, | |
timeout: 5000, | |
root: '/Users/Charlie/Experimental/foobar', |
This file contains hidden or 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 socket = new io.Socket('localhost', { port: 8000 }); | |
socket.connect(); | |
socket.on('connect', function(client) { | |
}); | |
socket.on('message', function (msg) { | |
console.log(msg); | |
}); |
This file contains hidden or 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
$ express express-test | |
create : express-test | |
create : express-test/app.js | |
create : express-test/public/stylesheets | |
create : express-test/public/stylesheets/style.css | |
create : express-test/public/images | |
create : express-test/public/javascripts | |
create : express-test/logs | |
create : express-test/pids | |
create : express-test/views |
This file contains hidden or 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
git branch -M master-borked | |
git checkout isaacs/master | |
git checkout -b master | |
git push origin master —force |
This file contains hidden or 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
/* | |
* | |
* coderwall.js | |
* | |
* Code to display coderwall.com badges | |
* | |
*/ | |
var coderwallJSONurl ="http://www.coderwall.com/hermanjunge.json?callback=?"; | |
var height = 75; |
This file contains hidden or 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
Drone.prototype.list = function () { | |
var self = this, | |
appList = {}; | |
Object.keys(this.apps).forEach(function (key) { | |
appList[key] = { | |
app: self.apps[key].app, | |
drones: self.apps[key].drones | |
} | |
}); |
This file contains hidden or 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 httpAgent = require('http-agent'), | |
util = require('util'); | |
var agent = httpAgent.create('www.google.com', ['finance', 'news', 'images']); | |
agent.addListener('next', function (err, agent) { | |
console.log('Body of the current page: ' + agent.body); | |
console.log('Response we saw for this page: ' + util.inspect(agent.response)); | |
// Go to the next page in the sequence |
This file contains hidden or 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
diff --git a/lib/haibu/drone/drone.js b/lib/haibu/drone/drone.js | |
index ef375c7..f94d9af 100644 | |
--- a/lib/haibu/drone/drone.js | |
+++ b/lib/haibu/drone/drone.js | |
@@ -157,15 +157,37 @@ Drone.prototype.clean = function (app, callback) { | |
// Shows details for drone with `name` managed by this instance | |
// | |
Drone.prototype.show = function (name) { | |
- return this.apps[name]; | |
-}; |