Skip to content

Instantly share code, notes, and snippets.

View blech's full-sized avatar

Paul Mison blech

View GitHub Profile
@zanarmstrong
zanarmstrong / index.html
Last active May 29, 2019 21:02
Which is bigger: Africa or North America?
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="overlay.css">
<link href='http://fonts.googleapis.com/css?family=Raleway:400,700' rel='stylesheet' type='text/css'>
<body>
<div id = "description">
<h2>Is Africa bigger than North America?</h2>
<p><strong>Yes!</strong> In fact, North America, including United States, Canada, Mexico, and Greenland, could easily fit inside Africa with plenty of room left to add Central America, Argentina, Chile, and Bolivia too.</p>
<p>Most of the maps we use day to day distort the relative sizes of countries, making countries near the equator look relatively small and countries near the north and south pole look relatively huge. However, we can compare the true sizes of countries by using a different type of map.</p>
<div><button name="Sweden,Madagascar">Sweden vs Madagascar</button><button name="Australia,Antarctica">Australia vs Antarctica</button><button name="Europe,Brazil">Europe vs Brazil</button><button name="US,Australia">United States vs Australia</b
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
Loading
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 May 8, 2025 15:11
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 June 6, 2025 17:13
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.