Skip to content

Instantly share code, notes, and snippets.

Avatar
🧊

tamsin johnson no-reply

🧊
  • UC Santa Barbara Library
  • United States
View GitHub Profile
@no-reply
no-reply / county.py
Created Aug 8, 2012
get county from melissadata
View county.py
#! /usr/bin/python2
''' Takes an address as args and prints the county from MelissaData.com
Usage:
./county.py 1234 Fake Street, Sometown, CA 12345
Works with quotes, too:
@no-reply
no-reply / sed_counties.py
Created Aug 8, 2012
Sedona Public Library's Brand New CSV County Getter
View sed_counties.py
#! /usr/bin/python2 \
''' specify a csv file as a command line argument.
creates a new csv with addresses replaced with counties.
skips users who throw errors and outputs their details to ./err
@no-reply
no-reply / marcrel.rb
Created Nov 26, 2012
MARCRel for Ruby RDF
View marcrel.rb
class MARCRel < RDF::Vocabulary("http://id.loc.gov/vocabulary/relators/")
property :act
property :adp
property :anl
property :anm
property :ann
property :app
property :arc
property :arr
property :acp
@no-reply
no-reply / premis.rb
Created Nov 26, 2012
PREMIS Vocab for Ruby RDF
View premis.rb
##
# PREMIS Vocabulary
#
# @see http://multimedialab.elis.ugent.be/users/samcoppe/ontologies/Premis/premis.owl
class PREMIS < Vocabulary("http://multimedialab.elis.ugent.be/users/samcoppe/ontologies/Premis/premis.owl#")
# Object Properties
property :contentLocation
property :creatingApplication
property :dependency
property :derivationalRelationship
@no-reply
no-reply / lotto.js
Last active Dec 12, 2015
OnlineNW Lotto Name Picker
View lotto.js
var count = 0;
var interId = 0;
function lotto() {
clearInterval(interId);
interId = setInterval("choosename()", 80);
count = 0;
}
function choosename(names) {
View baggable.rb
require 'bagit'
module Hybag
module Baggable
def write_bag(path = '')
raise Exception if self.pid == '__DO_NOT_USE__'
# delete any existing bags before making a new one
self.delete_bag(path)
@no-reply
no-reply / solr2elastic.py
Last active Dec 14, 2015
Tool for moving DSpace Solr statistics to ElasticSearch.
View solr2elastic.py
import solr
import json
from pyes import ES
from progressbar import ProgressBar, Percentage, Bar
types = {
0:"BITSTREAM",
1:"BUNDLE",
2:"ITEM",
3:"COLLECTION",
@no-reply
no-reply / console.txt
Created Mar 21, 2013
archiving tweets to @sendgrid over the last week.
View console.txt
(ENV)tjohnson@alonzo:~/src/twarc$ ./twarc.py '@sendgrid'
(ENV)tjohnson@alonzo:~/src/twarc$ cat '@sendgrid-20130321132859.json' | utils/times.py | uniq -c
4373 2013-03-21
311 2013-03-20
83 2013-03-19
32 2013-03-18
5 2013-03-17
4 2013-03-16
45 2013-03-15
@no-reply
no-reply / @adriarichards_hashtags.txt
Created Mar 22, 2013
hashtags on tweets to @adriarichards for one week through early afternoon Mar. 21, 2013
View @adriarichards_hashtags.txt
1 #1
1 #1984
11 #1re
2 #1reasonwhy
1 #2
1 #2ThingsThatDontMix
1 #3
1 #4
1 #admireyou
2 #adriaFTW
@no-reply
no-reply / bag_import_error.rb
Created Aug 5, 2013
Blobs of bagit-for-hydra stuff
View bag_import_error.rb
module Hybag
class BagImportError < StandardError
end
end