Skip to content

Instantly share code, notes, and snippets.

@abenrob
abenrob / morphimages.txt
Created June 29, 2018 10:10 — forked from baoilleach/morphimages.txt
Create an animated gif to morph between images using ImageMagick
convert CID10033747.png CID9919714.png CID10033747.png -loop 0 -morph 9 -gravity South -annotate 1x1 "%t" -set delay "%[fx:(t%10!=0 || t==n-1)?10:240]" morph.gif
#bash_profile location: ~/.bash_profile
# Setting for the UTF-8 terminal support
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
@abenrob
abenrob / README.md
Last active January 3, 2016 15:59 — forked from mbostock/.block
Zoom to bounding box

d3 map showing world admin boundaries. Hover state attibutes and zooming to bounding boxes. Topojson data of Natural Earth Admin 0 - Countries shapefile at 50m resolution.

@abenrob
abenrob / README.md
Last active January 3, 2016 13:09 — forked from mbostock/.block
@abenrob
abenrob / README.md
Last active December 28, 2015 17:39 — forked from mbostock/.block

This donut chart is constructed from a CSV file storing the populations of various age groups. The chart employs a number of D3 features:

--FROM http://blog.mackerron.com/2012/06/01/postgis-2-ubuntu-12-04/
mkdir -p src
# First install PostgreSQL 9.2, plus contributed packages and any missing prerequisites
# ===
# add the Postgres PPA
echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' \
import json
from functools import wraps
from flask import redirect, request, current_app
def support_jsonp(f):
"""Wraps JSONified output for JSONP"""
@wraps(f)
def decorated_function(*args, **kwargs):
callback = request.args.get('callback', False)
if callback:
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
"use strict";
if (this == null) {
throw new TypeError();
}
var t = Object(this);
var len = t.length >>> 0;
if (len === 0) {
function MercatorToLatLon(mercX, mercY) {
var rMajor = 6378137; //Equatorial Radius, WGS84
var shift = Math.PI * rMajor;
var lon = mercX / shift * 180.0;
var lat = mercY / shift * 180.0;
lat = 180 / Math.PI * (2 * Math.atan(Math.exp(lat * Math.PI / 180.0)) - Math.PI / 2.0);
return { 'Lon': lon, 'Lat': lat };
}
function LatLonToMercator(lat, lon) {
var rMajor = 6378137; //Equatorial Radius, WGS84
var shift = Math.PI * rMajor;
var x = lon * shift / 180;
var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);
y = y * shift / 180;
return {'X': x, 'Y': y};
}