Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@harry-wood
harry-wood / changesets2csv.rb
Created November 30, 2014 02:16
Converts a changesets.osm file (experimental planet download) into a CSV file
# Converts a changesets.osm file (experimental planet download) into a CSV file.
#
# Supply filename or stream as parameter
# Output is written to changesets.csv (example lines reported to std out)
#
# To load the result into postgres:
# CREATE TABLE changesets (uid BIGINT, created TIMESTAMP, min_lat FLOAT, max_lat FLOAT, min_lon FLOAT, max_lon FLOAT, changes INTEGER);
# COPY changesets FROM '/vagrant/changesets.csv' DELIMITER ',' CSV;
#
# then you can do fun queries like this user ranking
@harry-wood
harry-wood / restaurants-goswell-rd.geojson
Last active August 29, 2015 14:10
Some restaurants around Goswell Rd area. For seating 20 ...possibly quiet
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@harry-wood
harry-wood / adiumirc2mediawiki.php
Created September 20, 2014 15:28
Converts text copied out of adium IRC, into mediawiki syntax suitable for pasting into a wiki as minutes of a meeting. Use it here: http://harrywood.dev.openstreetmap.org/adiumirc2mediawiki.php
<?php
/**
* Converts text copied out of adium IRC, into mediawiki syntax
* suitable for pasting into a wiki as minutes of a meeting
*/
header('Content-Type: text/html; charset=utf-8');
?>
<html>
<head>
<title>adium IRC to MediaWiki formatting converter</title>
@harry-wood
harry-wood / lunch-options.geojson
Last active August 29, 2015 14:05
Lunch options according to Harry
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@harry-wood
harry-wood / earlypubs.geojson
Created August 3, 2014 20:47
Looking back at OpenStreetMap early mapping. Pubs extracted from the earliest surviving records. The planet file from 1st May 2006 http://planet.openstreetmap.org/cc-by-sa/planet-060501-FromLA2.osm.bz2
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@harry-wood
harry-wood / comment-url-filter.php
Last active August 29, 2015 14:01
Little wordpress plugin to block some comments with crappy URLs
<?php
/*
* Plugin Name: Comment URL filter
* Description: Block some comments with crappy URLs
*/
function filter_handler( $approved , $commentdata )
{
$url = $commentdata['comment_author_url'];