Skip to content

Instantly share code, notes, and snippets.

View simonw's full-sized avatar

Simon Willison simonw

View GitHub Profile
@simonw
simonw / darkflow-osx.md
Last active July 22, 2023 19:05
How I got darkflow working on my OS X Laptop

How I got darkflow working on my OS X Laptop

Darkflow is a Python 3 tool that makes the Darknet open source neural networks available in Python using Tensorflow.

Here's how I got it working on my laptop:

cd /tmp
git clone https://github.com/thtrieu/darkflow
cd darkflow

virtualenv --python=python3 .venv

@simonw
simonw / pony.md
Created December 18, 2017 21:47
How to compile and run a Pony program using Docker

How to compile and run a Pony program using Docker

Create a /tmp/helloworld directory and put the following in main.pony:

actor Main
  new create(env: Env) =>
    env.out.print("Hello, world!")

Now compile it like this (the Docker image will be downloaded if necessary):

@simonw
simonw / spatialite-support.md
Created December 13, 2017 17:59
Query to see what SpatiaLite features are supported
select spatialite_version(), spatialite_target_cpu( ), proj4_version( ), geos_version( ), lwgeom_version( ), libxml2_version( ), HasIconv( ), HasMathSQL( ), HasGeoCallbacks( ), HasProj( ), HasGeos( ), HasGeosAdvanced( ), HasGeosTrunk( ), HasLwGeom( ), HasLibXML2( ), HasEpsg( ), HasFreeXL( ), HasGeoPackage( );

e.g. https://timezones-api.now.sh/timezones-4fbc08f?sql=select+spatialite_version%28%29%2C+spatialite_target_cpu%28+%29%2C+proj4_version%28+%29%2C+geos_version%28+%29%2C+lwgeom_version%28+%29%2C+libxml2_version%28+%29%2C+HasIconv%28+%29%2C+HasMathSQL%28+%29%2C+HasGeoCallbacks%28+%29%2C+HasProj%28+%29%2C+HasGeos%28+%29%2C+HasGeosAdvanced%28+%29%2C+HasGeosTrunk%28+%29%2C+HasLwGeom%28+%29%2C+HasLibXML2%28+%29%2C+HasEpsg%28+%29%2C+HasFreeXL%28+%29%2C+HasGeoPackage%28+%29%3B

@simonw
simonw / vice-news-police-shootings-datasette.md
Last active January 5, 2018 16:35
VICE News Police Shootings data with Datasette
@simonw
simonw / datasettes-osx.md
Last active June 19, 2018 18:42
Some interesting datasettes on OS X

Not sure what these are:

datasette ~/Library/Suggestions/*.db

Safari stuff:

datasette ~/Library/Safari/*.db

Your desktop background:

@simonw
simonw / datasette-polar-bears.md
Last active January 17, 2022 21:16
Datasette for Polar Bears
@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 / 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 / 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 / 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,