Skip to content

Instantly share code, notes, and snippets.

Avatar

Simon Willison simonw

View GitHub Profile
@simonw
simonw / Datasette and Pandas.ipynb
Created Jul 17, 2020
Using Datasette with Pandas
View Datasette and Pandas.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simonw
simonw / UK power outages.ipynb
Created Jul 14, 2020
How to create a SQLite database of UK power outages using sqlite-utils
View UK power outages.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@simonw
simonw / datasette-auth-passwords-heroku.md
Last active Jul 13, 2020
Publishing a private Datasette instance to Heroku using datasette-auth-passwords
View datasette-auth-passwords-heroku.md

Publishing a private Datasette instance to Heroku using datasette-auth-passwords

Using this new plugin: https://github.com/simonw/datasette-auth-passwords

Create your database as usual, then create a metadata.json file that looks like this:

{
    "allow": {
        "id": "root"
    }
@simonw
simonw / create-db.sh
Created Jul 6, 2020
Create a SQLite database (for use with Datasette) of SBA loans from https://sba.app.box.com/s/tvb0v5i57oa8gc6b5dcm9cyw7y2ms6pp
View create-db.sh
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 / macos-machine-learning-models.md
Created May 21, 2020
Machine learning models installed on macOS is part of Vision.framework
View macos-machine-learning-models.md

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 / ubuntu-python-upgrade.md
Created Mar 28, 2020
How to run Python 3.7 on Ubuntu 16.04
View ubuntu-python-upgrade.md
@simonw
simonw / readme.md
Created Mar 26, 2020
Making a Datasette of Finnish coronavirus data
View readme.md
View Convert Datasette RST changelog to GFM for releases.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View datasette-requirements.txt
datasette
sqlite-utils
sqlite-transform
csvs-to-sqlite
geojson-to-sqlite
socrata2sql
datasette-cluster-map
datasette-vega
datasette-json-html
datasette-jellyfish
View datasette.service
# 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=...
You can’t perform that action at this time.