Skip to content

Instantly share code, notes, and snippets.

Jesse Crocker JesseCrocker

Block or report user

Report or block JesseCrocker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JesseCrocker
JesseCrocker / states.py
Created Nov 18, 2015
python list of US states
View states.py
['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming']
@JesseCrocker
JesseCrocker / aws.conf
Created Feb 15, 2016
How to install AWS CloudWatch Logs Agent to send logs from a docker container to AWS Cloudwatch, without using a linked container for logging.
View aws.conf
[plugins]
cwlogs = cwlogs
[default]
region = ap-southeast-2
@JesseCrocker
JesseCrocker / TBActiveMarker.h
Created Sep 18, 2015
Example for how to create an animated marker with WhirlyGlobe/Maply
View TBActiveMarker.h
//
// TBActiveMarker.h
// TrailTracker
//
// Created by Jesse Crocker on 2/10/14.
//
//
#import "WhirlyGlobeComponent.h"
View valhalla diary.md

Ultimate Goal: valhalla running on AWS ECS, behind a load balancer, in multiple regions, with auto scaling, with data updating once a week.

Diary

First goal: Build with docker, then cut tiles from a small extract and get server to run locally.

jesse:projects/ $ mkdir ~/valhalla-data
jesse:projects/ $ cd ~/valhalla-data
jesse:projects/ $ wget http://download.geofabrik.de/north-america/us/california-latest.osm.pbf
[output abbreviated]
jesse:projects/ $ cd ~/projects
@JesseCrocker
JesseCrocker / convert-geopdf.py
Last active Aug 13, 2019
A quick script for converting US Topo geoPDF maps to tiff. Based on code from Even Rouault at http://lists.osgeo.org/pipermail/gdal-dev/2013-January/035269.html
View convert-geopdf.py
#!/usr/bin/env python
#based on http://lists.osgeo.org/pipermail/gdal-dev/2013-January/035269.html
from osgeo import gdal, osr
import os
import sys
from optparse import OptionParser
import tempfile
from shapely import wkt
from shapely.geometry import mapping
from fiona import collection, crs
@JesseCrocker
JesseCrocker / collage.py
Last active Apr 14, 2019
Create a collage of images, filling all space without cropping. Implements algorithm presented in https://www.crispymtn.com/stories/the-algorithm-for-a-perfectly-balanced-photo-gallery
View collage.py
#!/usr/bin/env python
from operator import itemgetter
from optparse import OptionParser
import logging
from PIL import Image
from math import ceil, floor
import sys
"""
@JesseCrocker
JesseCrocker / playback-gpx.py
Last active Mar 24, 2019
Use a GPX file to simulate locations in the Genymotion Android emulator. Requires gpxpy. `pip install gpxpy`
View playback-gpx.py
#!/usr/bin/env python
import sys
import logging
from optparse import OptionParser
import os
import gpxpy
import gpxpy.gpx
import time
from subprocess import check_output
import math
@JesseCrocker
JesseCrocker / build-gdal-combined-lib.sh
Last active Feb 20, 2019
Scripts for building Gdal into a static library for iOS, build-gdal-combined-lib.sh will build a single lib with armv7 armv7s arm64 and simulator slices
View build-gdal-combined-lib.sh
#!/bin/bash
PREFIX=`pwd`/install/
rm -rf $PREFIX
mkdir $PREFIX
LOG=./log
rm -rf $LOG
mkdir $LOG
if [ -e ${PREFIX} ]
then
@JesseCrocker
JesseCrocker / function.js
Created Apr 29, 2016
AWS lambda function for posting cloudwatch alarms to slack
View function.js
var AWS = require('aws-sdk');
var url = require('url');
var https = require('https');
var hookUrl, kmsEncyptedHookUrl, slackChannel;
kmsEncyptedHookUrl = ''; // Enter the base-64 encoded, encrypted key (CiphertextBlob)
slackChannel = '#alerts'; // Enter the Slack channel to send a message to
@JesseCrocker
JesseCrocker / bil-to-hgt.sh
Created Jul 28, 2015
Convert a directory of .bil files to .hgt
View bil-to-hgt.sh
#!/bin/bash
function gdal_pixel_count() {
if [ -z "$1" ]; then
echo "Missing arguments. Syntax:"
echo " gdal_extent <input_raster>"
return
fi
EXTENT=$(gdalinfo $1 |\
grep "Size is" |\
sed "s/Size is //g;s/,//;s/\n//")
You can’t perform that action at this time.