Skip to content

Instantly share code, notes, and snippets.

View apocas's full-sized avatar

Pedro Dias apocas

View GitHub Profile
@apocas
apocas / connectionpool.js
Last active February 3, 2018 19:48
Node,js SSH2 connection pool
var ConnectionPool = function (connection) {
this.connection = connection;
this.queue = [];
this.counter = 0;
this.running = false;
};
ConnectionPool.prototype.start = function () {
var self = this;
if (!this.running) {
@apocas
apocas / gist:4583334
Last active November 26, 2017 12:05
Node NPM registry crawler.
var jsdom = require('jsdom'),
request = require('request'),
url = require('url'),
npm = require("npm"),
redis = require("redis");
var client = redis.createClient();
var configObject = {
"dev": false,