Skip to content

Instantly share code, notes, and snippets.

View tomlane's full-sized avatar
🏠
Working from home

Tom Lane tomlane

🏠
Working from home
View GitHub Profile
@tomlane
tomlane / gist:b981b9dc143a64495ddb
Created October 25, 2014 13:55
Ship wreck causes and ships affected query
[{
"name": null,
"type": "/base/disaster2/shipwreck_cause",
"ships_wrecked_this_way": [{
"name": null
}]
}]
@tomlane
tomlane / BoxStarter
Created January 12, 2015 14:52
Dev Machine BoxStarter
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-RemoteDesktop
cinst fiddler4
cinst git-credential-winstore
cinst console-devel
cinst sublimetext2
cinst poshgit
cinst dotpeek
cinst visualstudio2013professional
@tomlane
tomlane / plan.md
Last active August 29, 2015 14:14
Talk notes / plans

Open Rail Data

If all goes well my plan is to show something shiny and all the cloud stuff grinding away in the background keeping it all in check. Essentially there are four feeds/sets of data:

  • The station board feed (which I've wrapped and cleaned up a bit naming wise) which is a pull service.
  • Train movements, a push feed which contains messages about train 'activations' 'movements' and 'cancellations'. http://nrodwiki.rockshore.net/index.php/Train_Movements
  • The Train Describer, another push feed for (what I think is the awesome stuff) real time signal changes, points changes and route setting for trains. http://nrodwiki. rockshore.net/index.php/TD
  • The schedule information. Which 2 and 3 depend on for information on the train timing and details.
$(theWorld).change(function() {
alert( "You've changed the world." );
});
{
"RTPPMDataMsgV1": {
"owner": "Network Rail",
"timestamp": "1428753062000",
"classification": "public",
"schemaLocation": "http://xml.networkrail.co.uk/ns/2007/NR rtppm_messaging_v1.17.xsd",
"Sender": {
"application": "RTPPM3",
"organisation": "String"
},
@tomlane
tomlane / nodejs-http-server
Created October 29, 2011 19:02
A Well commented http server written in node.
/*
A well commented http server written in node.
Written by: Tom Lane, http://github.com/tomlane
All Public Work by Tom Lane is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales License.
*/
//calling the required http and fs modules
var http = require('http');
@tomlane
tomlane / gist:1373898
Created November 17, 2011 17:53
Page Visibility API Example
<!-- video pauses when tab is not in view. Uses Page Visibility API. -->
<html>
<head>
<title>Page Visibility API</title>
</head>
<body>
<p>Credit for video: http://ptaff.ca/orage_montreal/?lang=en_CA </p>
<video>
<source src="1696_lightnings.ogg" type="video/ogg">
</video>
@tomlane
tomlane / gist:1894276
Created February 23, 2012 18:41
JS logic 101
//Javascript Logic 101
//make "that" have the value of true (boolean)
that = true
//check if "that" is false
if (!that) { //returns false. (it is not true that the value is set to false)
//do something
}
@tomlane
tomlane / gist:3078788
Created July 9, 2012 20:46 — forked from shrwnsan/gist:2860805
Sublime Text 2 - Fetch Settings
{
"files":
{
"jquery" : "http://code.jquery.com/jquery.js",
"jquery.min" : "http://code.jquery.com/jquery.min.js",
"jquery-cookie" : "https://raw.github.com/carhartl/jquery-cookie/master/jquery.cookie.js",
"jquery-dotimeout" : "https://raw.github.com/cowboy/jquery-dotimeout/master/jquery.ba-dotimeout.min.js",
"jquery-extra-selectors" : "https://raw.github.com/keithclark/JQuery-Extended-Selectors/master/jquery-extra-selectors.js",
"jquery-flexslider" : "https://raw.github.com/mbmufffin/FlexSlider/master/jquery.flexslider-min.js",
"jquery-mediaelement" : "https://raw.github.com/johndyer/mediaelement/master/build/mediaelement-and-player.js",
@tomlane
tomlane / gist:3190614
Created July 27, 2012 21:44 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream