Skip to content

Instantly share code, notes, and snippets.

@bnchdrff
bnchdrff / ec2-fix-grub-squeeze
Created May 11, 2011 15:16
debian squeeze on ec2 grub fix
# per http://groups.google.com/group/ec2debian/browse_thread/thread/cf14dbd5e04fab41/40097775d0c6c04d
apt-get update
apt-get remove --purge grub-legacy
apt-get install grub2
# linux command line: blank
# grub install devices: blank
# continue: yes
apt-get --purge autoremove
# remove the old menu.lst
rm /boot/grub/menu.lst
<?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)";
@bnchdrff
bnchdrff / concatenated.js
Created April 1, 2012 04:52
#detroitfuture gleaner
// packages.json:
{
"name": "twitglean",
"version": "0.0.1",
"dependencies": {
"felix-couchdb": "1.0.3"//,
// add as git repo in node_modules/ntwitter: "https://github.com/horixon/ntwitter.git",
// add as git repo in node_modules/immortal-ntwitter: "https://github.com/horixon/immortal-ntwitter.git"
}
@bnchdrff
bnchdrff / commotionappsbuild.sh
Created November 7, 2012 17:31
commotion apps build script
mkdir testrees
cd testrees/
git clone https://github.com/bnchdrff/commotion-wsrouting-feed.git commotion-examples
git clone https://github.com/bnchdrff/commotion-chat.git
git clone https://github.com/opentechinstitute/commotion-openwrt.git
cd commotion-openwrt/
./setup.sh
cd ../
cd commotion-examples/
./setup.sh
@bnchdrff
bnchdrff / cakeslice.gif
Last active December 10, 2015 10:29
birthday 4 dooug
cakeslice.gif
// 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 / unlockPDFs applescrapt
Created August 5, 2013 04:07
unlock PDFs using ghostscript. install gs from http://pages.uoregon.edu/koch/ before use.
-- unlock PDFs with gs
-- licensed under public domain
-- copyright benjamin chodoroff 2013
-- where is ghostscript binary?
property gs : "/usr/local/bin/gs"
on run
display dialog "drag n drop pdf unlocker"
end run
@bnchdrff
bnchdrff / gnl_michigan_lara_entity_search.user.js
Last active December 23, 2015 14:59
Detroitledger helper userscript: Get organization information from State of Michigan LARA database
// moved to https://github.com/detroitledger/gnl_profile/blob/7.x-1.x/gnl_michigan_lara_entity_search.user.js
@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).