Skip to content

Instantly share code, notes, and snippets.

@lossyrob
lossyrob / eac-admin1-regions.geojson
Created April 3, 2020 18:45
EAC Admin-1 regions
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lossyrob
lossyrob / rough-polygon-continental-us
Last active March 28, 2020 03:30
Rough polygon of continental US
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
@lossyrob
lossyrob / new_confrmed_cases.py
Last active March 26, 2020 16:56
New confirmed COVID-19 cases per county over time
from datetime import datetime
import pandas as pd
import requests
def get_usafacts_county_cases(url):
r = requests.get(url)
return pd.read_csv(io.BytesIO(r.content))
def get_new_cases(url):
@lossyrob
lossyrob / county-minmax.json
Last active March 21, 2020 03:35
min max of aggregations HSCAP
{
"Estimated Beds Available (Conventional) - Lower": [
0,
212
],
"Estimated Beds Available (Conventional) - Upper": [
0,
425
],
"Estimated Additional Ventilators Required (Conventional) - Lower": [
@lossyrob
lossyrob / stac_model.py
Last active August 25, 2019 15:57
STAC Python model strawdog
"""STAC Model classes.
"""
import os
import json
from copy import copy, deepcopy
STAC_VERSION = '0.7.0'
class STAC_IO:
@lossyrob
lossyrob / write-one-line-text.scala
Last active August 14, 2019 07:54
Read \ Write a text file in one line Scala
def write(path: String, txt: String): Unit = {
import java.nio.file.{Paths, Files}
import java.nio.charset.StandardCharsets
Files.write(Paths.get(path), txt.getBytes(StandardCharsets.UTF_8))
}
def read(path: String): String =
scala.io.Source.fromFile(path, "UTF-8").getLines.mkString
@lossyrob
lossyrob / info.json
Created December 20, 2018 19:58
TileJSON.io - Global Friction Surface
{
"baseLayer": {
"tilejson": "2.2.0",
"name": "base",
"version": "1.0.0",
"scheme": "xyz",
"tiles": [
"https://a.tile.openstreetmap.org/{z}/{x}/{y}.png"
]
},
@lossyrob
lossyrob / info.json
Created December 20, 2018 19:57
TileJSON.io - Global friction surface for cost distance calculations using elevation (SRTM) and OSM roads + water bodies
{
"baseLayer": {
"tilejson": "2.2.0",
"name": "base",
"version": "1.0.0",
"scheme": "xyz",
"tiles": [
"https://a.tile.openstreetmap.org/{z}/{x}/{y}.png"
]
},
@lossyrob
lossyrob / empty.geojson
Created October 25, 2018 17:28
Empty Feature Collection
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lossyrob
lossyrob / the-gang-mistakes-a-cat.md
Last active October 18, 2018 01:10
"The Gang Mistakes a Cat"

The Gang Mistakes a Cat

cats A week ago, I was woken up by my partner Annie, who in panick delivered the news that Cleopatra was missing. Cleo is her 15-turning-4 year old cat (seriously this old cat is spry like you wouldn't believe), who had apparently slipped out the door as we left the house the night before. I say "her" cat, because she's spent all 15 years of Cleo’s life with her, but in the years I've known her and the bit we’ve been roommates, I've grown quite fond of this cat. I’ve even written her a song that I would be embarrassed if you heard (the true sign of Rob’s love). So she's a bit "our" cat now. We spent all day and night looking for her, but no dice. The week that followed was morose: Long stretches sitting on our porch shaking dry cat food at an empty night, a very depressed Sadie (the football-shaped granddaughter of Cleo), a have-a-heart trap on our patio that was only catching unbemused street cats that were clearly not Cleo. Not happy times in t