Skip to content

Instantly share code, notes, and snippets.


Jess Robertson jesserobertson

View GitHub Profile
jesserobertson / aggregate_pdfs.ps1
Last active Jan 23, 2020
Copy all PDFs recursively from a parent folder to the current folder in Powershell
View aggregate_pdfs.ps1
# $data_dir is some gnarly collection of folders
Get-ChildItem -Recurse $data_dir |
Where-Object { $_.Extension -eq '.pdf' } |
Copy-Item -Destination .
jesserobertson /
Created Mar 26, 2019
Nice downloads in Python for largish files
""" file:
author: Jess Robertson (@jesserobertson)
date: Tuesday, 26 March 2019
description: Download large files with requests and a tqdm progress bar.
Modified lightly from
import pathlib
from urllib.parse import urlparse
jesserobertson / optimist.csv
Created Mar 13, 2019
Demo submission files for explorer data-science stream. `pessimist.csv` asserts there are no deposits anywhere in any of our stamp areas, `optimist.csv` thinks there's a gold deposit at the centre of every stamp, and `super_optimist.csv` thinks there's a Cu-Au, Fe, PGE and Pb-Zn deposit in every stamp
View optimist.csv
stamp_id x y commodity
08182206 0 0 Au
33056140 0 0 Au
82675435 0 0 Au
75118621 0 0 Au
68158945 0 0 Au
78221409 0 0 Au
57745933 0 0 Au
89020571 0 0 Au
97892894 0 0 Au
jesserobertson / data_explorer_validation_intro.ipynb
Last active Jun 12, 2020
Introduction notebook for competition
View data_explorer_validation_intro.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
jesserobertson /
Last active Feb 22, 2019
Convert all Geosoft *.grd files to geotiff in a directory (recursively)
import pathlib
from itertools import product
from tqdm import tqdm
import rasterio
import geosoft
import geosoft.gxpy.gx as gx
import geosoft.gxpy.coordinate_system as gxcs
import geosoft.gxpy.grid as gxgrid
jesserobertson /
Last active Feb 11, 2019
MASE scoring metric for Unearthed's Glencore Turn Up The Zinc Competition (
""" file:
author: Jess Robertson,
date: Thursday, 31 January 2019
description: MASE scoring for Glencore competition (
import numpy as np
def _mase_numeric_only(predicted, measured):
jesserobertson /
Created Dec 19, 2018 — forked from dgoguerra/
Install dynamodb-local through Homebrew (custom formula)

Install dynamodb-local through Homebrew

An official formula for dynamodb-local existed, but was removed since dynamodb-local is not open source and stopped having versions.

Now its available either through a Cask, or by installing it as a formula from an unofficial tap (third party repo).

When installed as a cask dynamodb-local cannot be exposed as a service, so here we are installing it as a formula. It has been forked from rjcoelho/homebrew-boneyard and updated to be a head-only formula, to avoid checksum erros on new versions. It is available at dgoguerra/homebrew-boneyard.

# dynamodb-local depends on Java 6+
jesserobertson / mount-bitlocker
Created Nov 21, 2018 — forked from dumbledore/mount-bitlocker
Mount/umount wrapper for dislocker on MacOS
View mount-bitlocker
function usage() {
echo "$(basename ${0}) <partition> <password>"
echo "Unlocks and mounts a bitlocker partition as read-only"
jesserobertson /
Created Oct 4, 2018
mucking around with wcs requests
import requests
from lxml import etree
def hit(url, params):
"Hit a URL, parse the xml"
response = requests.get(url, params=params)
if response.ok:
return etree.fromstring(response.content)
jesserobertson /
Created Aug 30, 2018
Rendering template file
data "template_file" "batch_policy_template" {
template = "${file("${path.module}/batch_ecs_instance_policy.json.tpl")}"
vars = {
bucket_name = "${}"
resource "aws_iam_role_policy" "test_policy" {
name = "test_policy"
role = "${}"
policy = "${data.template_file.batch_policy_template.rendered}"
You can’t perform that action at this time.