This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
import random | |
from itertools import izip_longest | |
import redis | |
securerandom = random.SystemRandom() | |
r = redis.StrictRedis(host='localhost', port=6379, db=0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17:01:13 fastworker.1 | INFO:mirror.stateful queue='celery' task='mirror.tasks.trigger_db_sweep_all' measure#hc.queue.celery.latency=0.002525 task_id='83f0c015-ca69-4176-91d5-a8db2af33d35' count#hc.queue.celery.tasks=1 count#hc.task.mirror.tasks.trigger-db-sweep-all.count=1 pid=36484 event='prerun starting' | |
17:01:13 fastworker.1 | INFO:mirror.stateful task='mirror.connection.tasks.SweepTriggerLogTask' task_id='250d2bbe-20fd-40fd-af32-b62ec60a6fc5' created_at='2015-09-28T21:01:13.223918+00:00' pid=36484 event='task created' | |
17:01:13 fastworker.1 | INFO:mirror.stateful task='mirror.tasks.trigger_db_sweep_all' task_id='83f0c015-ca69-4176-91d5-a8db2af33d35' pid=36484 measure#hc.queue.celery.duration=13.378143310546875 measure#hc.task.mirror.tasks.trigger-db-sweep-all.duration=13.378143310546875 event='task done' | |
17:01:13 aggregation.1 | INFO:mirror.stateful count#hc.queue.aggregation.tasks=1 queue='aggregation' task='mirror.connection.tasks.SweepTriggerLogTask' task_id='250d2bbe-20fd-40fd-af32-b62ec60a6fc5' me |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am lambacck on github. | |
* I am lambacck (https://keybase.io/lambacck) on keybase. | |
* I have a public key whose fingerprint is 7750 D31A A267 06BF 9698 4186 94DE 56FD D74E 5D78 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
searchpath='.' | |
if [ $# -gt 0 ]; then | |
searchpath=$1 | |
shift 1 | |
fi | |
searchterm="-e container-fluid -e row-fluid -e 'span\\d{1,2}' -e 'offset\\d{1,2}' -e brand* -e navbar -e nav -e hero-unit -e icon* -e btn -e btb-mini -e btn-small -e btn-large -e visible-phone -e visible-tablet -e visible-desktop -e hidden-phone -e hidden-tablet -e hidden-desktop -e input-prepend -e input-append -e add-on -e btn-navbar -e thumbnail" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import codecs | |
class UTF8Recoder(object): | |
""" | |
Iterator that reads an encoded stream and reencodes the input to UTF-8 | |
""" | |
def __init__(self, f, encoding): | |
self.reader = codecs.getreader(encoding)(f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Files] | |
Source: "python-2.6.msi"; DestDir: "{tmp}" | |
Source: "setuptools-0.6c11.win32-py2.6.exe"; DestDir: "{tmp}" | |
[Run] | |
Filename: "msiexec.exe"; Parameters: "/i ""{tmp}\python-2.6.msi""" | |
Filename: "setuptools-0.6c11.win32-py2.6.exe"; Parameters: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Echo client program | |
import socket | |
HOST = 'localhost' # The remote host | |
PORT = 50007 # The same port as used by the server | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.connect((HOST, PORT)) | |
s.send(b'Hello, world') | |
data = s.recv(1024) | |
s.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import random | |
import webbrowser | |
def newone(): | |
target = random.randrange(3, 483) | |
url = 'http://us.pycon.org/2012/review/%s/' % target | |
webbrowser.open(url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cProfile import Profile | |
profiler = Profile() | |
def write_chains(): | |
chain_count = 0 | |
for chain in chains: | |
chain_count += 1 | |
print chain_count | |
if chain_count == 2305838: | |
profiler.enable() |