Skip to content

Instantly share code, notes, and snippets.

View psychemedia's full-sized avatar

Tony Hirst psychemedia

View GitHub Profile
@psychemedia
psychemedia / datasette_spatialite_geoquery.ipynb
Last active February 28, 2019 11:54
Simple demos of running spatialite within queries using datasette api
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@psychemedia
psychemedia / powercuts.ipynb
Created June 30, 2018 17:41
Example scraper - powercuts (yes, yes, I know the json data feed is directly available !;-)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@psychemedia
psychemedia / geofood_spatialite.ipynb
Created June 30, 2018 00:56
Example of some geo queries using spatialite and foodgovuk data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@psychemedia
psychemedia / spatialite-datasette-demo.ipynb
Last active December 17, 2025 23:59
Demo of using spatialite to sotre Ordnance Survey boundary file, serve it using datasette, plot in ipynb using folium
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@psychemedia
psychemedia / nb_sqlite_db.py
Last active December 9, 2022 22:42
Example of scraping md and code cells from Jupyter notebooks into sqlite db then doing text concordance on result
import os
def nbpathwalk(path):
''' Walk down a directory path looking for ipynb notebook files... '''
for path, _, files in os.walk(path):
if '.ipynb_checkpoints' in path: continue
for f in [i for i in files if i.endswith('.ipynb')]:
yield os.path.join(path, f)
import nbformat
@psychemedia
psychemedia / merged_notebook_doc.py
Last active May 11, 2018 12:56
Merge several Jupyter notebooks and then render them as pdf or docx
#https://stackoverflow.com/a/3207973/454773
from nbformat.v4 import new_notebook, new_markdown_cell
import nbformat
import io
import os
import subprocess
import random
import string
#from PyPDF2 import PdfFileMerger, PdfFileReader
@psychemedia
psychemedia / nblunr.html
Created May 10, 2018 17:07
Simple test of lunr search over lunr indexed Jupyter notebook markdown cells
<html><head>
<script type="application/javascript" src="assets/js/jquery-3.3.1.js"></script>
<script type="application/javascript" src="assets/js/showdown.min.js"></script>
<!--
https://markjs.io/
@psychemedia
psychemedia / Dockerfile
Last active January 25, 2021 04:57
Robotlab demo - wine in guacamole container
FROM hurricane/dockergui:x11rdp1.3
#Use an updated build
#FROM psychemedia/dockergui
#########################################
## ENVIRONMENTAL CONFIG ##
#########################################
# Set environment variables
@psychemedia
psychemedia / openlearn_ouxml_scraper.ipynb
Created April 19, 2018 11:11
Scrape OpenLearn OU-XML
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.