Skip to content

Instantly share code, notes, and snippets.

View larsgw's full-sized avatar

Lars Willighagen larsgw

View GitHub Profile
@larsgw
larsgw / citation-js_output_test.bib
Created October 30, 2016 13:56
When opening this BibTeX file generated by Citation.js, Mendeley doesn't pick up the year.
@article{Birol2013Assembling,
author={Inanc Birol and Anthony Raymond and Shaun D Jackman and Stephen Pleasance and Robin Coope and Greg A Taylor and Macaire Man Saint Yuen and Christopher I Keeling and Dana Brand and Benjamin P Vandervalk and Heather Kirk and Pawan Pandoh and Richard A Moore and Yongjun Zhao and Andrew J Mungall and Barry Jaquish and Alvin Yanchuk and Carol Ritland and Brian Boyle and Jean Bousquet and Kermit Ritland and John Mackay and Jörg Bohlmann and Steven J M Jones},
doi={10.1093/bioinformatics/btt178},
journal={Bioinformatics},
issue=12,
pages={1492--7},
title={{Assembling the 20 Gb white spruce (Picea glauca) genome from whole-genome shotgun sequencing data}},
volume=29,
year=2013,
}
@larsgw
larsgw / citation-js_csl_to_bib.js
Created October 30, 2016 14:22
Demo of CSL -> BibTeX
var Cite = require('citation-js')
var csl = [
{
id: "Q23571040",
type: "article-journal",
title: "Correlation of the Base Strengths of Amines 1",
DOI: "10.1021/ja01577a030",
author: [
{
@larsgw
larsgw / app.js
Last active January 15, 2017 13:23
Frame function and dependency functions to move a CSS "car"
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 },
@larsgw
larsgw / main.txt
Created May 27, 2017 15:39
cURL https doi.org -> http data crossref.org
$ curl -vILH 'Accept: application/vnd.citationstyles.csl+json' https://doi.org/10.1126/science.169.3946.635
* Hostname was NOT found in DNS cache
* Trying 63.123.152.248...
* Connected to doi.org (63.123.152.248) 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
larsgw / README.md
Last active July 1, 2024 13:53
Citation.js API on Runkit Docs

This is a small API to test the Runkit endpoints.

API syntax

/$DATA/$STYLE/$TYPE

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
larsgw / output.bbl
Created September 14, 2017 16:21
NAR BBL
\bibitem{Rijswijk2017}
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
\bibitem{Diehl2016}
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
\bibitem{Kuhn2017}
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
\bibitem{Mons2011}
@larsgw
larsgw / id.md
Created November 27, 2017 17:02
Testing GitHub Markdown

dataType

dataType {#customId}

@larsgw
larsgw / bibtex.grammar
Created July 19, 2018 21:41
BibTeX PEG.js grammar
// BibTeX Grammar
// ==============
{
const join = array => array.join('')
const toObject = array => array.reduce((object, [key, value]) => {
object[key] = value
return object
}, {})
@larsgw
larsgw / types.json
Created January 1, 2019 14:47
Initial test to create Wikidata <-> CSL mapping
{
"Q571": "book",
"Q922203": "book",
"Q19705": "book",
"Q191067": "article",
"Q59908": "article",
"Q216665": "book",
"Q190399": "pamphlet",
"Q327611": "pamphlet",
"Q1173065": "book",
@larsgw
larsgw / csl-data.json
Created May 2, 2020 14:11
Example CSL-JSON file
[{
"type": "article",
"title": "Example CSL-JSON file",
"author": [{
"family": "Willighagen",
"given": "Lars"
}],
"issued": {
"date-parts": [[2020, 5, 2]]
},