Skip to content

Instantly share code, notes, and snippets.

View no-reply's full-sized avatar

tamsin woo no-reply

  • UC Santa Barbara Library
  • United States
View GitHub Profile
@no-reply
no-reply / county.py
Created August 8, 2012 21:42
get county from melissadata
#! /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 August 8, 2012 23:02
Sedona Public Library's Brand New CSV County Getter
#! /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 November 26, 2012 23:28
MARCRel for Ruby RDF
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 November 26, 2012 23:38
PREMIS Vocab for Ruby RDF
##
# 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 December 12, 2015 07:08
OnlineNW Lotto Name Picker
var count = 0;
var interId = 0;
function lotto() {
clearInterval(interId);
interId = setInterval("choosename()", 80);
count = 0;
}
function choosename(names) {
@no-reply
no-reply / baggable.rb
Created February 13, 2013 23:39
Some bag code for Hydra. Uses https://github.com/no-reply/bagit
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 December 14, 2015 07:29
Tool for moving DSpace Solr statistics to ElasticSearch.
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 March 21, 2013 20:33
archiving tweets to @sendgrid over the last week.
(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 March 22, 2013 01:52
hashtags on tweets to @adriarichards for one week through early afternoon Mar. 21, 2013
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 August 5, 2013 19:16
Blobs of bagit-for-hydra stuff
module Hybag
class BagImportError < StandardError
end
end