Skip to content

Instantly share code, notes, and snippets.

@samuelleach
samuelleach / SONOS, INC. BETA TESTER AND CONFIDENTIALITY AGREEMENT.md
Created January 3, 2018 16:42
SONOS, INC. BETA TESTER AND CONFIDENTIALITY AGREEMENT

Thank you for your interest in being a Beta tester for Sonos!

As with any Beta test program, you will be asked to agree to several conditions before you begin testing materials. Don't worry, we're not asking for much! Here's a summary of the main terms you'll be agreeing to:

You acknowledge that you are participating in a Sonos Beta program and the info you learn as a tester is confidential and cannot be shared. You confirm that information you provided in the Sonos Beta recruitment survey is accurate. You confirm that are not a member of the press, nor an employee or representative of any competitor. You agree not to disclose your role or work as a Beta tester to any member of the press, any public news group, or any third party. You agree to reasonably respond in a timely manner to Sonos’ requests for feedback. You license Sonos to freely use the feedback and suggestions you provide.

@samuelleach
samuelleach / install.md
Created May 20, 2017 20:42 — forked from iandees/install.md
Installing and running Project OSRM, the OpenStreetMap-based routing engine, on an Amazon EC2 instance.

My goal here was the create a routable graph for Chicago.

I used Ubuntu 12.04LTS on an m2.4xlarge just to be sure memory wasn't too much of an issue.

Install

Start a screen session and start downloading an OSM extract (I used this extract of Illinois). In another screen I did the following:

  sudo apt-get update && sudo apt-get upgrade -y

sudo apt-get -y install git make cmake build-essential \

@samuelleach
samuelleach / mapbox_dataeditor_terms.md
Created September 23, 2016 09:16
Mapbox data editor terms and conditions - as of 23 September 2016

By clicking "I Agree", you agree to the following terms and conditions (the "Terms"), which form a binding agreement between you and Mapbox, Inc. ("Mapbox"). IF YOU DO NOT AGREE TO THESE TERMS, YOU MAY NOT USE MAPBOX'S DATASET EDITOR.

Authority. If you are using Mapbox's dataset editor on behalf of a business, that business accepts these terms. You represent that you have the authority to bind that business to these Terms, in which case "you" will mean the business you represent.

Tracing. You may use the Mapbox dataset editor or third-party software to trace Mapbox maps and produce derivative vector datasets (i) for non-commercial purposes and (ii) for OpenStreetMap. You may also use Mapbox's dataset editor to trace Mapbox maps for commercial purposes, but may only trace up to 100 points, lines, or polygons per year. Unless expressly permitted by your Enterprise Order, you may not otherwise trace Mapbox maps or otherwise derive or extract data from Mapbox maps, including satellite imagery, nor may you permi

@samuelleach
samuelleach / index.js
Created May 3, 2016 20:21 — forked from morganherlocker/index.js
tile-reduce + cheap-ruler example
var tileReduce = require('tile-reduce');
var path = require('path');
tileReduce({
zoom: 14,
map: path.join(__dirname, '/process.js'),
sources: [
{name: 'ways', mbtiles: 'ways.mbtiles')}
]
});
@samuelleach
samuelleach / create.sh
Created April 20, 2016 21:48
Create a condo environment with R and Jupyter
conda create -n jupyter-r -c r r-irkernel r-essentials r-recommended rpy2 -y
@samuelleach
samuelleach / prep_sankey_tableau.py
Created March 9, 2016 15:21
Preparation script to create data for a Sankey diagram in Tableau. Input data is a row based and 'country' and 'sector' are two dimensions of the data.
# Preparation script to create data for a Sankey diagram in Tableau.
# Input data is a row based and 'country' and 'sector' are two dimensions of the data.
# See https://public.tableau.com/profile/samuelleach#!/vizhome/SankeyTemplate/Dashboard1
import pandas as pd
infile = 'all_loans.csv'
outfile = 'all_loans_sankey.csv'
sankey_columns = ['country', 'sector']
@samuelleach
samuelleach / uk_postcode_regex.txt
Created February 25, 2016 09:45
UK postcode regex
UK Postcode Regexes:
- Assumes upper case letters.
- Assumes there is zero or one space between outcode and incode
Postcode
(?:(?:[A-PR-UWYZ][0-9]{1,2}|[A-PR-UWYZ][A-HK-Y][0-9]{1,2}|[A-PR-UWYZ][0-9][A-HJKSTUW]|[A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRV-Y]) ?[0-9][ABD-HJLNP-UW-Z]{2}|GIR 0AA)
Outcode
@samuelleach
samuelleach / packages.txt
Created December 18, 2015 13:03
List of python packages currently installed on Google Datalab
argparse (1.2.1)
backports.ssl-match-hostname (3.4.0.2)
brewer2mpl (1.4.1)
certifi (2015.9.6.2)
chardet (2.3.0)
colorama (0.3.2)
cssselect (0.9.1)
decorator (4.0.2)
funcsigs (0.4)
functools32 (3.2.3-2)
@samuelleach
samuelleach / reserve_install.R
Last active May 23, 2021 13:01
Install Rserve on Mac
pkg_url <- "http://cran.r-project.org/bin/macosx/mavericks/contrib/3.1/Rserve_1.7-3.tgz"
install.packages(pkg_url, repos = NULL)
library(Rserve)
Rserve(args="--vanilla")
@samuelleach
samuelleach / eastnorth2lonlat.py
Created November 14, 2015 18:32
Convert Eastings/Northings to lon lat
import pyproj as pyproj
import pandas as pd
import numpy as np
df = pd.read_csv('SCOOT_Detectors.csv')
osgb36 = pyproj.Proj("+init=EPSG:27700")
eastnorth = np.apply_along_axis(func1d=lambda x: osgb36(x[0],x[1], inverse=True), arr=df[['EASTING', 'NORTHING']].values, axis=1)