Skip to content

Instantly share code, notes, and snippets.

@neelsmith
neelsmith / .profile
Last active August 29, 2015 13:56
Globally make java be more reasonable about character encoding in file io.
# Add to your .profile or equivalent:
export JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF8"
@neelsmith
neelsmith / README.md
Last active August 29, 2015 13:56
Athenian Tribute Quota payments

Athenian Tribute quota payments: extant records

The Athenian Tribute Quota Lists

In the fifth century B.C., members of the "League of the Greeks" paid annual tribute to Athens. The Athenian Tribute Quota lists are a series of fragmentarily preserved inscriptions recording the proportion of that payment (1/60) that was handed over to the Treasurers of Athena.

Interaction

@neelsmith
neelsmith / README.md
Last active August 29, 2015 13:58
Dimensional charting of ATL

Work in progress

A future gist/bl.ocks to explore data about Athenian tribute quota paymens.

A one-off of [this app to display historic data about meteor observations][larissa].

TBD

  • set appropriate scales for bar charts and radius size of map points
  • debug what's wrong with chart of year totals
@neelsmith
neelsmith / betaToUtf8Xml.groovy
Last active August 29, 2015 14:17
Converts text content of XML from beta-code Greek to UTF-8 while preseving markup
/*
Uses grapes to grab all dependencies needed to convert textual data in
XML texts of Greek like ancient Perseus texts from beta code representation
of Greek to the polytonic Greek range of Unicode in UTF-8 while preserving markup.
Writes a UTF-8 version of the XML file to standard output.
*/
String usage = "Usage: groovy betaToUtf8Xml.groovy <FILENAME>"
@neelsmith
neelsmith / cts.groovy
Created June 5, 2015 18:03
Convert a CTS repository of XML files to both tabular and graph representation
/*
Simple groovy script to convert a CTS repository of local XML files to :
1. tabular representation in structured text files
2. graph representation in RDF (TTL)
Usage: groovy cts.groovy <INVENTORY> <ARCHIVEROOT> <SCHEMA>
where INVENTORY is a CTS TextInventory file, ARCHIVEROOT is the root directory
where XML editions are stored, and SCHEMA is the Relax NG schema for validating
@neelsmith
neelsmith / setOsxEditor.sh
Created September 10, 2013 16:21
Set OS X EDITOR environment variable to open a Mac app like TextEdit
export EDITOR="/usr/bin/open -n -W -a /Applications/TextEdit.app"
@neelsmith
neelsmith / citekit-config
Created September 17, 2013 01:13
CiteKit: basic configuration of default resources
<ul id="citekit-sources">
<li class="citekit-source cite-text citekit-default">http://DEFAULTCTS</li>
<li class="citekit-source cite-image citekit-default">http://DEFAULTIMGSVC</li>
<li class="citekit-source cite-collection citekit-default">http://DEFAULTCOLL</li>
</ul>
@neelsmith
neelsmith / acceptcm.pl
Created October 25, 2013 10:20
critic markup perl: accept markup in stdin
while (<STDIN>) {
my $currLine = $_;
# accept deletions:
$currLine =~ s#{--[^\-]+--}##g;
# accept additions:
$currLine =~ s#{\+\+([^+]*)\+\+}#$1#g;
# accept changes:
$currLine =~ s#{~~[^~]+~>([^~]+)~~}#$1#;
print $currLine;
}
@neelsmith
neelsmith / rejectcm.pl
Created October 25, 2013 10:21
critic markup perl: reject critic markup
while (<STDIN>) {
my $currLine = $_;
#reject deletions:
$currLine =~ s#{--([^\-]+)--}#$1#g;
#reject additions:
$currLine =~ s#{\+\+([^+]*)\+\+}##g;
#reject changes:
$currLine =~ s#{~~([^~]+)~>[^~]+~~}#$1#g;
print $currLine;
}
@neelsmith
neelsmith / collectXmlText.groovy
Last active December 28, 2015 18:49
groovy script showing how to extract text node content from an XML file
/*
groovy XmlParser creates a tree of nodes that are
either Strings or groovy.util.Node objects. Walk the
parsed tree recursively and save text content.
*/
String collectText(Object n, String allText) {
if (n.getClass().getName() == "java.lang.String") {
allText = allText + n