Skip to content

Instantly share code, notes, and snippets.

chrisklaiber /
Created Feb 15, 2018
Python SimpleHTTPServer over IPv6. Run as `python -m SimpleHTTPServer6 [PORT]`
import BaseHTTPServer
import SimpleHTTPServer
import socket
class HTTPServer6(BaseHTTPServer.HTTPServer):
address_family = socket.AF_INET6
if __name__ == '__main__':
chrisklaiber /
Last active Sep 16, 2016
namedmap and tuplemap: quacks like a dict, has the memory footprint of a tuple (eh, good enough)
"""A space-efficient frozen (write-once) mapping class.
A named map has two key properties:
1. The interface is like a dict.
2. Memory usage is like an object that defines __slots__.
Call namedmap.frozennamedmap() to define a subclass, passing the name
of the type and an iterable of key names.
chrisklaiber / Analysis Scaffold.ipynb
Last active Aug 29, 2015
Analyzing Deferred JavaScript with
View Analysis Scaffold.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
chrisklaiber /
Created Aug 30, 2012
Convert an image to drawing instructions
Convert an image to drawing instructions.
* PIL, the Python Imaging Library
This basically write color values for each pixel, with minor cleverness to
reduce output size: