Skip to content

Instantly share code, notes, and snippets.

View elhu's full-sized avatar

Vincent Boisard elhu

View GitHub Profile
@elhu
elhu / gist:3208072
Created July 30, 2012 16:09
em-http-request HTTP Digest Auth middleware
module EventMachine
module Middleware
require 'digest'
require 'securerandom'
require 'cgi'
class DigestAuth
def initialize(opts = {})
@nonce_count = -1
@opts = {}
@elhu
elhu / gist:1136890
Created August 10, 2011 14:19
jquery events
$(document).ready(function() {
console.log("document loaded.");
$(document).ajaxStart(function() {
console.log(".ajaxStart fired!");
});
$(document).ajaxComplete(function() {
console.log(".ajaxComplete fired!");
});
});
@elhu
elhu / README.txt
Created February 5, 2014 11:15
Net::ReadTimeout weirdness
Some weird stuff about NetHTTP, the timeout is twice what it should be.
To test things out:
$> gem install sinatra
$> ruby server.rb
$> ruby client.rb