Skip to content

Instantly share code, notes, and snippets.

# https://www.mapbox.com/blog/processing-landsat-8/
task :landsat_2014 => :environment do
dirs = Dir["#{Rails.root.to_s}/db/initial/raster/*"].reject {|q| q =~ /tar\.gz/ }
dirs.each do |dir|
scene_id = dir.split("/")[-1]
[4,3,2].each do |band|
`gdalwarp -t_srs EPSG:3857 #{dir}/#{scene_id}_B#{band}.TIF #{dir}/#{scene_id}_B#{band}-projected.tif`
end
`convert -combine #{dir}/#{scene_id}_B{4,3,2}-projected.tif #{dir}/#{scene_id}_RGB-projected.tif && \
convert -channel B -gamma 0.925 -channel R -gamma 1.03 -channel RGB -sigmoidal-contrast 50x16% #{dir}/#{scene_id}_RGB-projected.tif #{dir}/#{scene_id}_RGB-projected-corrected.tif && \
@max-mapper
max-mapper / index.js
Created March 27, 2014 20:57
requirebin sketch
var Vue = require('vue')
var domify = require('domify')
var template = '<div id="demo">'
+ '<p>{{message}}</p>'
+ '<input v-model="message">'
+ '</div>'
var templateEl = domify(template)
document.body.appendChild(templateEl)
@max-mapper
max-mapper / index.js
Created March 16, 2014 00:49
requirebin sketch
var d3 = require('d3')
var grid = require('d3-grid-layout')(d3)
var layout = grid()
.width(window.innerWidth - 40)
.height(window.innerHeight - 40)
.radius(80)
.align(0)
.ease('back', 2)
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active July 13, 2024 21:24
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx