Skip to content

Instantly share code, notes, and snippets.

@rdhyee
rdhyee / tl_2010_06001_tract10_4ps.topo.json
Created April 7, 2014 23:04
topojson for Alameda County census tracts for 2010 (simplified)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rdhyee
rdhyee / qis.yml
Created April 12, 2014 01:26
ansible playbook for installing QGIS on Ubuntu 12.04LTS
- hosts: vagrant_local
sudo: true
pre_tasks:
- name: check apt last update
stat: path=/var/cache/apt
register: apt_cache_stat
- name: update apt if needed
@rdhyee
rdhyee / Vagrantfile
Last active August 29, 2015 13:59
a template Vagrantfile that adds ansible provisioning, along with accompanying ansible playbook. To run the ansible playbook: ansible-playbook -i .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory --private-key=~/.vagrant.d/insecure_private_key -u vagrant hello.yml
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@rdhyee
rdhyee / census_tracts.ipynb
Created April 23, 2014 22:35
ipython notebook for reading in shapefiles for 2010 and 2000 Census tracts for Alameda County
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rdhyee
rdhyee / bart_calc.py
Last active August 29, 2015 14:02
bart calculation
import requests
import urllib
from datetime import timedelta
from lxml.etree import fromstring
from dateutil.parser import parse
from dateutil.tz import tzlocal
from pandas import DataFrame
<feed xmlns:dcterms="http://purl.org/dc/terms/" xmlns:opds="http://opds-spec.org/"
xmlns="http://www.w3.org/2005/Atom"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.kbcafe.com/rss/atom.xsd.xml"
xsi:schemaLocation="http://purl.org/dc/elements/1.1/ http://dublincore.org/schemas/xmls/qdc/2008/02/11/dc.xsd http://purl.org/dc/terms/ http://dublincore.org/schemas/xmls/qdc/2008/02/11/dcterms.xsd">
<title>Unglue.it Catalog -- 1 to 1 of 2000 -- crawlable feed</title>
<id>https://unglue.it/opds/crawlable</id>
<updated>2014-06-16T00:00:00Z</updated>
<link rel="start" href="https://unglue.it/opds" type="application/atom+xml;profile=opds-catalog;kind=navigation" />
<link rel="self" type="application/atom+xml;profile=opds-catalog;kind=acquisition" href="https://unglue.it/opds/crawlable"/>
@rdhyee
rdhyee / packer_example.sh
Created June 15, 2014 19:26
A configuration files for creating a lightly modified AMI for ubuntu 12.04LTS
# to get my credentials in place --> to create env vars with my key/secret
source ~/ry_aws.sh
packer build \
-var aws_access_key=$AWS_ACCESS_KEY \
-var aws_secret_key=$AWS_SECRET_KEY \
packer_example_aws.json
<feed xmlns:dcterms="http://purl.org/dc/terms/" xmlns:opds="http://opds-spec.org/" xmlns="http://www.w3.org/2005/Atom" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.kbcafe.com/rss/atom.xsd.xml" xsi:schemaLocation="http://purl.org/dc/elements/1.1/ http://dublincore.org/schemas/xmls/qdc/2008/02/11/dc.xsd http://purl.org/dc/terms/ http://dublincore.org/schemas/xmls/qdc/2008/02/11/dcterms.xsd">
<title>Unglue.it Catalog: Creative Commons Books</title>
<id>http://localhost:8000/opds/creative_commons</id>
<updated>2014-07-11T21:04:18.442057+00:00</updated>
<author>
<name>unglue.it</name>
<uri>http://localhost:8000</uri>
</author>
<link href="https://unglue.it/opds" type="application/atom+xml;profile=opds-catalog;kind=navigation" rel="start"/>
<entry>
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us"><title>Latest wishbooks for rdhyee on unglue.it</title><link href="http://localhost:8000/supporter/rdhyee/feed/" rel="alternate"></link><link href="http://localhost:8000/supporter/rdhyee/feed/" rel="self"></link><id>http://localhost:8000/supporter/rdhyee/feed/</id><updated>2014-06-19T14:25:39Z</updated><entry><title>23rd Century Romance</title><link href="http://localhost:8000/work/130413" rel="alternate"></link><author><name>Jake Hartnell</name></author><id>http://localhost:8000/work/130413</id><summary type="html">23rd Century Romance</summary></entry><entry><title>Reinventing Bach</title><link href="http://localhost:8000/work/113764" rel="alternate"></link><author><name>Paul Elie</name></author><id>http://localhost:8000/work/113764</id><summary type="html">Reinventing Bach</summary></entry><entry><title>A Lector's Guide and Commentary to the Revised Common Lectionary, Year A</title><link href="http://localhost
@rdhyee
rdhyee / getting_site_in_Django.ipynb
Created June 24, 2014 21:06
One of these things that I couldn't remember how to do when away from Django for a while.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.