Skip to content

Instantly share code, notes, and snippets.

{
"timestamp": "Wed Feb 11 16:10:24 EST 2015",
"goalie": [
{
"position": "Goalie",
"id": 8475883,
"twitterURL": "https:\/\/twitter.com\/f_andersen30",
"weight": 236,
"height": "6' 3\"",
"imageUrl": "http:\/\/3.cdn.nhle.com\/photos\/mugs\/8475883.jpg",
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Tiles as Canvas Images in Leaflet</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<!-- Load Leaflet from CDN-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/leaflet/0.7.7/leaflet.css" />
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Tiles as Canvas Images in Leaflet</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<!-- Load Leaflet from CDN-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/leaflet/0.7.7/leaflet.css" />
@mappingvermont
mappingvermont / decode_date.js
Created June 14, 2016 20:32
Given an rgb value, return date, confidence, and intensity for GLAD alerts
var decode_date = function(rgba) {
// find the total days of the pixel by
// multiplying the red band by 255 and adding
// the green band to that
var total_days = rgba[0] * 255 + rgba[1];
// take the total days value and divide by 365 to
// get the year_offset. Add 15 to this (i.e 0 + 15 = 2015)
// or 1 + 15 = 2016
@mappingvermont
mappingvermont / multi_thread_example.py
Created June 21, 2016 20:21
Example of multi thread with arcpy process
import random
import time
from Queue import Queue
from threading import Thread
print 'Starting script!'
q = Queue()
entity_id ksm_ref Mill Name Longitude Latitude
1499 KSM1439 Murini Sam-Sam 2 (Pelintung) 101.593 1.5848
1429 KSM1008 PT MUSTIKA AGUNG SAWIT SEJAHTERA Jl 101.2424 1.29
1473 KSM1380 Sawit Anugrah Sejahtera 101.2767 1.1517
import overpass
import csv
import sys
api = overpass.API(timeout=900)
coords = []
with open('bbox.csv') as theFile:
csvReader = csv.reader(theFile)
csvReader.next()
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Filtering Pixels in Leaflet</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<!-- Load Leaflet from CDN-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/leaflet/0.7.7/leaflet.css" />
<script src="https://cdn.jsdelivr.net/leaflet/0.7.7/leaflet.js"></script>
@mappingvermont
mappingvermont / results_to_table_brazil_biome.py
Created February 27, 2017 14:31
cumsum loss data for brazil biomes
import os
import csv
import pandas as pd
def main():
header_list = ['biome', 'iso', 'adm1', 'adm2', 'year', 'thresh', 'area_raw', 'emissions_raw']
print 'Reading df'
@mappingvermont
mappingvermont / getting-started.md
Last active March 1, 2017 13:06
Setting up control-tower and a sample microservice