Skip to content

Instantly share code, notes, and snippets.

@cuulee
cuulee / designer.html
Last active August 29, 2015 14:25
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
@cuulee
cuulee / designer.html
Created July 24, 2015 07:37
designer
<link rel="import" href="../polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@cuulee
cuulee / Issues.md
Last active September 4, 2015 00:54 — forked from rclark/Issues.md
Leaflet WMS + GetFeatureInfo

There are a bunch of reasons why this is convoluted, mostly in building the URL to make the request:

  1. You have to rely on an AJAX request, this example uses jQuery
  2. To make a GetFeatureInfo request, you must provide a BBOX for a image, and the pixel coordinates for the part of the image that you want info from. A couple of squirrely lines of Leaflet code can give you that.
  3. Output formats. The info_format parameter in the request. We don't know a priori which will be supported by a WMS that we might make a request to. See Geoserver's docs for what formats are available from Geoserver. That won't be the same from WMS to WMS, however.
  4. WMS services return XML docs when there's a mistake in the request or in processing. This sends an HTTP 200, which jQuery doesn't think is an error.
@cuulee
cuulee / L.Composite.js
Last active September 4, 2015 00:56 — forked from rclark/L.Composite.js
Composite Leaflet Layer
L.Composite = L.Class.extend({
includes: L.Mixin.Events,
initialize: function (options) {
// options should include:
// - tileUrl: A URL template for this layer's visible representation
// - tileOptions (optional): Any [config options for the L.TileLayer](http://leafletjs.com/reference.html#tilelayer-options)
// - geojsonUrl: A URL that retrieves GeoJSON data for this layer as a FeatureCollection,
// or a [Github blob API call](http://developer.github.com/v3/git/blobs/#get-a-blob)
// - geojsonOptions (optional): [Config options for the L.GeoJSON layer](http://leafletjs.com/reference.html#geojson-options)
@cuulee
cuulee / data80k.js
Created October 22, 2015 07:13 — forked from wboykinm/data80k.js
Hexbinning overload: 80k records with turf.js (example by Morgan Herlocker)
This file has been truncated, but you can view the full file.
var pts = {
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "properties": { "ID": 1 }, "geometry": { "type": "Point", "coordinates": [ -77.055489, 38.915114 ] } },
{ "type": "Feature", "properties": { "ID": 2 }, "geometry": { "type": "Point", "coordinates": [ -77.054149, 38.915316 ] } },
{ "type": "Feature", "properties": { "ID": 6 }, "geometry": { "type": "Point", "coordinates": [ -77.032692, 38.915333 ] } },
{ "type": "Feature", "properties": { "ID": 7 }, "geometry": { "type": "Point", "coordinates": [ -77.027352, 38.915271 ] } },
{ "type": "Feature", "properties": { "ID": 9 }, "geometry": { "type": "Point", "coordinates": [ -77.017376, 38.915247 ] } },
{ "type": "Feature", "properties": { "ID": 11 }, "geometry": { "type": "Point", "coordinates": [ -77.014119, 38.915333 ] } },
@cuulee
cuulee / gist:497a450c732a941313f3
Created November 5, 2015 02:52 — forked from nautilytics/gist:75cbbb2d854de608e81c
node-mapnik .pbf tile-server example
var config = require('../../config/database')
, _ = require('lodash-compat')
, mercator = require('./../../geo_utils/sphericalmercator')
, geographic = require('./../../geo_utils/geographic')
, crypto = require("crypto")
, zlib = require('zlib')
, mapnik = require('mapnik')
, utils = require('./../../config/utils');
if (mapnik.register_default_input_plugins)
@cuulee
cuulee / graphgist_water.adoc
Created November 6, 2015 03:50
Water Graphgist

Piping Water

Inspiration

London’s antique water distribution network is infamous: it loses a quarter of the water supplied to London (spilt into the ground). Consequence: desalination, massive additional CO2 emissions, road congestion caused by too many emergency excavations and very high water prices for consumers. London’s case is severe but not atypical: most cities suffer from the same underlying infrastructure problem. Pipes and valves buried below busy urban streets are inherently difficult and expensive to maintain. Inaccessibility, lack of information, failure to efficiently process data and the high cost of each human intervention in legacy systems all compound to undermine efficient resource distribution.

@cuulee
cuulee / README.md
Created November 13, 2015 03:24 — forked from mbostock/.block
Line Transition

This example is the second of three in the Path Transitions tutorial; see the previous example for context.

The desired pairing of numbers for path interpolation is like this:

M x0, y0 L x1, y1 L x2, y2 L x3, y3 L xR, y4
   ↓   ↓    ↓   ↓    ↓   ↓    ↓   ↓
M xl, y0 L x0, y1 L x1, y2 L x2, y3 L x3, y4

Where xl is some negative value off the left side, and xr is some positive value off the right side. This way, the first point ⟨x0,y0⟩ is interpolated to ⟨xl,y0⟩; meaning, the x-coordinate is interpolated rather than the y-coordinate, and so the path appears to slide off to the left. Likewise, the incoming point ⟨xr,y4⟩ is interpolated to ⟨x3,y4⟩.

@cuulee
cuulee / README.md
Created November 16, 2015 08:18 — forked from clhenrick/README.md
Hillshade tutorial for Maptime-NYC february 2015

GDAL Hillshade Tutorial

Chris Henrick
MapTime NYC
Winter 2015

Description

Participants will learn how to work with Digital Elevation Model data with GDAL to generate a shaded relief / hillshade for the Kings Canyon National Park area in the southern Sierra Nevada mountain range in California. The text in this tutorial is meant to be run in the Bash shell on Mac OS X or Linux but these processes can also be accomplished using QGIS.

@cuulee
cuulee / gist:dbc0b01794432cef85d2
Created March 18, 2016 03:13 — forked from learncodeacademy/gist:ebba574fc3f438c851ae
Nginx Node Frontend / Load Balancer / Static Assets Caching
upstream project {
server 22.22.22.2:3000;
server 22.22.22.3:3000;
server 22.22.22.5:3000;
}
server {
listen 80;
location / {