Skip to content

Instantly share code, notes, and snippets.

@alecthegeek
alecthegeek / ssh2vb
Last active Nov 14, 2015
ssh into a local Virtual Box Guest OS
View ssh2vb
#!/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
@wragge
wragge / trove-format-facets-d3.js
Created Dec 8, 2013
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/
View trove-format-facets-d3.js
$(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);