Skip to content

Instantly share code, notes, and snippets.

View DanBUK's full-sized avatar

Daniel Bartlett DanBUK

View GitHub Profile
@DanBUK
DanBUK / init.js
Created January 15, 2016 00:18
hangups/lib/init.js
// Generated by CoffeeScript 1.10.0
(function() {
var CHAT_INIT_PARAMS, CHAT_INIT_URL, CLIENT_CONVERSATION_STATE_LIST, CLIENT_GET_SELF_INFO_RESPONSE, INITIAL_CLIENT_ENTITIES, Init, NetworkError, Q, find, fs, log, ref, ref1, req, request, syspath, uniqfn,
slice = [].slice;
request = require('request');
log = require('bog');
Q = require('q');

Keybase proof

I hereby claim:

  • I am danbuk on github.
  • I am danbuk (https://keybase.io/danbuk) on keybase.
  • I have a public key ASDhqRzstvgNicHW9FQG2gzVXLrev2bH1eGRLxQ_6zUZbQo

To claim this, I am signing this object:

@DanBUK
DanBUK / net.Stream.setConnTimeout.hack.js
Created January 11, 2011 22:55
This hack enables node.js to handle connection timeouts.
var net = require('net');
var sys = require('sys');
// START setConnTimeout hack
net.Stream.prototype._orig_connect = net.Stream.prototype.connect;
net.Stream.prototype.connect = function () {
var self = this;
if (typeof self.conn_timeout !== 'undefined' && self.conn_timeout > 0) {
self.addListener('connect', function () {
clearTimeout(self.conn_timer);