Skip to content

Instantly share code, notes, and snippets.


Saul Shanabrook saulshanabrook

View GitHub Profile
saulshanabrook /
Last active Aug 29, 2015
Artwork Names and Descriptions from PP

For my art history class, my teacher gave me a large PP with a slide for each artwork we needed to learn, so that I could use upload the images plus the artwork identifications and classifications to Memrise for virtual study cards.

I grew tired of copying the two lines from each slide, so I decided to try to parse the PP in python to export a list of artwork IDs and classifications. For example, here El Greco I wanted the output to be El Greco: Mannerism.

I found out that a .ppx file is really just a .zip, so once I extracted the PP it was easy to find the slide files, which were all .xml.

saulshanabrook /
Last active Aug 29, 2015
Prolific Genetic Programers
from collections import namedtuple
Parents = namedtuple('Parents', ['mother', 'father'])
from itertools import zip_longest
from collections import Counter, abc
class FrozenCounter(Counter):
saulshanabrook / trial
Created Jun 16, 2014
Open Data DC API Data Upload
View trial
$ http POST id=4010146d-bf4f-4c42-a838-20a1ab86945e id=techforelissa Authorization:4010146d-****
HTTP/1.1 404 Not Found
Access-Control-Allow-Headers: X-CKAN-API-KEY, Authorization, Content-Type
Access-Control-Allow-Methods: POST, PUT, GET, DELETE, OPTIONS
Access-Control-Allow-Origin: *
Cache-Control: no-cache
Content-Length: 441
Content-Type: application/json;charset=utf-8
Date: Mon, 16 Jun 2014 18:43:28 GMT
Pragma: no-cache
saulshanabrook / .sh
Created Jun 17, 2014
Post to OpenData DC
View .sh
http POST --form id=4010146d-bf4f-4c42-a838-20a1ab86945e upload@contributions.csv url= Authorization:7f99fd94-9f17-4a34-83b0-95d22aa0b0b7
saulshanabrook / cant-delete-resource
Created Jun 18, 2014
Delete Resource from OpenData DC
View cant-delete-resource
In [11]: headers
{'Authorization': '7f99fd94-****',
'Content-Type': 'application/x-www-form-urlencoded'}
In [12]: url
Out[12]: ''
In [13]:, headers=headers, data=json.dumps({'id': 'b0f4af1f-fbd4-45a6-82cd-86fab9140038'})).text
Out[13]: u'{"help": "Delete a resource from a dataset.\\n\\n You must be a sysadmin or the owner of the resource to delete it.\\n\\n :param id: the id of the resource\\n :type id: string\\n\\n ", "success": false, "error": {"message": "Access denied", "__type": "Authorization Error"}}'
View brew install -v inkscape 2>&1
==> Downloading
Already downloaded: /Library/Caches/Homebrew/inkscape-0.48.4.tar.gz
==> Verifying inkscape-0.48.4.tar.gz checksum
tar xf /Library/Caches/Homebrew/inkscape-0.48.4.tar.gz
==> ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/inkscape/0.48.4 --enable-lcms --disable-poppler-cairo
checking build system type... i386-apple-darwin13.2.0
checking host system type... i386-apple-darwin13.2.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
saulshanabrook / $_php_-i
Last active Aug 29, 2015
paddle8 issue #78 cant save user
View $_php_-i
PHP Version => 5.5.14
System => Darwin HP-520.local 13.3.0 Darwin Kernel Version 13.3.0: Tue Jun 3 21:27:35 PDT 2014; root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
Build Date => Jul 2 2014 13:35:41
Configure Command => './configure' '--prefix=/usr/local/Cellar/php55/5.5.14' '--localstatedir=/usr/local/var' '--sysconfdir=/usr/local/etc/php/5.5' '--with-config-file-path=/usr/local/etc/php/5.5' '--with-config-file-scan-dir=/usr/local/etc/php/5.5/conf.d' '--with-iconv-dir=/usr' '--enable-dba' '--with-ndbm=/usr' '--enable-exif' '--enable-soap' '--enable-wddx' '--enable-ftp' '--enable-sockets' '--enable-zip' '--enable-shmop' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-mbstring' '--enable-mbregex' '--enable-bcmath' '--enable-calendar' '--with-zlib=/usr/local/opt/zlib' '--with-ldap' '--with-ldap-sasl=/usr' '--with-xmlrpc' '--with-kerberos=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-freetype-dir=/usr/local/opt/freetype' '--with-jpeg-dir=/usr/local/opt/jpeg' '--with-png-dir=/
saulshanabrook /
Created Jul 2, 2014
macdown gif not jumping



$ pip install dc-campaign-finance-data
Downloading/unpacking dc-campaign-finance-data
$ dc-campaign-finance-data
Usage: dc-campaign-finance-data [OPTIONS] COMMAND [ARGS]...
$ python3
Opening handle
No cached results, calling function
outside function
Opening handle
Traceback (most recent call last):
File "", line 46, in <module>
File "", line 29, in wrapper
_check_cache(c, key, user_function, args, kwds)
You can’t perform that action at this time.