$ pip install dc-campaign-finance-data
Downloading/unpacking dc-campaign-finance-data
...
$ dc-campaign-finance-data
Usage: dc-campaign-finance-data [OPTIONS] COMMAND [ARGS]...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ http POST http://www.opendatadc.org/api/3/action/resource_update 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http POST http://www.opendatadc.org/api/3/action/resource_update --form id=4010146d-bf4f-4c42-a838-20a1ab86945e upload@contributions.csv url=http://www.opendatadc.org/dataset/campaign-finance/resource/4010146d-bf4f-4c42-a838-20a1ab86945e Authorization:7f99fd94-9f17-4a34-83b0-95d22aa0b0b7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [11]: headers | |
Out[11]: | |
{'Authorization': '7f99fd94-****', | |
'Content-Type': 'application/x-www-form-urlencoded'} | |
In [12]: url | |
Out[12]: 'http://www.opendatadc.org/api/3/action/resource_delete' | |
In [13]: requests.post(url, 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"}}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==> Downloading https://downloads.sourceforge.net/project/inkscape/inkscape/0.48.4/inkscape-0.48.4.tar.gz | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
phpinfo() | |
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=/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python3 shelve_test.py | |
Opening handle | |
No cached results, calling function | |
outside function | |
Opening handle | |
Traceback (most recent call last): | |
File "shelve_test.py", line 46, in <module> | |
other_expensive_calculation() | |
File "shelve_test.py", line 29, in wrapper | |
_check_cache(c, key, user_function, args, kwds) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shelve | |
import functools | |
def cache(filename): | |
def decorating_function(user_function): | |
def wrapper(*args, **kwds): | |
key = str(hash(functools._make_key(args, kwds, typed=False))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3 | |
ADD . /code/ | |
WORKDIR /code/ | |
# ENV LANG C.UTF-8 if this is uncluded, no error | |
RUN python open_file.py |
Sets a cloudflare subdomain to your IP every 15 minutes.
$ brew install jq
$ crontab -e
# add this ->
30 * * * * /Users/canada/Documents/update-ip.sh