Skip to content

Instantly share code, notes, and snippets.

View briantjacobs's full-sized avatar

Brian Jacobs briantjacobs

View GitHub Profile
@briantjacobs
briantjacobs / eol-scrape-01.js
Last active December 13, 2015 18:08
Node.io triple query to the Encyclopedia of Life for taxonomy entries based on species names
var nodeio = require('node.io'), options = {timeout: 10};
exports.job = new nodeio.Job(options, {
input: 'data/haeckel-plates.csv',
run: function(input) {
var self = this;
if (!input.type) {
var values = this.parseValues(input);
var keyword = values[2]; // hardcoded csv column
@briantjacobs
briantjacobs / gist:07595a625c9abb4832a0
Created November 18, 2015 21:50 — forked from sh0rtwave/gist:29773181164ef748cc64
EPIC Daily 'Blue Marble' API for epic.gsfc.nasa.gov
# EPIC Daily “Blue Marble” API
The API URL is: http://epic.gsfc.nasa.gov/api/images.php
This gets you a list of the latest day’s images & metadata.
OR
http://epic.gsfc.nasa.gov/api/images.php?date=YYYY-M-D&w=X&e=Y
#!/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 December 3, 2015 20:30 — forked from millermedeiros/example.js
execute multiple shell commands in series on node.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 November 24, 2015 22:41 — forked from tmcw/xyz_vs_tms.md
The difference between XYZ and TMS tiles and how to convert between them

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 / hdf5.rb
Created November 20, 2015 16:06
Brew install specific hdf5 version
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
@briantjacobs
briantjacobs / Run in LOCAL terminal...
Created October 5, 2015 01:49 — forked from jswartwood/Run in LOCAL terminal...
Automatic Git deploys on Dreamhost
# Replace any brackets with real values
# Try to ssh in to DREAMHOST (ensure it no longer asks for a PW); you may want to restart Terminal
ssh [user]@[host]
cd ~
mkdir [mydomain_com].git
cd [mydomain_com].git
git init --bare
vi hooks/post-receive
# Enter the code from the "post-receive" file (in this gist); save + quit
@briantjacobs
briantjacobs / .htaccess
Created October 4, 2015 17:52 — forked from mytharcher/.htaccess
Used for automated deploy web site code from Bitbucket to Dreamhost test site via git POST hook.
# This config is used for Dreamhost which HTTP basic authoriztion is forbidden.
# The PHP Server variable 'PHP_AUTH_USER' & 'PHP_AUTH_PW' could be implement by
# this config via a CGI environment variable.
# From [HTTP Authentication on PHP as CGI (like Dreamhost)](http://planetozh.com/blog/2009/04/http-authentication-on-php-as-cgi-like-dreamhost/)
RewriteEngine on
RewriteRule ^git-hook.*\.php - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
@briantjacobs
briantjacobs / README.md
Last active September 21, 2015 16:16 — forked from grossbart/README.md
Kinetoscope

A short code excerpt from this visualization I created for the longform article “Iouri Podladtchikov – You only fly once” by the Neue Zürcher Zeitung.

It's a very simple way to create an interactive animation based on video material. Hover over the image to go through the animation.

I used Final Cut Pro to crop and export the frames of a short video sequence, which I then stitched together into a single film strip using ImageMagick: convert folder-of-stills/* +append filmstrip.jpg