Skip to content

Instantly share code, notes, and snippets.

View wombleton's full-sized avatar

Rowan Crawford wombleton

View GitHub Profile
$> db.tiles.find({}).sort({ 'voteCount': 1, 'hash': 1}).skip(1000).limit(10).explain()
{
"queryPlanner" : {
"plannerVersion" : 1,
"namespace" : "heroku_app35335042.tiles",
"indexFilterSet" : false,
"parsedQuery" : {
"$and" : [ ]
},
"winningPlan" : {
@wombleton
wombleton / oia performance.txt
Created October 17, 2014 08:30
Summary of OIA requests to Ministers/Ministries on fyi.org.nz
At Aug 2010 over the last six months there were 0 outstanding requests were out of 2.
The median processing time for completed requests was 34 working days.
The average processing time was 34.0 working days.
At Sep 2010 over the last six months there were 0 outstanding requests were out of 1.
The median processing time for completed requests was 22 working days.
The average processing time was 22.0 working days.
At Oct 2010 over the last six months there were 0 outstanding requests were out of 1.
The median processing time for completed requests was 22 working days.
@wombleton
wombleton / output.json
Created October 17, 2014 04:49
OIA requests on FYI from 2010 to 1 Oct 2014
{"site":"https://fyi.org.nz","from":"2010-01-01","to":"2014-10-01","requests":[{"created_at":"2010-03-22T10:57:56.000Z","title":"Value of Crown mining royalties","url":"https://fyi.org.nz/request/value_of_crown_mining_royalties_2","status":"success","elapsed_time":35,"timeline":"2010-03-22 - 2010-05-11","body":"Department of Conservation","body_url":"https://fyi.org.nz/body/doc"},{"created_at":"2010-03-22T11:00:21.000Z","title":"Value of Crown mining royalties","url":"https://fyi.org.nz/request/value_of_crown_mining_royalties","status":"success","elapsed_time":33,"timeline":"2010-03-23 - 2010-05-10","body":"Ministry of Economic Development","body_url":"https://fyi.org.nz/body/med"},{"created_at":"2010-09-16T22:18:58.000Z","title":"Amount of time a person/s has been involved in a court/ tribunal hearing","url":"https://fyi.org.nz/request/amount_of_time_a_persons_has_bee","status":"rejected","elapsed_time":22,"timeline":"2010-09-17 - 2010-10-18","body":"Ministry of Justice","body_url":"https://fyi.org.nz/body/m
2014-07-30 10:05:17 status installed linux-headers-3.2.0-41-generic 3.2.0-41.66
2014-07-30 10:05:19 status installed linux-headers-3.2.0-41 3.2.0-41.66
2014-07-30 10:05:20 status installed linux-headers-3.2.0-59-generic 3.2.0-59.90
2014-07-30 10:05:22 status installed linux-headers-3.2.0-59 3.2.0-59.90
2014-07-30 10:05:23 status installed linux-headers-3.2.0-61-generic 3.2.0-61.93
2014-07-30 10:05:25 status installed linux-headers-3.2.0-61 3.2.0-61.93
2014-07-30 10:05:27 status installed linux-headers-3.2.0-63-generic 3.2.0-63.95
2014-07-30 10:05:28 status installed linux-headers-3.2.0-63 3.2.0-63.95
2014-07-30 10:05:29 status installed linux-headers-3.2.0-64-generic 3.2.0-64.97
2014-07-30 10:05:31 status installed linux-headers-3.2.0-64 3.2.0-64.97
(function() {
var container = document.createElement('div'),
el;
container.innerHTML = '<iframe width="420" height="315" src="//www.youtube.com/embed/u8drRfc69NA?autoplay=1&start=7" frameborder="0" allowfullscreen style="position:fixed;top:20px;left:50%;margin-left:-210px;z-index:10000"></iframe>';
el = container.children[0];
document.body.appendChild(el);
function remove() {
document.body.removeChild(el);
var obj = {
name: 'Good McGoodson',
last_menstrual_period: 41
};
validate(obj, [ "name.length between 1 and 100", "lmp between 0 and 40"]]); // returns ["lmp must be between 0 and 40"]
@wombleton
wombleton / sha.js
Last active December 18, 2015 13:59
Node & command line differ in hash they return ... what am I doing wrong?
// \n at the end!
console.log(require('crypto').createHash('sha1').update('blob 14\0Hello, World!\n').digest('hex'));
$> 8ab686eafeb1f44702738c8b0f24f2567c36da6d
body {
font-family: "Helvetica", "sans-serif";
width: 400px;
float: left;
}
#banner {
background: #f7b;
color: #fff;
padding: 1px;
var express = require('express'),
app = express();
app.configure(function() {
app.use(express.bodyParser());
});
/**
*/
app.get('/', function (req, res) {
@wombleton
wombleton / xkcd.js
Created September 19, 2012 11:00
xkcd.com large comic navigation
// Paste this in the address bar and then use zoom in/out to navigate easier
// you may need to type in "javascript:" in the address bar manually
javascript:$('#comic').css('overflow', '');$('#topContainer, #bottom, .comicNav, #comic > img:first-child').hide()
// firefox does not allow you to do this from the address bar. For that, open the Scratchpad (Shift + F4) and execute:
$('#comic').css('overflow', '');$('#topContainer, #bottom, .comicNav, #comic > img:first-child').hide()