Skip to content

Instantly share code, notes, and snippets.

@kristaps
kristaps / package_upload_times.py
Last active January 15, 2016 13:18
Show python package PYPI upload times. Helpful when, for example, your tests start failing and you'd like to investigate what recent package updates might have caused the breakage.
#!/usr/bin/env python
from __future__ import print_function
import json
from pip.operations.freeze import freeze
import urllib
URL_TEMPLATE = "https://pypi.python.org/pypi/{pkg}/{version}/json"
@kristaps
kristaps / geocode.py
Created June 15, 2014 00:04
Google geocoder wrapper script and "library"
#!/usr/bin/env python
import urllib
import json
def geocode(address):
return json.loads(urllib.urlopen(
"http://maps.googleapis.com/maps/api/geocode/json?address=%s" % (
urllib.quote(address.encode('utf-8')))
#!/usr/bin/env python
import rabbitpy
import time
MSG_COUNT = 100
conn = rabbitpy.Connection('amqp://guest:guest@localhost/%2F?locale=en_US.UTF-8')
chan = conn.channel()
# Example of multiple threads sharing an AMQP connection
import time
import threading
import random
import argparse
import rabbitpy
INSULTS = [
'imbecile',