Skip to content

Instantly share code, notes, and snippets.

def wh_geocode():
import requests
url = "http://rpc.geocoder.us/service/csv?address=1600+Pennsylvania+Ave,+Washington+DC"
r = requests.get(url).content
return r.split(",")
@rdhyee
rdhyee / args_kwargs.ipynb
Created July 3, 2014 17:18
I needed to remind myself how to handle possibly unexpected keyword arguments in Python 2
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rdhyee
rdhyee / docker_images.txt
Created July 29, 2014 00:54
output from running Dockerfile in https://github.com/dexy/repro-demo
ubuntu@ip-172-30-2-96:~/repro-demo$ sudo docker images
sudo: unable to resolve host ip-172-30-2-96
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
repro/dexy latest 21d9af2ecf61 2 minutes ago 1.274 GB
ubuntu 14.04 ba5877dc9bec 7 days ago 192.7 MB
busybox latest a9eb17255234 7 weeks ago 2.433 MB
@rdhyee
rdhyee / docker
Created August 25, 2014 16:36
default /etc/default/docker in ubuntu 14.04 after running https://get.docker.io/ on AWS + ubuntu 14.04
# Docker Upstart and SysVinit configuration file
# Customize location of Docker binary (especially for development testing).
#DOCKER="/usr/local/bin/docker"
# Use DOCKER_OPTS to modify the daemon startup options.
#DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
# If you need Docker to use an HTTP proxy, it can also be specified here.
#export http_proxy="http://127.0.0.1:3128/"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rdhyee
rdhyee / keybase.md
Created December 23, 2014 18:07
proof for my identity on keybase.io

Keybase proof

I hereby claim:

  • I am rdhyee on github.
  • I am rdhyee (https://keybase.io/rdhyee) on keybase.
  • I have a public key whose fingerprint is 78E8 E8E8 B007 206C 2A5D 9C83 AA61 D643 ECB4 CD2D

To claim this, I am signing this object:

@rdhyee
rdhyee / spark_docker_mesos.md
Created January 17, 2015 17:03
What I'm planning to work on during the Data Science / Docker hackday at Wise.io (2015.01.18)

This is pretty much what I had intended to work on. Specifically I'd like to get the docker images that package up spark in the ipython/scipyserver docker image (https://github.com/rdhyee/ipython-spark/blob/master/Dockerfile) to run on a Mesos cluster. Of relevance is a Spark PR that seems almost ready to go: apache/spark#3074 (combined with https://issues.apache.org/jira/browse/SPARK-2691). If we get the basics working, I'd love to work such integration with https://github.com/rgbkrk/cloudpipe, which I understand to be a hybrid of http://www.multyvac.com/ (I loved its predecessor: picloud) + tmpnb (https://lambdaops.com/ipythonjupyter-tmpnb-debuts/). Wonderful to be able to let people spin up a temporary Jupyter notebook that can run Spark and also be based on an arbitrary docker image.

@rdhyee
rdhyee / docker_alias.sh
Created February 6, 2015 21:48
docker related alias for working with boot2docker or docker in general (docker_rm, docker_rmi)
# docker aliases
alias docker_rmi='docker images -a -q -f "dangling=true" --no-trunc | xargs docker rmi'
alias docker_rm='docker ps -a -q --no-trunc | xargs docker rm'
alias docker_time='boot2docker ssh sudo ntpclient -s -h pool.ntp.org'
@rdhyee
rdhyee / github_deploy_key.py
Created February 13, 2015 03:51
first pass at an Ansible module to create a deploy key....work in progress
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Raymond Yee <raymond.yee@gmail.com>
import os
import json
import base64
from StringIO import StringIO
@rdhyee
rdhyee / pg2701.rdf
Created February 18, 2015 23:52
The Project Gutenberg RDF file for Moby Dick http://www.gutenberg.org/ebooks/2701
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xml:base="http://www.gutenberg.org/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:pgterms="http://www.gutenberg.org/2009/pgterms/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:dcam="http://purl.org/dc/dcam/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
>
<cc:Work rdf:about="">