Skip to content

Instantly share code, notes, and snippets.

View acrymble's full-sized avatar

Adam Crymble acrymble

  • London
View GitHub Profile
@acrymble
acrymble / gist:b104e854248519ddf85e
Created March 2, 2015 18:29
Gazetteer keyword searching
#This Python programme will let you find pre-defined keywords in a series of entries.
#Written by Adam Crymble 2 March 2015, for Intro to Digital History class, University of Hertfordshire
#a.crymble@herts.ac.uk
#Import the keywords
f = open('keywords.txt', 'r')
allKeywords = f.read().lower().split("\n")
f.close()
#Import the texts you want to search
@acrymble
acrymble / gist:ce2a11f8f64d631c7650
Created March 2, 2015 18:11
English counties gazetteer
Angesse
Anglesea
Anglesey
Bedford
Bedfordshire
Beds
Berks
Berkshire
Brecknock
Brecknockshire
@acrymble
acrymble / extractTargetedData.py
Last active August 29, 2015 14:06
extractTargetedData.py
#Short Python programme, written by Adam Crymble - a.crymble@herts.ac.uk
#for the Digital Histories Workshop module at the University of Hertfordshire
#I am assuming that you have already read and completed the 'Python Introduction and Installation' tutorial
#from the Programming Historian: http://programminghistorian.org/lessons/introduction-and-installation
#September 2014.
#note that lines beginning with the # symbol are comments for you the student.
#The computer will ignore these.
#read through them all carefully before you try running the programme.
#Afterwards, if you find these comments distracting, feel free to delete them.
@acrymble
acrymble / matt-price
Created October 13, 2012 10:27
Matt Price
// array of ExtendedData elements to look for extendedData: ["category", "theme"], // Transform Function to do some magic: // read the category and use it to set the "theme" // property of the object, which will change the color // and icons used to display it. transformFunction: function(item) { // item is the raw loaded data from the spreadsheet record. // the magic is done in the getThemeFromData function // defined earlier: var theme = getThemeFromData(item); // now asociate the theme permanently with the // item by setting its options.theme attribue item.options.theme = theme; // we're finished with the transform -- now we have to give // our modified item back to TimeMap to make use of: return item; }
@acrymble
acrymble / javascript kml
Created October 13, 2012 10:27
javascript kml
var tm; function getThemeFromData(thisItem) { var category = thisItem.options.category; lookupTable = { "Booksellers' Protection Society": "blue", Lloyd: "red", "London Union of Vendors of Useful Knowledge, Male and Female": "green", "Pierce Egan": "orange" }; if (lookupTable.hasOwnProperty(category)) { return lookupTable[category]; } else { return "purple"; } }
@acrymble
acrymble / extended.kml
Created October 13, 2012 10:26
Extended data
<ExtendedData> <Data name="category"> <value>Pierce Egan</value> </Data> </ExtendedData>
@acrymble
acrymble / historic-overlay
Created October 13, 2012 10:24
historic map overlay
{ type: "basic", options: { items: [ { overlay : { north: 51.5158290192017, south: 51.513208079467, east: -0.115447746376376, west: -0.119289352205778, image: "81005295.png" } } ] } }
@acrymble
acrymble / map&timeline5.html
Created October 13, 2012 10:23
Synchronized Map and Timeline HTML code 5
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>London Publishers</title> <script src="http://maps.google.com/maps?file=api&v=3" type="text/javascript"></script> <script type="text/javascript" src="../lib/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="../lib/mxn/mxn.js?(google)"></script> <script type="text/javascript" src="../lib/timeline-1.2.js"></script> <script src="../src/timemap.js" type="text/javascript"></script> <script src="../src/param.js" type="text/javascript"></script> <script src="../src/loaders/xml.js" type="text/javascript"></script> <script src="../src/loaders/kml.js" type="text/javascript"></script> <script type="text/javascript"> var tm; $(function() { tm = TimeMap.init({ mapId: "map", // Id of map div element (required) timelineId: "timeline", // Id of timeline div element (required)
@acrymble
acrymble / map&timeline4.html
Created October 13, 2012 10:18
Synchronized Map and Timeline HTML code 4
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>London Publishers</title> <script src="http://maps.google.com/maps?file=api&v=3" type="text/javascript"></script> <script type="text/javascript" src="../lib/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="../lib/mxn/mxn.js?(google)"></script> <script type="text/javascript" src="../lib/timeline-1.2.js"></script> <script src="../src/timemap.js" type="text/javascript"></script> <script src="../src/param.js" type="text/javascript"></script> <script src="../src/loaders/xml.js" type="text/javascript"></script> <script src="../src/loaders/kml.js" type="text/javascript"></script> <script type="text/javascript"> var tm; $(function() { tm = TimeMap.init({ mapId: "map", // Id of map div element (required) timelineId: "timeline", // Id of timeline div element (required)
@acrymble
acrymble / map&timeline3.html
Created October 13, 2012 10:17
Synchronized Map and Timeline HTML code 3
<div id="help"> <h1>London Cheap Literature Publishers, 1837-1860</h1> <p>Publishers of penny bloods were concentrated mainly in two areas: around the Strand and around Paternoster Row. Edward Lloyd, the newcomer who became incredibly successful first had his office far East in Shoreditch, on Curtain Road. He quickly moved closer.</p> </div> <div id="timemap"> <div id="timelinecontainer"> <div id="timeline"></div> </div> <div id="mapcontainer"> <div id="map"></div> </div> </div>