Skip to content

Instantly share code, notes, and snippets.

@henryjameslau
henryjameslau / tile-server.sh
Created April 16, 2020 14:37
Launch live-server with middleware with gzip content encoding
#!/bin/bash
# bash script to set up a gzip js as middleware for live-server
if test -f gzip.js; then
echo "gzip.js exists, launching live-server"
live-server --middleware="${PWD}/gzip.js"
else
echo "module.exports = function(req, res, next) {
if (req.url.endsWith('.pbf')) {
next();
res.setHeader('Content-Encoding', 'gzip');
@henryjameslau
henryjameslau / .block
Created April 8, 2020 09:28
Fill patterns
license: mit
@henryjameslau
henryjameslau / .block
Last active April 8, 2020 09:34
Fill patterns
license: mit
@henryjameslau
henryjameslau / .block
Last active March 3, 2020 12:24
Everything you need to make a tooltip with d3-delaunay
license: mit
@henryjameslau
henryjameslau / .block
Last active August 13, 2019 21:01
Tween position of d3-annotation
license: mit
@henryjameslau
henryjameslau / .block
Created August 13, 2019 20:28
fresh block
license: mit
@henryjameslau
henryjameslau / .block
Last active May 29, 2019 15:03
Welfare spending
license: mit
---
title: "Travel time wales"
output: html_notebook
---
```{r}
library("propeR")
library("progress")
library("MASS")
@henryjameslau
henryjameslau / nearest-road.py
Last active May 17, 2019 14:33
Find nearest road
import csv
import requests
from itertools import islice
import pandas as pd
import numpy as np
import os
from tqdm import tqdm
filepath = 'destination.csv'
@henryjameslau
henryjameslau / config.json
Last active May 13, 2019 20:01
Odd's ratio
{
"essential" : {
"graphic_data_url": "data.csv",
"colour_palette": [ "#274796"],
"negative_colour":["#D32F2F"],
"sourceText":["Labour Market Statistics, February 2015, Table A02"],
"sourceURL":["http://www.ons.gov.uk/ons/publications/re-reference-tables.html?edition=tcm%3A77-350752"],
"annotationChart": [