Skip to content

Instantly share code, notes, and snippets.

View tilequery.js
// https://projects.propublica.org/voting/static/vtile-bundle.js
import * as VectorTile from '@mapbox/vector-tile';
import * as Protobuf from 'pbf';
import * as Turf from '@turf/turf';
Math.radians = function(degrees) {
return degrees * Math.PI / 180;
};
export const TileQuery = {
View keybase.md

Keybase proof

I hereby claim:

  • I am ashaw on github.
  • I am a_l (https://keybase.io/a_l) on keybase.
  • I have a public key ASCC07IPMNPo72sD5dLL3UtrWljymJDP6G2LapRIUeUfggo

To claim this, I am signing this object:

View jankycs.sh
jankycs() {
echo "select st_astext(st_transform(st_setsrid(st_point($2, $1), 4326), 3857));" | psql houston-rain -t | perl -pe 's/[^\d\.\- ]//g' | perl -pe 's/^ //g';
printf '\n'
}
View stateline-noraphael.js
(function() {
var MapCanvas = Landline.Stateline = function(container, locality, opts) {
this.paper = {};
this.events = {};
this.attrs = {};
this.lookup = {};
this.locality = locality;
this.container = $(container);
this.container.css("position", "relative");
View slides.js
var extend = function(obj){
var others = [].slice.call(arguments,1);
others.forEach(function(other){
for(var j in other) obj[j] = other[j];
});
return obj;
}
var Node = function(value){
this.value = value;
View picturefill-rails.rb
def pf(path)
picturefill(path, "AltText") do
b = path.scan(/(^.*)\.(jpg|png|gif)/).flatten
sizes = {
:small => "#{b[0]}_small.#{b[1]}",
:medium => "#{b[0]}_medium.#{b[1]}",
:medium_high_dpi => "#{b[0]}_medium_high_dpi.#{b[1]}",
:large => "#{b[0]}_large.#{b[1]}",
:large_high_dpi => "#{b[0]}_large_high_dpi.#{b[1]}"
}
View landsat-db.rb
# get the CSV from http://landsat.usgs.gov/metadata_service/bulk_metadata_files/LANDSAT_8.csv
require 'csv'
FILE = File.expand_path("..", __FILE__) + "/initial/LANDSAT_8.csv"
SCHEMA = <<-SQL
DROP TABLE "landsat8";
CREATE TABLE "landsat8" (
"sceneid" varchar(21) not null,
sensor varchar(8) not null,
View static-dynamic-tiles.rb
class TilesController < ApplicationController
around_filter :up_s3
def tile_response(map)
respond_to do |format|
format.png {
send_data map.to_png, :content_type => Mime::Type.lookup_by_extension("png"), :disposition => "inline"
}
end
end
View wb-sync.rb
color = Dir["./west bay pass 1 color/*"]
infra = Dir["./west bay pass 1 infra/*"]
color_idx = 0
infra_idx = 0
def mk_filename(idx)
prefix = "IMG_"
no_str = idx < 1000 ? "0#{idx}" : idx
"#{prefix}#{no_str}"
View infra-sync.rb
color = Dir["./hermitage\ color/*"]
infra = Dir["./hermitage\ infra/*"]
start_color = 213
start_infra = 297
color_idx = 0
infra_idx = 0
def mk_filename(idx)
You can’t perform that action at this time.