Skip to content

Instantly share code, notes, and snippets.

# encoding: utf-8
import re
import csv
import sys
out_file = csv.writer(sys.stdout)
c = csv.reader(sys.stdin, delimiter=',')
def per_hour_to_annum(value):
value = value*40*52
@symroe
symroe / fmt_to_json.py
Created September 7, 2011 21:18
FMT to JSON
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Written in reply to this post on the mySociety mailing list:
https://secure.mysociety.org/admin/lists/pipermail/developers-public/2011-September/007570.html
Can be deployed somewhere if someone would just like to get some JSON back from
an HTTP request, just contact me here or @symroe on twitter.
@symroe
symroe / gist:1341890
Created November 5, 2011 19:07
The Public Whip / TWFY to Dodds (parlement.uk) ID mapping
dodds_id, public_whip_id, bio_id
33606,11589,1594
30771,11360,1171
33616,10679,655
33617,11402,1596
25602,10682,473
25603,10955,1220
25604,10275,None
25605,10323,None
25606,10324,None
Name Stmts Miss Cover Missing
-------------------------------------------------------------------------------
activities.actions 147 88 40% 16-29, 34, 37, 51, 55, 59-65, 89-114, 118-144, 158, 165, 169-208, 217-235, 249, 252-274, 281, 297, 308-330, 334, 337, 341-433
activities.exceptions 4 4 0% 1-5
activities.forms 5 3 40% 8-11
activities.loading 32 10 69% 10, 15-32, 51, 62, 68, 77
activities.managers 21 18 14% 5-13, 17-33, 47-53
activities.middleware 4 0 100%
activities.models 42 34 19% 16-41, 52, 56, 62-91
activities.sessions 28 5 82% 1-4, 26, 36, 48
@symroe
symroe / gist:2714490
Created May 16, 2012 22:22
Get list member usernames for a given list
import json
import urllib2
import urllib
class ListMemeberParser():
"""
Given a twitter username and list slug, return the members of that list.
"""
def __init__(self, twitter_name, list_slug):
@symroe
symroe / gist:3373724
Created August 16, 2012 21:16
Andy Lulham

Contact Details

  • Address: The Stables, Wilbury Grove, Hove BN3 3JQ
  • Telephone: 07729 454331
  • Email: a.lulham@gmail.com

Work Experience

2012-Present Freelance Web DeveloperElectric Putty, Hove

  • Electric Putty is a small web design agency working primarily with the third sector
We are looking for someone who understands a typical medium size django stack
(django, postgresql, celery, south, redis, PIL, and various other python libs)
and can turn that in to a high scale production ready environment.
Of course they will decide on the best infrastructure, however it's estimated
that we'll need more than one database server and a couple of load balanced
front end / cache servers.
We will also need an identical stage setup, so a server configuration tool like
puppet would be useful. Again, we would follow the advise of the person doing
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<g
transform="matrix(10.583829,0,0,-10.583829,240.22523,6542.2537)"
id="layer1-2"
inkscape:label="Layer 1">
<g
style="fill:#00aced;fill-opacity:1;stroke:none"
"""
Converts google latitude backup json files to CSV files.
Usage:
python convert.py < latitude.json > latitude.csv
"""
import sys
import json
import csv
**cloud.profile**
example_medium_minion:
provider: ec2
image: ami-7b62730f
size: Medium Instance
grains:
securitygroup:
- default