Skip to content

Instantly share code, notes, and snippets.

View benwbrum's full-sized avatar

Ben W. Brumfield benwbrum

View GitHub Profile
################################
# On the problem system:
################################
#
1.9.3-p125 :001 > Register.count
=> 9453
1.9.3-p125 :002 > Church.count
=> 9453
1.9.3-p125 :003 > Place.count
=> 6518
@benwbrum
benwbrum / julia_brumfield_1919.tei.xml
Last active December 25, 2015 06:39
Julia Brumfield's 1919 diary exported from FromThePage
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.tei-c.org/ns/1.0 /home/sgmr29/code/digital-austin-papers/tei-2.0.2/xml/tei/custom/schema/xsd/tei_all.xsd " xml:lang="EN" xml:id="APB4051">
<teiHeader>
<fileDesc>
<titleStmt>
<title type="full">
<title type="main">
1919
</title>
<title type="desc">
@benwbrum
benwbrum / zenas_matthews_diary.tei.xml
Last active December 25, 2015 06:39
Zenas Matthews Mexican War diary exported from FromThePage
<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.tei-c.org/ns/1.0 /home/sgmr29/code/digital-austin-papers/tei-2.0.2/xml/tei/custom/schema/xsd/tei_all.xsd " xml:lang="EN" xml:id="APB4051">
<teiHeader>
<fileDesc>
<titleStmt>
<title type="full">
<title type="main">
Z. Matthews' Diary
</title>
<title type="desc">
@benwbrum
benwbrum / problems_with_data_blob.rb
Created October 22, 2013 01:07
Issues with "element_texts" -- I'm considering collapsing these all into the object hash (or perhaps an "attributes" hash declared as an object accessor)
# My challenge is that it's very difficult to get attribute X of an item without
# circling through the "element_texts" array and testing against "element name"
#
#1.9.3p0 :008 > pp client.get_all_collections.first.items.first.title
#NoMethodError: undefined method `title' for #<OmekaClient::OmekaItem:0x00000005b05db0>
# from (irb):8
#
# I suggest that the initialize method cycle through the element_texts, flattening
# them into a hash in which the key is the value of element.name and the value
# is the value of text. See end of gist for algorithm and proposed results
@benwbrum
benwbrum / sedrename
Created April 22, 2014 11:21
sedrename applies a regular expression to rename files
#!/usr/bin/perl -w
use Getopt::Long;
#getopt('pe:', \%options);
GetOptions("p"=>\$pflag,
"e=s"=>\$regex);
@benwbrum
benwbrum / output from autosplit
Created April 22, 2014 14:52
autosplit example
benwbrum@mariecurie:~/dev/clients/delrio/originals/jpg$ ~/dev/products/autosplit/autosplit.rb *.jpg
{:vertical=>false, :line_only=>false, :fudge_factor=>2.0}
spine of Pequeño_cancionero_BNE_01-000.jpg is at 641
{:vertical=>false, :line_only=>false, :fudge_factor=>2.0}
spine of Pequeño_cancionero_BNE_02-000.jpg is at 711
{:vertical=>false, :line_only=>false, :fudge_factor=>2.0}
spine of Pequeño_cancionero_BNE_03-000.jpg is at 667
{:vertical=>false, :line_only=>false, :fudge_factor=>2.0}
spine of Pequeño_cancionero_BNE_04-000.jpg is at 664
{:vertical=>false, :line_only=>false, :fudge_factor=>2.0}
1.9.3-p327 :002 > files=Dir.glob "*.pdf"
=> ["Pequeño_cancionero_BNE_04.pdf", "Pequeño_cancionero_BNE_12.pdf", "Pequeño_cancionero_BNE_02.pdf", "Pequeño_cancionero_BNE_05.pdf", "Pequeño_cancionero_BNE_06.pdf", "Pequeño_cancionero_BNE_22.pdf", "Pequeño_cancionero_BNE_19.pdf", "Pequeño_cancionero_BNE_24.pdf", "Pequeño_cancionero_BNE_10.pdf", "Pequeño_cancionero_BNE_09.pdf", "Pequeño_cancionero_BNE_21.pdf", "Pequeño_cancionero_BNE_16.pdf", "Pequeño_cancionero_BNE_01.pdf", "Pequeño_cancionero_BNE_23.pdf", "Pequeño_cancionero_BNE_18.pdf", "Pequeño_cancionero_BNE_15.pdf", "Pequeño_cancionero_BNE_17.pdf", "Pequeño_cancionero_BNE_25.pdf", "Pequeño_cancionero_BNE_11.pdf", "Pequeño_cancionero_BNE_13.pdf", "Pequeño_cancionero_BNE_20.pdf", "Pequeño_cancionero_BNE_14.pdf", "Pequeño_cancionero_BNE_03.pdf", "Pequeño_cancionero_BNE_08.pdf", "Pequeño_cancionero_BNE_07.pdf"]
1.9.3-p327 :003 > original_path = Dir.pwd
=> "/home/benwbrum/dev/clients/delrio/originals"
1.9.3-p327 :004 > derivative_path = File.join(original_path
@benwbrum
benwbrum / contributions.tsv
Created May 21, 2014 11:15
New pages transcribed by a user who "throttled" her work until more material was available
3 2009-03-13
28 2009-03-14
7 2009-03-15
6 2009-03-18
21 2009-03-19
25 2009-03-20
15 2009-03-22
10 2009-03-23
5 2009-03-24
16 2009-03-25
@benwbrum
benwbrum / quote_2009_05_19.txt
Created May 21, 2014 11:23
Quote by volunteer who throttled back waiting for more material
You're going to laugh, but...I have been transcribing just a few pages at a time lately because I didn't want to finish before the next diary is posted! I didn't want to run out of diary, in other words.
@benwbrum
benwbrum / mongodb_current_op_2014_11_20.json
Created November 20, 2014 17:58
currentOp for slow db
db.currentOp();
{
"inprog" : [
{
"opid" : 10940,
"active" : true,
"secs_running" : 1351,
"microsecs_running" : NumberLong(1351789843),
"op" : "query",
"ns" : "myopic_vicar_development_20141112.search_records",