Skip to content

Instantly share code, notes, and snippets.

View tmcw's full-sized avatar
💭
merging your prs

Tom MacWright tmcw

💭
merging your prs
View GitHub Profile
var kml_layers = new Array();
/**
* Process KML Layers
*
* @param layerOptions
* Object of options
* @param mapid
* Map ID
* @return
/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
* license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the
* full text of the license. */
/**
* @requires OpenLayers/Renderer/Elements.js
*/
/**
* Class: OpenLayers.Renderer.VML
/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
* license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the
* full text of the license. */
/**
* @requires OpenLayers/Renderer/Elements.js
*/
/**
* Class: OpenLayers.Renderer.VML
#!/usr/bin/env ruby
# coding: utf-8
require 'rubygems'
require 'fastercsv'
require 'pdf/reader'
require 'CSV'
class Array
def to_csv
str=''
# python code for soft-hyphenation of CamelCase text
hyphenated = re.sub('([a-z])([A-Z])', r'\1­\2', text)
#!/usr/bin/env python
from multiprocessing import Pool
import os
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#!/usr/bin/env ruby
require 'rubygems'
require 'nokogiri'
file = ARGV[0]
nok = Nokogiri::XML(open(file))
nok.css('Placemark').each do |p|
if p.css('Point coordinates').inner_text == '0.0,0.0'
require 'rubygems'
require 'sqlite3'
# So this is address and name-completion for the sup mail client, which is
# really quite nice in a sort of vim-ish way
# However, I've switched since writing this, mainly because sup doesn't play nice with any other
# mail clients, so it screws up my read/unread/labeled systems when I'm using my iPhone, etc.
# Supposedly this is an upcoming feature, but it has been for a while and seems non-essential
# to the developers.
/**
* Google Maps API 2.0
* MapBox integration.
*
* Do not remove the MapBox or OpenStreetMap attribution from this code,
* doing so is in violation of the terms of both licenses.
*/
/**
* Factory function for a MapBox layer for use with a
def report_feed(request):
reports = FieldReport.objects.kml()
r = render_to_kml('kml/placemarks.kml', {'places' : reports})
r['Content-Disposition'] = 'attachment;filename=reports.kml'
return r