Skip to content

Instantly share code, notes, and snippets.

View magicbill's full-sized avatar

Rui Zhang magicbill

  • Autodesk
  • Shanghai, China
View GitHub Profile
#!/usr/bin/env ruby
require "rubygems"
require "zookeeper"
def log(msg)
puts "[#{Process.pid}] #{msg}"
end
def debug(obj)
#!/usr/bin/env ruby
require "rubygems"
require "zookeeper"
def log(msg)
puts "[#{Process.pid}] #{msg}"
end
def debug(obj)
'''
chunked_server_test.py
Copyright August 3, 2012
Released into the public domain
This implements a chunked server using Python threads and the built-in
BaseHTTPServer module. Enable gzip compression at your own peril - web
browsers seem to have issues, though wget, curl, Python's urllib2, my own
async_http library, and other command-line tools have no problems.