Skip to content

Instantly share code, notes, and snippets.

<?php
// see http://drupal.org/node/606332
$jsonp_prefix = $options['jsonp_prefix'];
if ($view->override_path) {
// We're inside a live preview where the JSON is pretty-printed.
$json = _views_json_encode_formatted($rows);
if ($jsonp_prefix)
$json = "\$_GET['$jsonp_prefix']($json)";
// Basic XMPP bot example for HipChat using node.js
// To use:
// 1. Set config variables
// 2. Run `node hipchat_bot.js`
// 3. Send a message like "!weather 94085" in the room with the bot
var request = require('request'); // github.com/mikeal/request
var sys = require('sys');
var util = require('util');
@bnchdrff
bnchdrff / gist:6095293
Last active December 20, 2015 07:39 — forked from hampelm/gist:6095257
BASE='http://docs.google.com/a/localdata.com/spreadsheet/ccc?output=csv&key=0Aty9maMoYSDFdDFNQk93TjUzc0haeGVjWGtORVAzYlE&gid=';
for SHEET in {1..20}
do
PATH=$BASE$SHEET
/usr/bin/wget -O test$SHEET.csv "$PATH"
done
@bnchdrff
bnchdrff / README.md
Last active December 23, 2015 22:09
iain's quartile plot d3 plugin, customized for detroitledger.org

Like a box plot, a quartile plot summarises a distribution with five statistics: the median (the dot); the upper quartile and the maximum value (either end of the upper centre line); and the lower quartile and the minimum value (either end of the lower centre line). However, a quartile plot reduces a box plot's glyphs to one dot and two lines, so it has a larger data-ink ratio.

For more information about quartile plots, see:

  • Tufte, E.R., 2001. The Visual Display of Quantitative Information. 2nd ed. Cheshire, CT, USA: Graphics Press.

Data

Refractive indices of samples of six types of glass, gathered for criminological investigation (source).