Skip to content

Instantly share code, notes, and snippets.

larsgw / prior_art.csv
Last active Jun 21, 2021
Identification resource file formats
View prior_art.csv
name url features notes
Structured Descriptive Data (SDD) No clear documentation, especially how to use it for identification keys
LIF3 No notable official documentation at all, used mainly (only?) by expensive application
NBIC's identification key widget data model Matrix/dichotomous keys, subsets, morphs, multiple levels Standardised but usage is specific to Norway (and Norwegian Biodiversity Information Centre even)
Artfakta artnycklar JSON format Matrix/dichotomous keys, ??? Ostensibly only used internally
Soortzoekers JSON format Matrix keys, morphs/subets (?), multiple levels Ostensibly only used internally
DELTA Matrix/dichotomous keys, no media Not entirely s
larsgw / issn.js
Last active Jun 17, 2021
Reversible ISSNs
View issn.js
const fs = require('fs').promises
const path = require('path')
async function main () {
const file = await fs.readFile(path.join(__dirname, 'Downloads/issns.csv'), 'utf8')
const issns = new Set(file.trim().split('\n').slice(1))
const printed = new Set()
for (const issn of issns) {
if (printed.has(issn)) continue
const [a, b] = issn.split('-')
larsgw / csl-data.json
Created May 2, 2020
Example CSL-JSON file
View csl-data.json
"type": "article",
"title": "Example CSL-JSON file",
"author": [{
"family": "Willighagen",
"given": "Lars"
"issued": {
"date-parts": [[2020, 5, 2]]
larsgw / types.json
Created Jan 1, 2019
Initial test to create Wikidata <-> CSL mapping
View types.json
"Q571": "book",
"Q922203": "book",
"Q19705": "book",
"Q191067": "article",
"Q59908": "article",
"Q216665": "book",
"Q190399": "pamphlet",
"Q327611": "pamphlet",
"Q1173065": "book",
larsgw / bibtex.grammar
Created Jul 19, 2018
BibTeX PEG.js grammar
View bibtex.grammar
// BibTeX Grammar
// ==============
const join = array => array.join('')
const toObject = array => array.reduce((object, [key, value]) => {
object[key] = value
return object
}, {})
larsgw /
Created Nov 27, 2017
Testing GitHub Markdown


dataType {#customId}

View output.bbl
1. van Rijswijk,M., Beirnaert,C., Caron,C., Cascante,M., Dominguez,V., Dunn,W.B., Ebbels,T.M.D., Giacomoni,F., Gonzalez-Beltran,A., Hankemeier,T., {\em et al.,} (2017) The future of metabolomics in ELIXIR. {\em F1000Research,}, {\bf 6}, 1649+. undefined
2. Diehl,A.D., Meehan,T.F., Bradford,Y.M., Brush,M.H., Dahdul,W.M., Dougall,D.S., He,Y., Osumi-Sutherland,D., Ruttenberg,A., Sarntivijai,S., {\em et al.,} (2016) The Cell Ontology 2016: enhanced content, modularization, and ontology interoperability. {\em J Biomed Semantics,}, {\bf 7}. undefined
3. Kuhn,T., Willighagen,E., Evelo,C., Queralt-Rosinach,N., Centeno,E. and Furlong,L.I. (2017) Reliable Granular References to Changing Linked Data. In {\em The Semantic Web – ISWC 2017,}. undefined
larsgw /
Last active Jul 23, 2017
Citation.js API on Runkit Docs

This is a small API to test the Runkit endpoints.

API syntax


Where $DATA is input data, $STYLE is output style and $TYPE is output type. For documentation on output style and type, see the Citation.js docs.

larsgw / main.txt
Created May 27, 2017
cURL https -> http data
View main.txt
$ curl -vILH 'Accept: application/vnd.citationstyles.csl+json'
* Hostname was NOT found in DNS cache
* Trying
* Connected to ( port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
larsgw / app.js
Last active Jan 15, 2017
Frame function and dependency functions to move a CSS "car"
View app.js
function deg(a){return a*(180/Math.PI);}
function rad(a){return a*(Math.PI/180);}
function sin(a){return Math.sin(rad(a))}
function cos(a){return Math.cos(rad(a))}
function tan(a){return Math.tan(rad(a))}
function asin(a){return deg(Math.asin(a))}
function acos(a){return deg(Math.acos(a))}
function atan(a){return deg(Math.atan(a))}
var mov = { w:0,a:0,s:0,d:0,i:0,k:0,t:0,f:0,g:0,h:0 },