Skip to content

Instantly share code, notes, and snippets.

View andymason's full-sized avatar
🙂

Andrew Mason andymason

🙂
View GitHub Profile
<div class="shareButtons">
{{#each media}}
<button on-click="share:{{this}}" class="share-{{this}}"></button>
{{/each}}
</div>
<style>
.shareButtons{
font-size:0;
}
define([], function() {
// Test more
// now more
return {
boot: function(el) {
console.log('test');
console.log('test');
// Support: Firefox 18+
// Can't be in strict mode, several libs including ASP.NET trace
// the stack via arguments.caller.callee and Firefox dies if
// you try to trace through "use strict" call chains. (#13335)
//
var arr = [];
--
// Support: Android<4.1
// Make sure we trim BOM and NBSP
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
define('nyt5/analytics',[],function() {
var canonical = document.querySelector("link[rel='canonical']").href,
pageview = ['_trackPageview'];
if (canonical) {
var a = document.createElement("a");
a.href = canonical;
if (a.pathname != document.location.pathname) pageview.push(a.pathname);
}
@andymason
andymason / Landsat 8 gdal processing
Last active June 19, 2017 13:08
Added projection wrap correction
#! /bin/bash
# Convert Landsat 8 GeoTIFF images into RGB pan-sharpened JPEGs.
#
# Requirements:
# * gdal http://www.mapbox.com/tilemill/docs/guides/gdal/
# * convert (image-magick)
#
# Reference info:
# http://www.mapbox.com/blog/putting-landsat-8-bands-to-work/
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript" src="matrix.js"></script>
<style type="text/css">
rect {
fill: steelblue;
fill-opacity: .8;
var w = 960,
h = 550;
// Matrix Layout
// ------------
var Matrix = function() {
var width = 1,
height = 1,
cols = 4;
// IMPORTS ------------------------------------------------------------
// http://ejohn.org/blog/simple-javascript-inheritance/
/* Simple JavaScript Inheritance
* By John Resig http://ejohn.org/
* MIT Licensed.
*/
// Inspired by base2 and Prototype
(function(){
var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;
/*! jQuery throttle / debounce - v1.1 - 3/7/2010 | http://benalman.com/projects/jquery-throttle-debounce-plugin/ | Copyright (c) 2010 "Cowboy" Ben Alman | license: MIT */
(function (b, c) {
var $ = b.jQuery || b.Cowboy || (b.Cowboy = {}),
a;
$.throttle = a = function (e, f, j, i) {
var h, d = 0;
if (typeof f !== "boolean") {
i = j;
j = f;
f = c
@andymason
andymason / gist:3285675
Created August 7, 2012 14:14
Google Doodle hurdle game
// https://www.google.com/doodles/hurdles-2012
(function () {
var h = void 0,
i = !0,
j = null,
l = !1,
m, n = this,
aa = function (a, b) {
var c = a.split("."),
d = n;