Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Accepting new projects & clients

Peter Fein wearpants

💭
Accepting new projects & clients
View GitHub Profile
@wearpants
wearpants / file_scraper.py
Last active Mar 27, 2017
groupby file scraper
View file_scraper.py
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 = {
View keybase.md

Keybase proof

I hereby claim:

  • I am wearpants on github.
  • I am wearpants (https://keybase.io/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;
server_name yourdomain.cat;
location /static {
alias /var/www/catapp/STATIC;
}
View bluesmote_example.py
#!/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}$""")
You can’t perform that action at this time.