Extracted from simple-statistics.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Canvas component | |
A generic canvas component that calls a draw function to draw the | |
contents, and automatically calls it again when anything the draw | |
function depends on changes. Blog entry: | |
http://simblob.blogspot.com/2018/03/using-vue-with-canvas.html | |
Example: | |
<a-canvas width="500" height="200" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Postgis21 < Formula | |
desc "Adds support for geographic objects to PostgreSQL" | |
homepage "http://postgis.net" | |
url "http://pkgs.fedoraproject.org/repo/pkgs/postgis/postgis-2.1.8.tar.gz/c33923e37424978a1306ce461c1d14ed/postgis-2.1.8.tar.gz" | |
sha256 "7c2380b895fe7bda34c2e70deab3fcf4c12b13ab40d7501cdaa6fa36f1a6c662" | |
revision 1 | |
def pour_bottle? | |
# Postgres extensions must live in the Postgres prefix, which precludes | |
# bottling: https://github.com/Homebrew/homebrew/issues/10247 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// compare to: https://github.com/dominictarr/hyperscript/blob/master/index.js (lol) | |
var e = function(/* tag, attrs, text, children...*/ ) { | |
var args = [].slice.call(arguments); | |
var tag = args.shift() || 'div'; | |
var atts = args.shift() || {}; | |
var text = args.shift() || ''; | |
var kids = args; | |
var el = document.createElement(tag); | |
Object.keys(atts).forEach(function(k) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
dest_dir="output" | |
dest_layer="shape_file" | |
mkdir -p "${dest_dir}" | |
i=0 | |
for src_file in source/*.shp ; do | |
echo "Reading ${src_file}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# These are shell functions to quickly create pansharpened RGB images ready for color correction | |
# from a set of raw Landsat 8 TIF files in a given directory. | |
# For example: | |
# l8_pansharp LC81690352014169LGN00 | |
# Creates: | |
# LC81690352014169LGN00_rgb_pansharp.tif | |
# l8_rush_pansharp downloads a L8 tile from Google Storage (if they have it), extracts the relevant bands, then creates the pansharpened output. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a shell function to quickly grab the data for a given Landsat 8 tile ID from Google's servers | |
# For example: | |
# l8get LC81690352014169LGN00 | |
# The echo at the end is to remind myself of the syntax for extracting bands 8, 4, 3, and 2. (Pansharp, Red, Green, Blue) | |
# On OSX this would go into your ~/.bash_profile file. | |
# Requires gsutil from https://developers.google.com/storage/docs/gsutil_install | |
# Most useful in conjunction with USGS' Earth Explorer: http://earthexplorer.usgs.gov/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getTileUrls(bounds, tileLayer, zoom) { | |
var min = map.project(bounds.getNorthWest(), zoom).divideBy(256).floor(), | |
max = map.project(bounds.getSouthEast(), zoom).divideBy(256).floor(), | |
urls = []; | |
for (var i = min.x; i <= max.x; i++) { | |
for (var j = min.y; j <= max.y; j++) { | |
var coords = new L.Point(i, j); | |
coords.z = zoom; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'bundler' | |
Bundler.require | |
require './application' | |
namespace :assets do | |
desc 'compile assets' | |
task :compile => [:compile_js, :compile_css] do | |
end |
NewerOlder