Skip to content

Instantly share code, notes, and snippets.

View simonw's full-sized avatar

Simon Willison simonw

View GitHub Profile
@simonw
simonw / trees-friday-demos.ipynb
Last active August 18, 2017 19:50
San Francisco trees demo of jupyter notebook - dataset is CSV from https://data.sfgov.org/City-Infrastructure/Street-Tree-List/tkzw-k3nq
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simonw
simonw / puppeteer.ipynb
Created August 18, 2017 19:22
Using puppeteer to take screenshots from jupyter notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simonw
simonw / detected-dupes.txt
Created September 10, 2017 15:50
Duplicates detected in https://irma-api.herokuapp.com/ as of 8:49am PST 10th September 2017
Narcoossee Middle School
2700 N Narcoossee Rd, St Cloud, FL 34771
latitude=28.122861, longitude=-81.272736
Liberty High School
4250 Pleasant Hill Rd, Kissimmee, FL 34746
latitude=28.122861, longitude=-81.272736
-------
Livestock Shelter: Oconee Heritage Park
2380 Athens Hwy, Madison, GA, United States
latitude=33.6284624, longitude=-83.4531959
@simonw
simonw / comments.md
Last active October 5, 2017 15:25
Comment thread for "Implementing faceted search with Django and PostgreSQL"
@simonw
simonw / batch_indexer.py
Created October 9, 2017 17:48
Batch indexer - a mechanism for indexing documents in batches
class BatchIndexer(object):
def __init__(self, batch_size):
self.batch_size = batch_size
def __enter__(self):
self.batch = []
return self
def index(self, item):
self.batch.append(item)
@simonw
simonw / shelter_population_history.json
Created October 15, 2017 20:42
FEMA shelters in the Irma region with their populations over time, for Science Hack Day SF 2017
This file has been truncated, but you can view the full file.
[
{
"TOTAL_POPULATION": 115,
"GENERAL_POPULATION": 115,
"ORG_POC_AFTER_HOURS_PHONE": null,
"PET_ACCOMMODATIONS_CODE": null,
"FACILITY_TYPE": "SHELTER",
"COUNTY_PARISH": "MARION",
"FIPS_CODE": null,
"INCIDENT_ID": null,
@simonw
simonw / extracting-fema-shelter-history.ipynb
Created October 15, 2017 21:20
Jupyter notebook for extracting the history of shelter populations from my commit log of fema-nss.json
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simonw
simonw / requests-examples.ipynb
Created October 16, 2017 19:45
Some examples of using requests
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simonw
simonw / volumes-docker-for-mac.md
Created November 9, 2017 00:28
How to browse your volumes on Docker for Mac

How to browse your volumes on Docker for Mac

Docker for Mac runs a virtual machine on your laptop. To view the volumes, you need to attach a terminal to that virtual machine. You can do that like this:

screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty

Now the volumes can be found here:

cd /var/lib/docker/volumes

@simonw
simonw / datasette-polar-bears.md
Last active January 17, 2022 21:16
Datasette for Polar Bears