Skip to content

Instantly share code, notes, and snippets.


Pete Fein wearpants

View GitHub Profile
wearpants /
Last active Mar 27, 2017
groupby file scraper
from itertools import groupby
import csv
def parse(self, response):
with open(self.csv_file) as f:
rows = csv.DictReader(f)
for source, group in groupby(rows, lambda r: r.get('Source Url')):
meta = {

Keybase proof

I hereby claim:

  • I am wearpants on github.
  • I am wearpants ( on keybase.
  • I have a public key whose fingerprint is A38C C3FE C7A3 9977 3114 72EA 9CE9 978F FDF3 2315

To claim this, I am signing this object:

View nginx
uwsgi_cache_path /var/www/catapp/CACHE keys_zone=CACHE:10m;
server {
listen 80;
location /static {
alias /var/www/catapp/STATIC;
#!/usr/bin/env python
"""input: blocks output: (domain_name, count)"""
from mrjob.job import MRJob
import re
# a good enough regex for matching IP addresses
ip_re = re.compile(r"""^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$""")