Skip to content

Instantly share code, notes, and snippets.

Brian Jacobs briantjacobs

Block or report user

Report or block briantjacobs

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
@briantjacobs
briantjacobs / combineHorizons.py
Last active Oct 3, 2017
Script to process a folder of ephemeris data and break into date ranges
View combineHorizons.py
from jsonmerge import merge
import itertools
import os
import sys
import subprocess
import processHorizons
import simplejson as json
import msgpack
import dateutil.parser
from datetime import datetime
@briantjacobs
briantjacobs / processHorizons.py
Last active Oct 1, 2017
Scripts to process HORIZONS ephemeris data
View processHorizons.py
import re
import os
import csv
import json
import sys
import StringIO
import dateutil.parser
import datetime
def main(inputFile):
@briantjacobs
briantjacobs / cubeSphere-example.js
Last active Aug 17, 2017
Create 6 gnomonic cube faces from a WGS84 input geotiff, render in three.js
View cubeSphere-example.js
var cubeSphere = new CubeSphere({
parent: PARENT, // scene or Object3D
scale: 1, // in case scaling according to other objects in scene
radius: 5, // size of sphere
textureFaces: [
new THREE.ImageUtils.loadTexture(04.jpg),
new THREE.ImageUtils.loadTexture(03.jpg),
new THREE.ImageUtils.loadTexture(05.jpg),
new THREE.ImageUtils.loadTexture(06.jpg),
new THREE.ImageUtils.loadTexture(02.jpg),
@briantjacobs
briantjacobs / gist:8c831d15acb3aa42da29f03c5f6153e4
Created Aug 5, 2017 — forked from jarek-foksa/gist:2648095
SVGElement.prototype.innerHTML shim
View gist:8c831d15acb3aa42da29f03c5f6153e4
// Important: You must serve your pages as XHTML for this shim to work,
// otherwise namespaced attributes and elements will get messed up.
Object.defineProperty(SVGElement.prototype, 'innerHTML', {
get: function() {
var $child, $node, $temp, _i, _len, _ref;
$temp = document.createElement('div');
$node = this.cloneNode(true);
_ref = $node.children;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
$child = _ref[_i];
@briantjacobs
briantjacobs / hi8-anim-howto.md
Created Jan 29, 2016 — forked from celoyd/hi8-anim-howto.md
A way to make Himawari-8 animations
View hi8-anim-howto.md

Himawari-8 animation tutorial

Here’s how to make animations like this one. It requires intermediate Unix command-line knowledge, to install some tools and to debug if they don’t work. You’ll need these utilities:

  • curl (or you can translate to wget)
  • convert and montage, part of ImageMagick
  • ffmpeg, plus whatever codecs
  • parallel, for iteration that’s nicer than shell for loops or xargs
  • run everything in zsh for leading 0s in numerical ranges to work
View example.js
#!/usr/bin/env node
// USAGE ------
// ============
var shell = require('./shellHelper');
// execute a single shell command
shell.exec('npm test --coverage', function(err){
console.log('executed test');
@briantjacobs
briantjacobs / example.js
Created Dec 3, 2015 — forked from millermedeiros/example.js
execute multiple shell commands in series on node.js
View example.js
// USAGE ------
// ============
var shell = require('./shellHelper');
// execute a single shell command
shell.exec('npm test --coverage', function(err){
console.log('executed test');
}});
@briantjacobs
briantjacobs / xyz_vs_tms.md
Created Nov 24, 2015 — forked from tmcw/xyz_vs_tms.md
The difference between XYZ and TMS tiles and how to convert between them
View xyz_vs_tms.md

The difference between XYZ and TMS tiles and how to convert between them

Lots of tile-based maps use either the XYZ or TMS scheme. These are the maps that have tiles ending in /0/0/0.png or something. Sometimes if it's a script, it'll look like &z=0&y=0&x=0 instead. Anyway, these are usually maps in Spherical Mercator.

Good examples are OpenStreetMap, Google Maps, MapBox, MapQuest, etc. Lots of maps.

Most of those are in XYZ. The best documentation for that is slippy map tilenames on the OSM Wiki, and Klokan's Tiles a la Google.

@briantjacobs
briantjacobs / config.yml
Created Nov 24, 2015
Parse YAML from bash with sed and awk.
View config.yml
development:
adapter: mysql2
encoding: utf8
database: my_database
username: root
password:
apt:
- somepackage
- anotherpackage
@briantjacobs
briantjacobs / hdf5.rb
Created Nov 20, 2015
Brew install specific hdf5 version
View hdf5.rb
class Hdf5 < Formula
desc "File format designed to store large amounts of data"
homepage "http://www.hdfgroup.org/HDF5"
url "https://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.15-patch1/src/hdf5-1.8.15-patch1.tar.bz2"
version "1.8.15"
sha256 "a5afc630c4443547fff15e9637b5b10404adbed4c00206d89517d32d6668fb32"
bottle do
sha256 "5b021fb5ee7c2c95b091988b0184e109caa6dd33bee61f5478fbb1b431d00cb3" => :el_capitan
sha256 "59253092e8b149b463a79e14daf40feb53863fb80c55756413d90f8c056fa0d4" => :yosemite
You can’t perform that action at this time.