Skip to content

Instantly share code, notes, and snippets.

@wragge
wragge / trove-format-facets-d3.js
Created December 8, 2013 11:19
Get format facets from the Trove API and construct a JSON object structured like the sample data used in most of the d3.js examples. It should be possible to plug this in to many of the d3 demos, though I've only tried it so far with the treeview and sunburst. As used in Trove Zone Explorer -- http://dhistory.org/trove/zone-explorer/
$(function(){
var api_key = 'your api key';
function get_data() {
$.jsonp({
"callbackParameter": 'callback',
"url": "http://api.trove.nla.gov.au/result?q= &zone=book,article,collection,picture,map,music&facet=format&n=0&encoding=json&key=" + api_key,
"timeout": 20000,
"success": function(results) {
process_results(results);
@alecthegeek
alecthegeek / ssh2vb
Last active November 14, 2015 23:18
ssh into a local Virtual Box Guest OS
#!/usr/bin/env bash
# ssh into a running Virtual Box guest machine
if [[ $# == 0 || $1 == -h || $1 == -? || $1 == --help ]] ; then
echo
echo usage: $(basename $0) '[<username>@]<machinename>'
echo
echo 'ssh into Virtual Box <machinename>, optionlly using <username>'
exit 1