Skip to content

Instantly share code, notes, and snippets.

robinkraft / domino_event_log_5c777df946e0fb0008ada92c_condensed.json
Created Feb 28, 2019
cat ~/Downloads/domino_event_log_5c777df946e0fb0008ada92c.json | jq ".[].description"
View domino_event_log_5c777df946e0fb0008ada92c_condensed.json
"Request to deploy app with id 5c777df946e0fb0008ada92c"
"Deploying app with id 5c777df946e0fb0008ada92c"
"Deployment created: run-5c777df946e0fb0008ada92c"
"Pod created: run-5c777df946e0fb0008ada92c-6794d486b8-sxsp4"
"Scaled up replica set run-5c777df946e0fb0008ada92c-6794d486b8 to 1"
"Successfully assigned run-5c777df946e0fb0008ada92c-6794d486b8-sxsp4 to"
"Pod updated: run-5c777df946e0fb0008ada92c-6794d486b8-sxsp4"
"Deployment updated: run-5c777df946e0fb0008ada92c"
"Deployment updated: run-5c777df946e0fb0008ada92c"
"Pod updated: run-5c777df946e0fb0008ada92c-6794d486b8-sxsp4"
minikube stop; minikube delete &&
docker stop $(docker ps -aq) &&
rm -rf ~/.kube ~/.minikube &&
sudo rm -rf /usr/local/bin/localkube /usr/local/bin/minikube &&
launchctl stop '*kubelet*.mount' &&
launchctl stop localkube.service &&
launchctl disable localkube.service &&
sudo rm -rf /etc/kubernetes/ &&
docker system prune -af --volumes
robinkraft /
Last active Dec 7, 2017
Upload a raster to using the Mapbox Upload API
from mapbox import Uploader
u = Uploader() # handles authentication
tileset = 'username.tileset_name' # name your tileset
url = u.stage(open('mosaic_final.tif')) # upload happens here
u.create(url, tileset, name=fname) # starts the tiling job
robinkraft /
Last active Apr 20, 2020
Unofficial client for the satellite image catalog and API, originally part of Planet's quickstart guides.
#!/usr/bin/env python
import argparse
import os
import requests
import json
import sys
import logging
import datetime
robinkraft / firemap.html
Last active Oct 13, 2017
Embed code for fire map
View firemap.html
<iframe src="" width="640" height="480”>
robinkraft /
Created Jan 20, 2017
calculate toa reflectance for Planet Labs data - not an ideal script, but you get the idea
import os
import argparse
from bs4 import BeautifulSoup
import rasterio
SUFFIX = '_BGRN_Analytic'
BASEPATH = '/Users/robinkraft/gitlab/change/hackathon/robin/data/'
robinkraft / learning_rates.ipynb
Last active Nov 29, 2016
Showing difference between different methods for changing learning rates in Keras.
View learning_rates.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
robinkraft /
Last active Nov 21, 2016
Data prep for Kaggle's State Farm competition
import os
from glob import glob
import shutil
import pandas as pd
def choose_subjects(df, count):
# group the frame by the subject in the image
subjects = df.groupby('subject')
robinkraft /
Last active Jun 29, 2017
Script to process dogs vs. cats data from Kaggle for use with VGG ImageNet submission. See
import os
import random
import glob
import shutil
def get_dc_paths(path):
"""Given a path filled with dog & cat files, make separate lists of both."""
cats = []
dogs = []
robinkraft / f250-cdm.clj
Last active Aug 29, 2015
convert FORMA 250m data into common data model suitable for website
View f250-cdm.clj
(use '
(in-ns '
(defn f250->cdm
[src t-res zoom]
(let [epoch (date/datetime->period t-res "2000-01-01")]
(<- [?x ?y ?z ?min-period]
(src ?line)
(clojure.string/split ?line #"\t" :> ?lat-str ?lon-str ?date-str)
(read-string ?lat-str :> ?lat)