Skip to content

Instantly share code, notes, and snippets.

View nuest's full-sized avatar

Daniel Nüst nuest

View GitHub Profile
@nuest
nuest / switching-from-XML-to-xml2.md
Last active March 6, 2024 17:07
Switching an R package from XML to xml2

Switching from XML to xml2

Rationale

The R package XML for parsing and manipulation of XML documents in R is not actively maintained anymore, but used by many:

The R package xml2 is an actively maintained, more recent alternative.

This file documents useful resources and steps for moving from XML to xml2.

@nuest
nuest / add_to_sty_file.sty
Created November 6, 2019 10:11
ORCID for LaTeX and R Markdown
% easy adding of ORCiDs
\usepackage{scalerel}
\usepackage{tikz}
\usetikzlibrary{svg.path}
\definecolor{orcidlogocol}{HTML}{A6CE39}
\tikzset{
orcidlogo/.pic={
\fill[orcidlogocol] svg{M256,128c0,70.7-57.3,128-128,128C57.3,256,0,198.7,0,128C0,57.3,57.3,0,128,0C198.7,0,256,57.3,256,128z};
\fill[white] svg{M86.3,186.2H70.9V79.1h15.4v48.4V186.2z}
svg{M108.9,79.1h41.6c39.6,0,57,28.3,57,53.6c0,27.5-21.5,53.6-56.8,53.6h-41.8V79.1z M124.3,172.4h24.5c34.9,0,42.9-26.5,42.9-39.7c0-21.5-13.7-39.7-43.7-39.7h-23.7V172.4z}
@nuest
nuest / README.md
Created December 13, 2018 16:16
Lessons learned on Zenodo development

Zenodo local dev environment

Usage

NB: The environment is manged by virtualenvwrapper.

  1. start required services
cd zenodo
@nuest
nuest / Dockerfile.aptified
Created November 9, 2018 06:44
Some exploration of improving stencila/r installation time during Docker build
FROM buildpack-deps:bionic
# avoid prompts from apt
ENV DEBIAN_FRONTEND=noninteractive
# Set up locales properly
RUN apt-get update && \
apt-get install --yes --no-install-recommends locales && \
apt-get purge && \
apt-get clean && \
@nuest
nuest / sf-hexagon-with-sf.R
Created January 11, 2018 14:17
sf hexagon sticker with sf
library("sf")
library("dplyr")
library("hexbin")
# Linux libertine fint "sf", converted to path with Inkscape,
# added points between existing points 2 times, then turned all segments into straight lines.
# Saved as SVG with absolute coordinates (Preferences > SVG Output > Path Data).
# Loaded coords from SVG source code, remove letters from start and end, and replace " " with ","
coords_f <- c(218.1169,163.46992,215.56952,177.96334,213.51976,189.84421,211.82546,200.33884,210.34442,210.67351,208.24728,226.35176,205.51032,243.54066,201.92029,259.27223,197.26391,270.57846,195.45112,272.90665,193.28288,274.70167,190.97247,275.85687,188.73314,276.26564,187.03291,276.03164,185.79476,275.38887,184.84097,274.42619,183.99382,273.23248,182.45947,271.13533,180.24976,269.10927,177.54243,267.58084,174.51519,266.97658,171.25987,267.58973,169.08867,269.18036,167.87718,271.37526,167.501,273.8012,168.44294,277.0032,171.48203,279.79643,176.93817,281.77214,185.13126,282.52154,191.01986,281.80176,196.83737,279.60686,202.29944,
@nuest
nuest / README.md
Created March 27, 2017 10:55 — forked from LukasLohoff/README.md
Userscript adding a "upload to o2r" button to sciebo(owncloud)

"Upload to O2R" - Userscript for Sciebo

Requirements

  • Firefox or Chrome Web Browser

Installation

  1. Install a browser extension to support userscripts
@nuest
nuest / README.md
Created March 27, 2017 10:55 — forked from LukasLohoff/README.md
Userscript adding a "Upload to O2R" button to Zenodo / Zenodo Sandbox.

"Upload to O2R" - Userscript for Zenodo

Requirements

  • Firefox or Chrome Web Browser

Installation

  1. Install a browser extension to support userscripts

Keybase proof

I hereby claim:

  • I am nuest on github.
  • I am nuest (https://keybase.io/nuest) on keybase.
  • I have a public key ASBxwfo24TFffn2oV3Jt8sorK8304OcIhht_XHURsd94Wwo

To claim this, I am signing this object:

@nuest
nuest / example.js
Created August 8, 2016 08:21 — forked from JanKoppe/example.js
Passport.js and ORCiD.org
/*
* Example for authenticationg against the ORCiD.org Public API with
* passport.js and retrieving the authenticated orcid.
*
* The main difficulty is that ORCiD.org will send the authenticated orcid
* in the accessToken request, which is normally not passed on to the
* passport.js-callback. Without the orcid, properly authenticating with
* ORCiD.org is impossible though.
*
* The trick is to pass on the `passReqToCallback`-option to the
@nuest
nuest / contribute.md
Last active December 26, 2015 19:19
Contribute.md for 52°North

This is the contribute.md of 52°North project NAME. Great to have you here! Here are a few ways you can help!

Contribute.md

Learn & listen

Best way to get started is to start with these: