Skip to content

Instantly share code, notes, and snippets.

View simonw's full-sized avatar

Simon Willison simonw

View GitHub Profile
@simonw
simonw / datasette.service
Last active December 4, 2019 17:47
Files I use to run Datasette under systemd, inspired by https://github.com/simonw/datasette/issues/514#issuecomment-504662904
# This file lives in /etc/systemd/system/datasette.service
[Unit]
Description=Datasette
After=network.target
[Service]
Type=simple
User=ubuntu
Environment=GITHUB_CLIENT_ID=...
Environment=GITHUB_CLIENT_SECRET=...
datasette
sqlite-utils
sqlite-transform
csvs-to-sqlite
geojson-to-sqlite
socrata2sql
datasette-cluster-map
datasette-vega
datasette-json-html
datasette-jellyfish
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simonw
simonw / readme.md
Created March 26, 2020 16:16
Making a Datasette of Finnish coronavirus data
@simonw
simonw / ubuntu-python-upgrade.md
Created March 28, 2020 19:45
How to run Python 3.7 on Ubuntu 16.04
@simonw
simonw / macos-machine-learning-models.md
Created May 21, 2020 15:46
Machine learning models installed on macOS is part of Vision.framework

Machine learning models installed on macOS is part of Vision.framework

I found these while poking around at the list of open files for photoanalysisd in Activity Monitor.

% ls -lahS /System/Library/Frameworks/Vision.framework/Versions/A/Resources
total 465616
-rw-r--r--    1 root  wheel    40M Dec 13 16:32 landmarks_v2.bin
-rw-r--r--    1 root  wheel    31M Dec 13 16:32 scenenet_sc2.4_sa1.4_ae1.4_r9_opt_int8.espresso.weights
-rw-r--r--    1 root  wheel    29M Dec 13 16:32 scenenet_sc2.4_sa1.4_ae1.6_r13.4_opt_int8_asymetric.espresso.weights
@simonw
simonw / create-db.sh
Created July 6, 2020 22:10
Create a SQLite database (for use with Datasette) of SBA loans from https://sba.app.box.com/s/tvb0v5i57oa8gc6b5dcm9cyw7y2ms6pp
sqlite-utils insert /tmp/loans.db foia_150k_plus --csv '150k plus/foia_150k_plus.csv'
sqlite-utils insert /tmp/loans.db foia_up_to_150k_AL --csv 'Alabama/foia_up_to_150k_AL.csv'
sqlite-utils insert /tmp/loans.db foia_up_to_150k_AK --csv 'Alaska/foia_up_to_150k_AK.csv'
sqlite-utils insert /tmp/loans.db foia_up_to_150k_AS --csv 'American Samoa/foia_up_to_150k_AS.csv'
sqlite-utils insert /tmp/loans.db foia_up_to_150k_AZ --csv 'Arizona/foia_up_to_150k_AZ.csv'
sqlite-utils insert /tmp/loans.db foia_up_to_150k_AR --csv 'Arkansas/foia_up_to_150k_AR.csv'
sqlite-utils insert /tmp/loans.db foia_up_to_150k_CA --csv 'California/foia_up_to_150k_CA.csv'
sqlite-utils insert /tmp/loans.db foia_up_to_150k_CO --csv 'Colorado/foia_up_to_150k_CO.csv'
sqlite-utils insert /tmp/loans.db foia_up_to_150k_CT --csv 'Connecticut/foia_up_to_150k_CT.csv'
sqlite-utils insert /tmp/loans.db foia_up_to_150k_DE --csv 'Delaware/foia_up_to_150k_DE.csv'
@simonw
simonw / datasette-auth-passwords-heroku.md
Last active July 13, 2020 20:57
Publishing a private Datasette instance to Heroku using datasette-auth-passwords
@simonw
simonw / UK power outages.ipynb
Created July 14, 2020 17:17
How to create a SQLite database of UK power outages using sqlite-utils
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simonw
simonw / Datasette and Pandas.ipynb
Created July 17, 2020 20:25
Using Datasette with Pandas
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.