Skip to content

Instantly share code, notes, and snippets.

View longhotsummer's full-sized avatar

Greg Kempe longhotsummer

View GitHub Profile
@longhotsummer
longhotsummer / test-xmldiff.py
Created December 11, 2019 08:34
Tests xmldiff on some basic AKN HTML
from xmldiff import main, formatting
import lxml.etree
import lxml.html
XSLT = u'''<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:diff="http://namespaces.shoobx.com/diff"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
@longhotsummer
longhotsummer / leaflet-big-image-full.html
Created April 5, 2016 06:47
Full example of using leaflet to pan and zoom a big image, as described at http://kempe.net/blog/2014/06/14/leaflet-pan-zoom-image.html
<html>
<!-- See also: http://kempe.net/blog/2014/06/14/leaflet-pan-zoom-image.html -->
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"></script>
<style>
#image-map {
width: 100%;
height: 300px;
border: 1px solid #ccc;
margin-bottom: 10px;
#!/bin/bash
# virtualenv-auto-activate.sh
#
# Installation:
# Add this line to your .bashrc or .bash-profile:
#
# source /path/to/virtualenv-auto-activate.sh
#
# Go to your project folder, run "virtualenv env", so your project folder
# has a env folder at the top level, next to your version control directory.
@longhotsummer
longhotsummer / metered-taxi.txt
Created November 20, 2014 21:08
Metered Taxi by-law text
CITY OF JOHANNESBURG METROPOLITAN MUNICIPALITY
METERED TAXI, MINIBUS, MIDIBUS AND BUS BY-LAWS
The Municipal Manager of the City of Johannesburg Metropolitan Municipality hereby, in terms of Section 13(a) of the Local Government: Municipal Systems Act, 2000 (Act No 32 of 2000), publishes the Metered Taxi, Minibus, Midibus and Bus By-laws for the City of Johannesburg Metropolitan Municipality, as approved by its Council and as concurred with by the Premier: Gauteng Province in terms of section 80A of the National Road Traffic Act, 1996 (Act 89 of 1996), as set out hereunder.
CITY OF JOHANNESBURG METROPOLITAN MUNICIPALITY
METERED TAXI, MINIBUS, MIDIBUS AND BUS BY-LAWS
CHAPTER 1
INTERPRETATION
Definitions
1. (1) In these By-laws, any word or expression that has been defined in the Gauteng Public Passenger Road Transport Act, 2001 (Act No. 7 of 2001) has that meaning and, unless the context otherwise indicates –
“authorised official” means any official of the Council who has been authorised by it to administer, im
@longhotsummer
longhotsummer / metered-taxi.xml
Created November 20, 2014 21:07
Metered Taxi by-law XML
<?xml version="1.0" encoding="UTF-8"?>
<akomaNtoso xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.akomantoso.org/2.0" xsi:schemaLocation="http://www.akomantoso.org/2.0 akomantoso20.xsd">
<act contains="originalVersion">
<meta>
<identification source="#openbylaws">
<FRBRWork>
<FRBRthis value="/za/by-law/locale/1980/name/main"/>
<FRBRuri value="/za/by-law/locale/1980/name"/>
<FRBRalias value="By-Law Short Title"/>
<FRBRdate date="1980-01-01" name="Generation"/>
@longhotsummer
longhotsummer / cpt-boundary.geojson
Created September 5, 2014 09:07
Cape Town Municipality boundary
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@longhotsummer
longhotsummer / bkcpt-wifi.json
Created August 30, 2014 21:46
Free Wifi hotspots in Cape Town (from http://www.findfreewifi.co.za/)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@longhotsummer
longhotsummer / bkcpt.json
Last active August 29, 2015 14:05
CPT cycle paths (very basic)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@longhotsummer
longhotsummer / counties.topojson
Last active August 29, 2015 14:04
Kenya counties
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// Using leaflet.js to pan and zoom a big image.
// See also: http://kempe.net/blog/2014/06/14/leaflet-pan-zoom-image.html
// create the slippy map
var map = L.map('image-map', {
minZoom: 1,
maxZoom: 4,
center: [0, 0],
zoom: 1,
crs: L.CRS.Simple