Skip to content

Instantly share code, notes, and snippets.


Elizabeth Leddy eleddy

View GitHub Profile
eleddy /
Created Nov 8, 2012
Noisebridge PyClass Homework
import urllib2
from lxml.html import fromstring
import json
def collate_data():
print "beginning collating..."
# get the list of users from noisebridge wiki
# and put them in a dictionary with userid as key
eleddy / dictionaries.ipynb
Created Nov 29, 2012
Noisebridge Python class on dictionaries - ipython notebook export
View dictionaries.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Tutorial at
Data at
Key Points:
- requires: sqlalchemy, psycopg2
- Setting up new database and user
- Difference between sql, postgres, sqlite
- Sqlite and timezones
- Connecting to the DB and DSNs
eleddy /
Created Jun 6, 2013
Get stats for plone commits from ohloh
#! /usr/bin/python
from lxml import html
import datetime
import requests
from collections import defaultdict
def parse(html_string, impact=None):
eleddy /
Created Jun 6, 2013
Get statistics on the health of plone mailing lists
#! /bin/python
import urllib2
import csv
import datetime
import math
class GmaneListStats(object):
def __init__(self, what_is_recent=30, group='gmane.comp.web.zope.plone.devel'):
from django.db import models
from import USStateField, PhoneNumberField
def save_area(instance, file_name):
return "photos/%s/%s/%s" % (instance.area.state,, file_name)
# WAT is this? if this is about using nice urls then use url routing instead
def save_problem(instance, file_name):
return "photos/%s/%s/%s/%s" % (instance.problem.parent.state,,, file_name)
eleddy /
Created Jun 26, 2013
Noisebridge class - add your favorite game
class Toy(object):
inventory = 0
def __init__(self, price, name, quantity):
self.price = price = name
self.quantity = quantity
View mysite.conf
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*) https://%1$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^mysubdomain\.mysite\.com
RewriteRule ^/(.*)${SERVER_NAME}:%{SERVER_PORT}/subdomain/VirtualHostRoot/$1 [L,P]