Skip to content

Instantly share code, notes, and snippets.

@studiotomi
studiotomi / gist:d25e7dbe42a6019fdc08
Created June 19, 2015 15:36
Work on Chunks of an array
def chunks(l, n):
""" Yield successive n-sized chunks from l.
http://stackoverflow.com/a/312464/1572077
"""
for i in xrange(0, len(l), n):
yield l[i:i+n]
@phrawzty
phrawzty / 2serv.py
Last active November 10, 2024 16:32
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):