Skip to content

Instantly share code, notes, and snippets.

View mjlassila's full-sized avatar

Matti Lassila mjlassila

View GitHub Profile
@mjlassila
mjlassila / export-log-snippet.log
Created September 13, 2018 10:54
Voyager bound records export
This file has been truncated, but you can view the full file.
1107 bound MFHDs found!
Merging records '453393 453394' under a new parent '1'
ERROR: No delimeter found within record:
''!
Use of uninitialized value $nimeke in concatenation (.) or string at Exp/Strategy/BoundRecords.pm line 89.
Use of uninitialized value $boundChildId in concatenation (.) or string at Exp/Strategy/BoundRecords.pm line 89.
453394: Samlingar utgifna af Svenska fornskrift-sällskapet. 2, efter gamla handskrifter af George Stephens och J. A. Ahlstrand. KPStockholm : 1844.
ERROR: No delimeter found within record:
''!
Use of uninitialized value $a in pattern match (m//) at Exp/Strategy/BoundRecords.pm line 110.
@mjlassila
mjlassila / json-attach-external.json
Created May 3, 2018 11:21
Example JSON payload for attaching external HTML files to existing OmekaS items
{
"o:renderer": "html",
"o:is_public": true,
"@type": "cnt:ContentAsText",
"cnt:characterEncoding": "UTF-8",
"o:ingester": "url",
"o:item": {
"@id": "http://omekas:8888/api/items/5500",
"o:id": 5500
},
@mjlassila
mjlassila / omeka-add-html-media.json
Created May 3, 2018 07:09
Example JSON payload for attaching HTML media to existing items in Omeka-S
{
"o:renderer": "html",
"o:is_public": true,
"@type": "cnt:ContentAsText",
"cnt:characterEncoding": "UTF-8",
"o:ingester": "html",
"o:item": {
"@id": "http://omekas:8888/api/items/5500",
"o:id": 5500
},
@mjlassila
mjlassila / export-refworks.phtml
Last active January 18, 2018 13:06
Modified Finna/Vufind Refworks export
<?
function removeAccents( $s)
{
$original_string = $s;
$s = preg_replace( '@\x{00c4}@u' , "%", $s ); // umlaut Ä => AE
$s = preg_replace( '@\x{00d6}@u' , "#", $s ); // umlaut Ö => OE
$s = preg_replace( '@\x{00dc}@u' , "UE", $s ); // umlaut Ü => UE
$s = preg_replace( '@\x{00e4}@u' , "<>", $s ); // umlaut ä => ae
$s = preg_replace( '@\x{00f6}@u' , "><", $s ); // umlaut ö => oe
@mjlassila
mjlassila / xelatex.template
Last active October 22, 2018 12:43
Pandoc xelatex.template for Infomaatiotutkimus-journal
\documentclass[11pt,tandh,b5paper,twoside,openright]{memoir}
\usepackage{polyglossia}
\setdefaultlanguage{finnish}
\setmainlanguage{finnish}
\setotherlanguage[variant=american]{english}
\usepackage{hyphenat}
\usepackage{abstract}
\let\newfloat\undefined
\usepackage{floatrow}
@mjlassila
mjlassila / Factory.php
Last active November 7, 2017 12:02
Upotetun OpenURL-metadatan parannukset Finnaan Mendeleytä yms. varten
<?php
namespace FinnaCustom\RecordDriver;
use Zend\ServiceManager\ServiceManager;
/**
* Record Driver Factory Class
* location: /module/FinnaCustom/src/FinnaCustom/RecordDriver/Factory.php
*
* @category VuFind
@mjlassila
mjlassila / mendeley-bibtex-mapping.md
Created November 3, 2017 10:52
Mendeley document type to Bibtex mapping

Mappings Mendeley uses in Bibtex export.

Mendeley Bibtex
Working Paper unpublished
Web Page misc
Thesis phdthesis
Television Broadcast misc
Statute misc
Report techreport
@mjlassila
mjlassila / marc.js
Last active January 5, 2018 08:35
Modified Zotero MARC importer
{
"translatorID": "a6ee60df-1ddc-4aae-bb25-45e0537be973",
"label": "MARC",
"creator": "Simon Kornblith, Sylvain Machefert",
"target": "marc",
"minVersion": "2.1.9",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 1,
@mjlassila
mjlassila / README.md
Created October 30, 2017 13:39
Running Shinyproxy on OSX

From Shinyproxy issues:

shrektan commented on 29 Aug Hi, I would like to use shinyproxy on OSX.

It seems like the only way to connect to the daemon of Docker For Mac, is using unix:///var/run/docker.sock. However, if I change url to unix:///var/run/docker.sock in application.yml, an error occurs:

Status code: 500 Message: Failed to start container: unknown protocol: unix After some digging, get the workaround that works:

@mjlassila
mjlassila / README.md
Created October 16, 2017 07:13
Using Omeka S Pages API

Endpoint:

http://[site-address]/api/site_pages?key_identity=your-identity&key_credential=your-credential

One can build a complete site using the API, eg. starting first at

http://[...]/api/sites