Skip to content

Instantly share code, notes, and snippets.

Ducking and diving

Daniel Pett portableant

Ducking and diving
View GitHub Profile
portableant / ricepops.json
Created Jan 15, 2015
Flickr response for Andy
View ricepops.json
View autopgsqlbackup
# PostgreSQL Backup Script Ver 1.0
# Copyright (c) 2005 Aaron Axelsen <>
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
portableant /
Last active Aug 29, 2015 — forked from shawngraham/
steps for setting up @edsu's EARLS on Heroku;

Setting up EARLS

Earls is useful for archiving and counting URLS shared in tweets from a particular hashtag, eg., conference backchat etc. Getting it set up on Heroku (a tiered free service) is fairly straightforward. Getting it to go live requires a credit card tied to your account - but if you're using the free tier, this shouldn't be an issue. Anyway, with the help of Dan Pett I learned how to set one up. Dan set up an earls instance for #msudai.

getting ready

get a heroku account

install git

install node

View exampleMSUDAI.html
<!DOCTYPE html>
<meta charset=utf-8 />
<title>Load GeoJSON</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src=''></script>
<link href='' rel='stylesheet' />
body { margin:0; padding:0; }
portableant / OAI finds
Created Aug 21, 2015
A script in R to OAI harvest data from PAS
View OAI finds
baseurl <- ''
data <- oaih_harvest(baseurl, prefix = "oai_dc",from = NULL, until = NULL, set = 'BM',transform = TRUE)
portableant / test.geojson
Created Aug 25, 2015
A test geojson file
View test.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
portableant / alignTGNtoNomisma.R
Created Oct 22, 2015
Method for aligning Nomisma mints with Getty via Ryan B's script
View alignTGNtoNomisma.R
#' ----
#' title: " A script for aligning data from the TGN to Nomisma based on Pleiades IDs"
#' author: "Daniel Pett"
#' date: "10/16/2015"
#' output: csv_document
#' ----
nomisma <- read.csv("*+WHERE+%7B%0D%0A++++%3Furi+a+nmo%3AMint%3B%0D%0A++++skos%3AprefLabel+%3Flabel%3B%0D%0A++++skos%3AcloseMatch+%3Fmatch%3B%0D%0A++++.FILTER+regex%28str%28%3Fmatch%29%2C+%22pleiades%22%29+.%0D%0A++++FILTER%28langMatches%28lang%28%3Flabel%29%2C+%22EN%22%29%29+.%0D%0A++++%7D+LIMIT+100000&output=csv")
names(nomisma) <- c('uri', 'prefLabel', 'pleiades')
portableant / test.geojson
Last active Nov 9, 2015
PAS finds geojson
View test.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
portableant / perry.csv
Last active Jan 6, 2016
Megan Perry gis stuff
View perry.csv
1 POLYGON B.6 tomb 30.33192927 35.44511046
1 POLYGON B.6 tomb 30.33193793 35.4451296
1 POLYGON B.6 tomb 30.33194466 35.44512644
1 POLYGON B.6 tomb 30.33193506 35.44510488
1 POLYGON B.6 tomb 30.33192927 35.44511046
2 POLYGON B.5 tomb 30.33196859 35.44503376
2 POLYGON B.5 tomb 30.33197311 35.44505717
2 POLYGON B.5 tomb 30.33198008 35.44505588
2 POLYGON B.5 tomb 30.3319744 35.44503141
portableant / minePAS.R
Created Jan 11, 2016
Mine PAS for terminal dates for hoards
View minePAS.R
# Download data from PAS search
url <- ''
json <- fromJSON(url)
total <- json$meta$totalResults
results <- json$meta$resultsPerPage
pagination <- ceiling(total/results)
keeps <- c("id","old_findID","fromdate", "todate")
data <- json$results
data <- data[,(names(data) %in% keeps)]