Skip to content

Instantly share code, notes, and snippets.

View blech's full-sized avatar

Paul Mison blech

View GitHub Profile
import cgi
from google.appengine.ext import blobstore
from django.contrib import admin
from django import forms
from .models import FileDownload
class DLAdminForm(forms.ModelForm):
# 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 && \
@tobyspark
tobyspark / tbz.osx.config
Last active December 29, 2021 15:47
Script to configure a Max OS X machine to my taste
### Confiure a Mac OS X machine for my taste
### Toby Harris - http://tobyz.net / http://sparklive.net
### App Store
# Calca
# Coderunner
# Dash
# Xcode
@mbostock
mbostock / .block
Last active July 21, 2019 17:33
Timezones
license: gpl-3.0
redirect: https://observablehq.com/@mbostock/time-zones
anonymous
anonymous / overpass.geojson
Created February 3, 2014 22:17
data exported by overpass turbo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hubgit
hubgit / netflix-alt-genres.js
Last active May 4, 2016 21:35
1. Sign in to http://movies.netflix.com 2. Open Chrome's Developer Console 3. Paste in the code below and press enter
document.removeChild(document.documentElement);
var table = document.appendChild(document.createElement('table'));
var showData = function(i, title, movies) {
var tr = table.appendChild(document.createElement('tr'));
tr.scrollIntoView();
var th = tr.appendChild(document.createElement('th'));
th.textContent = i;
@marcoslin
marcoslin / .gitignore
Last active August 31, 2023 15:37
Encryption: From PyCrypto to CryptoJS
source.sh
@mbostock
mbostock / .block
Last active November 26, 2016 01:37
Rotating Icosahedron
license: gpl-3.0
@jinroh
jinroh / README.md
Last active March 26, 2024 07:54
Fourier series visualisation with d3.js.

From Wikipedia:

In mathematics, a Fourier series decomposes periodic functions or periodic signals into the sum of a (possibly infinite) set of simple oscillating functions, namely sines and cosines (or complex exponentials).

Use the bottom right form to change the visualized serie.

@mbostock
mbostock / .block
Last active February 1, 2020 08:48
See-Through Globe II
license: gpl-3.0