Skip to content

Instantly share code, notes, and snippets.

@ssp
ssp / 10.7
Last active August 29, 2015 14:05
building yaz on Mac OS X
# building on 10.7 from Index Data’s git repository
# Result: yaz builds with ICU
@ssp
ssp / zvdd-sru.text
Created December 16, 2013 15:19
Example for the output formats of the ZVDD SRU interface
This file has been truncated, but you can view the full file.
Z> find Hilbert
Received SRW SearchRetrieve Response
Number of hits: 8414
Elapsed: 0.021573
Z> schema dc
Z> s 1
Received SRW SearchRetrieve Response
Number of hits: 8414
pos=1 schema=dc
<record xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:srw_dc="info:srw/schema/1/dc-schema">
@ssp
ssp / SWIB CouchDB.md
Last active December 29, 2015 08:39
Notes for the hands-on CouchDB workshop at SWIB 13 in Hamburg (2013-11-25).

CouchDB Workshop

at SWIB13 in Hamburg (2013-11-25)

Notes for the hands-on steps done by the participants during the workshop.

  • earthlingsoft / SUB
@ssp
ssp / map.js
Last active December 29, 2015 08:09
CouchDB Map function to output object key paths
function(doc) {
var process = function (item, keyPath) {
if (typeof(item) === 'object' && !isArray(item)) {
for (var i in item) {
newPath = keyPath.slice();
newPath.push(i);
process(item[i], newPath);
}
}
else {
@ssp
ssp / key.xsl
Created September 19, 2013 12:39
An attempt to understand xsl:key and the key() function and why it is not possible to insert the keys into the document itself.
<?xml version="1.0" encoding="UTF-8"?>
<!--
Attempt to use xsl:key on data not stored in the document itself.
We _can_ load external XML into a variable using document() and use
the key() function on that.
We _cannot_ include the XML into our stylesheet and use the key()
function on that.
@ssp
ssp / excel-extract-commands.sh
Last active December 23, 2015 06:39
Script to extract data from some Excel tables and write the data to CSV
find /Volumes/Share/Interimsausleihe/Ruecknahme -name "*xls" -print0 | xargs -0 -I FILE excel-extract.py "FILE" | grep -v "^\w*$" > /Volumes/Share/Porst/LBS-CSV/ruecknahme.csv
find /Volumes/Share/Interimsausleihe/Ausleihe -name "*xls" -print0 | xargs -0 -I FILE excel-extract.py "FILE" | grep -v "^\w*$" > /Volumes/Share/Porst/LBS-CSV/ausleihe.csv
cat /Volumes/Share/Porst/LBS-CSV/ausleihe.csv | csvprintf -s "," '%2$s\n' > /Volumes/Share/Porst/LBS-CSV/ausleihe-barcodes.text
cat /Volumes/Share/Porst/LBS-CSV/ruecknahme.csv | csvprintf -s "," '%1$s\n' > /Volumes/Share/Porst/LBS-CSV/ruecknahme-barcodes.text
cat /Volumes/Share/Porst/LBS-CSV/*barcodes.text | sort | uniq -d > /Volumes/Share/Porst/LBS-CSV/barcode-duplikate.text
@ssp
ssp / ppndownload.sh
Last active December 20, 2015 13:19
Daten für Liste von PPNs runterladen und Daten extahieren
#!/bin/sh
#
# für wenige Datensätze:
#
# als JSON laden
cat ppns-hitliste.text | xargs -L 1 -I PPN /Users/ssp/Developer/sru-loader/sru-loader.py --url http://sru.gbv.de/opac-de-7 --schema picaxml --format json --folderdepth 0 --xsl /Users/ssp/SUB/bin/XSLT/Remove-Namespaces.xsl --xsl /Users/ssp/SUB/bin/XSLT/MarcXML2TurboMarc.xsl 'pica.ppn=PPN*'
# in CouchDB ablegen
find json -print0 | sed -e 's/json\///g' -e 's/\.json//g' | xargs -0 -L 1 -I FILE curl --netrc -X PUT -H "Content-Type: application/json" -d @json/FILE.json http://vlib.sub.uni-goettingen.de/couch/antje-favoriten/FILE
/*
Based on example script for indexing everything from
https://github.com/rnewson/couchdb-lucene
*/
function(doc) {
var result = new Document();
if (!doc._id.match(/^(_design)/)) {
function index(obj, keyPrefix) {
for (var key in obj) {
var value = obj[key];
function(doc, req){
provides('json', function(){
return {'json': doc}
});
provides('html', function(){
var listItem = function (key, value) {
var result = '';
if (key) { result += '<dt>' + key + '</dt><dd>'; }
if (typeof value === 'object') {
@ssp
ssp / .htaccess
Last active December 18, 2015 02:39
webdoc eDiss .htaccess Redirects
This file has been truncated, but you can view the full file.
AddCharset iso-8859-1 .html
# RedirectMatchs für eDiss
# auf Basis der Informationen vom Resolver und Mariannas Handle Liste
#
# Ziele:
# * Redirects für Einstiegsseiten
# * Redirects für die dahinter liegenden PDF Dateien
#
# Probleme: