Skip to content

Instantly share code, notes, and snippets.

View ThomasG77's full-sized avatar

Thomas Gratier ThomasG77

View GitHub Profile
@tmpvar
tmpvar / output
Created June 12, 2012 19:40 — forked from nym/gist:2918959
Script tag not loading
var jsdom = require('jsdom');
jsdom.defaultDocumentFeatures = {
FetchExternalResources : ['script'],
ProcessExternalResources : ['script'],
MutationEvents : '2.0',
QuerySelector : false
};
var htmlDoc = '<html lang="en-US">' +
@elemoine
elemoine / index.html
Last active December 17, 2015 06:19
Example of an Angular directive for ol3.
<!DOCTYPE html>
<html ng-app='app'>
<head>
<meta charset=utf-8">
<link rel="stylesheet" href="http://ol3js.org/ol3/master/build/ol.css" type="text/css">
<style>
.map {
width: 600px;
@pramsey
pramsey / p2h_distance.sql
Last active January 15, 2016 15:13
Parcel Distance to Hydrant
-- An example of a lateral join driving a nearest-neighbor
-- distance calculation
SELECT
parcels.*,
-- keep the hydrant id around, might be useful later
hydrants.cartodb_id as hydrant_cartodb_id,
-- calculate distance over the spheroid using geography distance
ST_Distance(geography(hydrants.the_geom), geography(parcels.the_geom)) as distance
FROM
-- for this data, removing the duplicate parcel geometries and
@kennethreitz
kennethreitz / check.sh
Created February 7, 2016 15:48
How to find out why your RST isn't rendering on PyPi
pip install readme-renderer && python setup.py check -rs
{"head":{"functionName":"(root)","scriptId":"0","url":"","lineNumber":0,"columnNumber":0,"hitCount":0,"callUID":1198325751,"children":[{"functionName":"xmlhttp.onreadystatechange","scriptId":"61","url":"http://127.0.0.1/pbf/","lineNumber":14,"columnNumber":40,"hitCount":1,"callUID":3901805061,"children":[{"functionName":"decode","scriptId":"60","url":"http://127.0.0.1/pbf/geobuf-dev.js","lineNumber":11,"columnNumber":16,"hitCount":0,"callUID":616241247,"children":[{"functionName":"Pbf.readFields","scriptId":"59","url":"http://127.0.0.1/pbf/pbf-dev.js","lineNumber":193,"columnNumber":25,"hitCount":0,"callUID":4073696911,"children":[{"functionName":"readDataField","scriptId":"60","url":"http://127.0.0.1/pbf/geobuf-dev.js","lineNumber":24,"columnNumber":23,"hitCount":0,"callUID":1403778298,"children":[{"functionName":"readFeatureCollection","scriptId":"60","url":"http://127.0.0.1/pbf/geobuf-dev.js","lineNumber":34,"columnNumber":31,"hitCount":0,"callUID":1308918967,"children":[{"functionName":"Pbf.readMessage","
@JerrySievert
JerrySievert / gist:5686037
Created May 31, 2013 16:06
esri json to geojson
work=# select esriToGeoJSON('{"rings":[[[100,0],[101,0],[101,1],[100,1],[100,0]]],"spatialReference":{"wkid":4326}}');
esritogeojson
------------------------------------------------------------------------------
{"type":"Polygon","coordinates":[[[100,0],[101,0],[101,1],[100,1],[100,0]]]}
Zoom Tile size at equator (km) Resolution at equator (m)
0 22568 88155
1 11284 44078
2 7656 29904
3 4577 17881
4 2443 9544
5 1244 4861
6 625 2442
7 313 1223
@sergiocampama
sergiocampama / install.sh
Created November 7, 2012 19:33
Postgresql 9.2.1 Installation instructions for Ubuntu 12.04
#Postgresql 9.2.1 Compilation instructions for Ubuntu 12.04
#This will install Postgresql 9.2.1 into /usr/local/postgresql-9.2.1
#This assumes that you have sudo provileges on the machine installing postgresql
#It should work by copying and pasting into the shell, I haven't tested it, I just summarized
#what I just did and it worked
#Get requirements
sudo apt-get install build-essential libreadline6-dev zlib1g-dev
@wboykinm
wboykinm / .block
Last active July 6, 2016 05:49
Wiechel projection, D3.js v4
height: 960
border: no
# coding=utf-8
''' Guess at ISO-3166-2 admin 1 codes for Natural Earth data.
Uses subdivision names from Ola Holmström’s iso-3166-2:
https://github.com/olahol/iso-3166-2.js/blob/master/data.csv
ne_10m_admin_1_states_provinces.csv is a direct CSV
export of Natural Earth admin-1 data as of Nov 8, 2012:
https://github.com/nvkelso/natural-earth-vector/tree/c97860331/10m_cultural