Skip to content

Instantly share code, notes, and snippets.

View stevage's full-sized avatar
💭
🐘

Steve Bennett stevage

💭
🐘
View GitHub Profile
@stevage
stevage / swagger.yaml
Created November 16, 2015 12:42
PTV realtime API swagger YAML
swagger: '2.0'
# This is your document metadata
info:
version: "2.1.0"
title: PTV Timetable API (community portal)
description: |
This is Open Knowledge Australia's version of Public Transport Victoria's <a href="https://www.data.vic.gov.au/data/dataset/ptv-timetable-api">Timetable API</a> documentation, built with [Swagger](https://github.com/swagger-api/swagger-ui). It was created by <a href="http://stevebennett.me">Steve Bennett</a> (stevage@gmail.com, <a href="https://twitter.com/stevage1">@stevage1</a>) for Open Knowledge Australia. It was not funded or supported by PTV, but was based on the official documentation using the CC-BY licence.
The Timetable API 2.0.0 lets you find stations and stops in a given area, query the next few departures from a stop, and the stops on a given line or service. Version 2.1.0, released on 28 May 2015 adds realtime stop arrivale times for trams and some buses, and disruption data. It does not provide vehicle location tracking, spatial data other than st
@stevage
stevage / gist:5b01d6c9aa32aa48f9bd46ecf0fe77e6
Created January 8, 2020 02:35
LGAs in a select element
<select>
<option value="">- Australian Capital Territory</option>
<option value="89399">Unincorporated ACT</option>
<option value="89499">No usual address (ACT)</option>
<option value="89799">Migratory - Offshore - Shipping (ACT)</option>
<option value="">- New South Wales</option>
<option value="10050">Albury (C)</option>
<option value="10130">Armidale Regional (A)</option>
<option value="10250">Ballina (A)</option>
<option value="10300">Balranald (A)</option>
@stevage
stevage / region_fid.sld
Created August 28, 2015 06:57
Region mapping style layer definition for TerriaJS
<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- a Named Layer is the basic building block of an SLD document -->
<NamedLayer>
<Name>region_id</Name>
@stevage
stevage / index.html
Created November 19, 2018 05:15
Animating a user interaction in mapbox-gl-js
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Animating a user highlight</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.51.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.51.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@stevage
stevage / renewables.csv
Created October 2, 2018 02:01
Renewable energy sample data from NEM
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 23 columns, instead of 13. in line 3.
"Station Name","Current Output (MW)",Region,"Most Recent Output Time (AEST)","Current % of Max Cap","Current % of Reg Cap","Max Cap (MW)","Reg Cap (MW)","Max ROC/Min","Unit Size (MW)","Physical Unit No.",Participant,"Dispatch Type",Category,Classification,"Fuel Source - Primary","Fuel Source - Descriptor","Technology Type - Primary","Technology Type - Descriptor",Aggregation,DUID,Lat,Lon
"Butlers Gorge Power Station",11.999999,TAS1,2018-10-02T02:00:00+0000,80.00,83.33,15,14.4,,14.4,1,"Hydro-Electric Corporation trading as Hydro Tasmania",Generator,Market,Non-Scheduled,Hydro,Water,Renewable,"Hydro - Gravity",N,BUTLERSG,-42.26689799999997,146.2617580000001
"Capital Wind Farm",0.0,NSW1,2018-10-02T02:00:00+0000,0.00,0.00,140,140,,2,1-67,"Infigen Energy Markets Pty Limited",Generator,Market,Non-Scheduled,Wind,Wind,Renewable,"Wind - Onshore",N,CAPTL_WF,-35.16603062099995,149.51856862600005
"Cathedral Rocks Wind Farm",5.43,SA1,2018-10-02T02:00:00+0000,8.23,8.23,66,66,,2,1-33,"Cathedral Rocks Wind Farm Pty Ltd",Gener
@stevage
stevage / index.html
Created June 26, 2018 01:44
mapbox on.load vs queryRenderedFeatures
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Display a map</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.46.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.46.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@stevage
stevage / README.md
Created June 26, 2018 01:28
Round labels demo

This is a somewhat hacky way of producing rounded labels in Mapbox-GL-JS. They are drawn as Markers, using queryRenderedFeatures to synchronise with the source data.

@stevage
stevage / index.html
Last active May 11, 2018 12:13
Medieval Melbourne
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.32.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.32.1/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@stevage
stevage / data.js
Last active March 24, 2018 14:31
Customised version of everytimezone.com, thanks to http://fabiopereira.me/blog/2016/06/29/how-to-customize-every-time-zone/
var data = [
[-6.0,"Wisconsin","MDT UTC-6",true],
[1.0,"UK","BST UTC+1",true],
[5.5,"Hyderabad","IST UTC+5.5",true],
[10.0,"Melbourne","AEST UTC+10",true],
];
@stevage
stevage / index.html
Created November 9, 2017 21:32
Multi-touch bug demo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Multitouch Test</title>
<link rel="stylesheet" href="//necolas.github.io/normalize.css/7.0.0/normalize.css" />
<link rel="stylesheet" href="//api.tiles.mapbox.com/mapbox-gl-js/v0.41.0/mapbox-gl.css" />
<link rel="stylesheet" href="styles.css" />
</head>
<body>