Skip to content

Instantly share code, notes, and snippets.

View skorasaurus's full-sized avatar

Will Skora skorasaurus

View GitHub Profile
@migurski
migurski / merge-geojsons.py
Created September 21, 2012 03:43
Merge multiple GeoJSON files into one
from json import load, JSONEncoder
from optparse import OptionParser
from re import compile
float_pat = compile(r'^-?\d+\.\d+(e-?\d+)?$')
charfloat_pat = compile(r'^[\[,\,]-?\d+\.\d+(e-?\d+)?$')
parser = OptionParser(usage="""%prog [options]
Group multiple GeoJSON files into one output file.
@wboykinm
wboykinm / index.html
Last active October 12, 2015 20:08
Adaptive Map - Mapbox edition
<html>
<head>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<!--Pattern HTML-->
<div id="pattern" class="pattern">
@jasondavies
jasondavies / README.md
Created December 2, 2012 11:54 — forked from mbostock/.block
World Map

Based on Mike Bostock’s [World Map][0], modified to automatically colour countries such that no adjacent countries share the same colour.

This is done by extracting the topology via [TopoJSON][1] and greedily picking colours until the constraint is fulfilled.

See also: [Graph coloring][2] on Wikipedia.

Update: Greedily colouring is now performed in a single line, thanks to Mike Bostock!

@tmcw
tmcw / opendata.md
Created December 13, 2012 18:39
open data chatter

How I would do an open data program if I were not just a lil' hacker dude.

The principles of open data:

  • the program needs to make the agency look good, so it can keep getting funding for it because it's expensive
  • the open data tech needs to match the internal tech or everyone is constantly porting and will give up since it's lots of work
  • the open data infrastructure must choose a spot on the continuum between service and resource. should other services rely on it to be online all the time, or just for it to let them download tons of copies of things?

Lots of Copies Keep Stuff Safe

@tmcw
tmcw / mapcss_cartocss_cascadenik.md
Created December 17, 2012 16:33
MapCSS vs CartoCSS

In which I begrudglingly compare MapCSS and CartoCSS because people keep asking.

I hate this kind of writing - it's annoying to try to describe one bit of software versus another, and this can and will fall out of date every time that somebody makes a big change to their library. But people want it, or whatever, so here it is.

Since CartoCSS and Cascadenik are weird cousins, the big difference is between them and MapCSS.

Let's see, differences:

  • CartoCSS is designed for Mapnik. That is, it tries to expose every possible Mapnik style option and ability, and supports every Mapnik datasource.
  • MapCSS is designed for OSM. That is, it makes it easy to style based on OpenStreetMap data types, tags, and so on.
@mbostock
mbostock / .block
Last active April 8, 2024 12:19 — forked from mbostock/.block
Bivariate Hexbin Map
license: gpl-3.0
height: 600
border: no
redirect: https://observablehq.com/@d3/d3-hexbin-map
@skorasaurus
skorasaurus / Osm_Terms.md
Last active March 20, 2016 19:58
OpenStreetMap cheat sheet for Common terms and lexicon used in OSM. [assuming node, line, and polygon is covered in the presentation itself)

Changeset: A group of changes that you made to OSM data. Once uploaded to OSM, your edits are instantly available to others if they download OSM data. They may take a few minutes or several hours to appear on the map.

Extract: A large chunk of OSM data for a specific area (like a state, country, or geographic area).

Layer: A data source that's displayed on a slippy map (often is thought of as a group of tiles stitched together). (It also has another meaning in OSM, but don't worry about it right now).

Render: to convert from the OSM data into an image. Rendered data is a map.

Stylesheet: it means a text file of rules that define what features (like roads, buildings) are displayed, and how (what color should the road be ? How wide should be? What icon should be used for a restaurant?) on a map.

@bitmorse
bitmorse / lastexport.py
Created March 20, 2013 00:51
lastfm scrobble exporter (from https://gitorious.org/fmthings/lasttolibre/blobs/master/lastexport.py // changed the script to try more often on failure )
#!/usr/bin/env python
#-*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@springmeyer
springmeyer / open-streets-dc.xml.diff
Created June 14, 2013 19:18
diff between carto v0.9.3 produced xml (the version included in last TileMill 0.10.1 release) and master carto at ff0fc2b1c82ac37953480ea86242268d94bac456 https://github.com/mapbox/carto/issues/247
--- v0.9.3.xml 2013-06-14 12:16:29.000000000 -0700
+++ m.xml 2013-06-14 12:15:44.000000000 -0700
@@ -3235,12 +3235,6 @@
<Rule>
<MaxScaleDenominator>750000</MaxScaleDenominator>
<MinScaleDenominator>100000</MinScaleDenominator>
- <Filter>([type] = 'trunk_link') and ([tunnel] = 1)</Filter>
- <LineSymbolizer stroke="#f56544" stroke-linecap="butt" stroke-dasharray="6, 3" stroke-linejoin="round" stroke-width="0" />
- </Rule>
- <Rule>
@skorasaurus
skorasaurus / gist:5852569
Last active December 18, 2015 22:09
Yes, I have a dark secret: my /home / /var is all on the same partition! I'm changing this with a clean install of ubuntu 12.04 with multiple partitions. Besides my scheduled /home backups, this is a list of other things to back up on an external hard drive before my clean install.
sources.lst (for apt-get)
cp -r /etc/apt/ ~/aptsrcs/
fstab file (for automatically mounting my external HD on boot).
wireless settings
cp -r /etc/NetworkManager/ destination
http://askubuntu.com/questions/212299/how-migrate-my-keyring-containing-ssh-passprases-nautilus-remote-filesystem-p
also: (already backed up).