Skip to content

Instantly share code, notes, and snippets.

View ondrae's full-sized avatar

Andrew Hyder ondrae

View GitHub Profile
@ondrae
ondrae / export_repo_issues_to_csv.py
Last active July 24, 2018 04:43 — forked from unbracketed/export_repo_issues_to_csv.py
Export Issues from Github repo to CSV (API v3)
"""
Exports Issues from a specified repository to a CSV file
Uses basic authentication (Github username + password) to retrieve Issues
from a repository that username has access to. Supports Github API v3.
"""
import csv
import requests
@ondrae
ondrae / gist:93ed5091bb546b1aa850
Created February 27, 2015 18:41
service census settings.json
{
"configUrl": "https://docs.google.com/a/codeforamerica.org/spreadsheet/ccc?key=0ArHmv-6U1drqdGZRSjBIdGFGOEVodWZManpGUW1TS3c#gid=0",
"censusid": "service-census",
"approve_first_submission": "FALSE",
"anonymous_submissions": "TRUE",
"google": {
"user": "andrewh@codeforamerica.org",
"password": my real password that i use which makes me nervous,
"app_id" : my google app id,
"app_secret" : my google app secret
@ondrae
ondrae / gist:e2b04f4a00156f93a1ef
Created September 22, 2014 16:46
Featured Issues
list of featured issues
https://github.com/jasonlally/housing-policy-hub/issues/21
https://github.com/Code-for-Miami/MDBudgetviz/issues/21
https://github.com/codeforamerica/ohana-web-search/issues/518
https://github.com/codeforamerica/cfapi/issues/140
https://github.com/codeforamerica/bizfriendly-web/issues/151
https://github.com/codeforamerica/bizfriendly-web/issues/172
https://github.com/codeforamerica/ohana-web-search/issues/572
https://github.com/sfbrigade/sfbrigade.github.io/issues/3
https://github.com/CodeForPortland/ideas/issues/6
@ondrae
ondrae / feeds.py
Last active August 29, 2015 13:56 — forked from ksamuel/feeds.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4
"""
Tools to extract feed links, test if they are valid and parse them
with feedparser, returning content or a proper error.
"""
OAuth::Unauthorized
401 Unauthorized
Rails.root: /Users/hackyourcity/Repos/follow-all
Application Trace | Framework Trace | Full Trace
oauth (0.4.7) lib/oauth/consumer.rb:216:in `token_request'
oauth (0.4.7) lib/oauth/consumer.rb:136:in `get_request_token'
omniauth-oauth (1.0.1) lib/omniauth/strategies/oauth.rb:29:in `request_phase'
omniauth-twitter (1.0.1) lib/omniauth/strategies/twitter.rb:60:in `request_phase'
@ondrae
ondrae / get_new_trello_board.py
Last active December 22, 2015 06:49
This gist grabs the newest Trello board a user has created. Generate your own key at https://trello.com/c/jObnWvl1/25-generating-your-developer-key Get a users auth_token by following these instructions https://trello.com/docs/gettingstarted/index.html#getting-a-token-from-a-user Before I got that sort function working I had a nasty 18 line trip…
import requests
api_key = ''
auth_token = ''
response = requests.get('https://trello.com/1/member/me/boards?fields=id,name,dateLastView&key='+api_key+'&token='+auth_token)
boards = response.json()
boards.sort(key=lambda board : board["dateLastView"], reverse=True)
the_new_resource = boards.pop(0)
@ondrae
ondrae / iso_code_mappings
Created October 31, 2012 00:38
Python functions to translate between iso2 and iso3 codes.
def get_iso3_code(iso2):
iso_codes = {'AF':'AFG','AX':'ALA','AL':'ALB','DZ':'DZA','AS':'ASM','AD':'AND','AO':'AGO','AI':'AIA','AQ':'ATA','AG':'ATG','AR':'ARG','AM':'ARM','AW':'ABW','AU':'AUS','AT':'AUT','AZ':'AZE','BS':'BHS','BH':'BHR','BD':'BGD','BB':'BRB','BY':'BLR','BE':'BEL','BZ':'BLZ','BJ':'BEN','BM':'BMU','BT':'BTN','BO':'BOL','BA':'BIH','BW':'BWA','BV':'BVT','BR':'BRA','IO':'IOT','BN':'BRN','BG':'BGR','BF':'BFA','BI':'BDI','KH':'KHM','CM':'CMR','CA':'CAN','CV':'CPV','KY':'CYM','CF':'CAF','TD':'TCD','CL':'CHL','CN':'CHN','CX':'CXR','CC':'CCK','CO':'COL','KM':'COM','CG':'COG','CD':'COD','CK':'COK','CR':'CRI','CI':'CIV','HR':'HRV','CU':'CUB','CY':'CYP','CZ':'CZE','DK':'DNK','DJ':'DJI','DM':'DMA','DO':'DOM','EC':'ECU','EG':'EGY','SV':'SLV','GQ':'GNQ','ER':'ERI','EE':'EST','ET':'ETH','FK':'FLK','FO':'FRO','FJ':'FJI','FI':'FIN','FR':'FRA','GF':'GUF','PF':'PYF','TF':'ATF','GA':'GAB','GM':'GMB','GE':'GEO','DE':'DEU','GH':'GHA','GI':'GIB','GR':'GRC','GL':'GRL','GD':'GRD','GP':'GLP','GU':'GUM','GT':'GTM','GG':'