Skip to content

Instantly share code, notes, and snippets.

View dmj's full-sized avatar

David Maus dmj

View GitHub Profile
@dmj
dmj / dvlinks.rnc
Last active August 29, 2015 14:02
Schema für DFG-Viewer Rechte- und Linkinformationen, METS-Anwendungsprofil Version 2.1
(defun dmaus:make-number-set (list)
(when list
(let ((first (car list))
(index (car list)))
(while (and (cadr list) (= (incf index) (cadr list)))
(setq list (cdr list)))
(cond
((= first (car list))
(cons (format "%d" first) (dmaus:make-number-set (cdr list))))
((= (1+ first) (decf index))
@dmj
dmj / picadump
Created February 10, 2015 09:46
Fetch records via z3950
#!/usr/bin/env php
<?php
function terminate ($message, $code = 1) {
fwrite(STDERR, $message);
fwrite(STDERR, "\nProgramm abgebrochen\n");
exit($code);
}
if (extension_loaded('yaz') !== true) {
namespace local = ""
default namespace ns1 = "http://www.culturegraph.org/metamorph"
namespace ns2 = "http://www.w3.org/2001/XInclude"
start =
constant
| data
| urlencode
| replace
| rules
@dmj
dmj / gist:722f217b060ad36acae5
Created April 13, 2015 13:06
Use ibuffer to access (hidden) WL messages
(defun wl-message-ibuffer-predicate ()
(and (boundp 'wl-message-buffer-cur-folder)
(boundp 'wl-message-buffer-cur-number)
wl-message-buffer-cur-folder
wl-message-buffer-cur-number))
(define-ibuffer-column wl-message-date (:name "Date")
(format-time-string "%Y-%m-%d"
(elmo-message-field (wl-folder-get-elmo-folder wl-message-buffer-cur-folder) wl-message-buffer-cur-number 'date)))
@dmj
dmj / *scratch*
Created December 9, 2009 10:28
emacs vs. zotero
(defun dmj/zotero-export-bibtex ()
"Ask for a search query, export matching items to bibtex."
(interactive)
(require 'moz)
(let* ((query (read-string "Query: "))
(tmpfile (make-temp-name
(expand-file-name "zotemacs" temporary-file-directory)))
(js (list
"var file = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);"
(concat
@dmj
dmj / .wl
Created December 12, 2009 15:14
;; Shimbun
;; Setup Feeds based on ~/.feeds
(let ((feedbuf (find-file-noselect "~/.feeds")))
(with-current-buffer feedbuf
(goto-char (point-min))
(while (re-search-forward "^\\([a\\|r]\\) \\([[:alnum:]]+\\) \\(.+\\)$" nil t)
(let ((sha (sha1-string (match-string 3))))
(cond
((equal (match-string 1) "a")
(add-to-list 'shimbun-atom-hash-group-path-alist
@dmj
dmj / psi-explain.xsl
Created September 30, 2011 11:35
Translate Pica PSI response to SRU response
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:explain="http://explain.z3950.org/dtd/2.0/"
xmlns:zs="http://www.loc.gov/zing/srw/"
version="1.0">
<xsl:output indent="yes" method="xml"/>
<xsl:param name="host" select="''"/>
<xsl:param name="port" select="''"/>
<xsl:param name="database" select="''"/>
@dmj
dmj / wl-auto-config.el
Created November 13, 2011 20:36 — forked from egh/wl-auto-config.el
wl auto config
;; Copyright 2011 Erik Hetzner
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@dmj
dmj / gist:2357640
Created April 11, 2012 07:40
Compare vanilla VuFind SOLR schema.xml to custom schema.xml
<?php
if (count($argv) != 3) {
die();
}
function load_schema ($path)
{
if (!file_exists($path)) {
die();