Skip to content

Instantly share code, notes, and snippets.

Lars Vilhuber larsvilhuber

Block or report user

Report or block larsvilhuber

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View global-libraries.R
####################################
# global libraries used everywhere #
####################################
# Package lock in - optional
MRAN.snapshot <- "2019-01-01"
options(repos = c(CRAN = paste0("https://mran.revolutionanalytics.com/snapshot/",MRAN.snapshot)))
pkgTest <- function(x)
{
if (!require(x,character.only = TRUE))
View Uploading to repositories
figshare: https://github.com/elifesciences/datacapsule-crossref
zenodo: https://developers.zenodo.org/#quickstart-upload
dataverse: https://github.com/IQSS/dataverse-uploader/wiki/DVUploader,-a-Command-line-Bulk-Uploader-for-Dataverse
@larsvilhuber
larsvilhuber / acrodefs.tex
Created Dec 20, 2018
acronyms frequently used by me
View acrodefs.tex
%TCIDATA{Version=5.00.0.2570}
%TCIDATA{LaTeXparent=0,0,sw-edit.tex}
% $Id: acronyms.tex 11537 2014-05-27 03:52:54Z vilhuber $
% $URL: https://trac.vilhuber.org/svn/LEHD/branches/ticket983-snapshot2012/05_documentation/acronyms.tex $
%
% Define acronyms to be used in the text here. See
% http://www.mackichan.com/index.html?techtalk/456.htm~mainFrame for usage in
% Scientific workplace context
@larsvilhuber
larsvilhuber / latex-files.sh
Created Dec 8, 2018
Get all files used by a LaTeX compile
View latex-files.sh
#/bin/sh
# from https://tex.stackexchange.com/questions/24542/create-list-of-all-external-files-used-by-master-latex-document
# use the perl script mkjobtexmf available with every TeX distribution and run it like
latex_file=test
mkjobtexmf --jobname $latex_file --cmd-tex pdflatex
#
#it creates an file <latex file>.fls which shows all used files, e.g. for a testfile named latex6:
#
#PWD /home/voss/Documents
#INPUT /usr/local/texlive/2011/texmf.cnf
@larsvilhuber
larsvilhuber / biblatex-doc.tex
Last active Dec 29, 2018
Default biblatex setup
View biblatex-doc.tex
%!TeX TXS-program:bibliography = txs:///biber
\documentclass{article}
\usepackage{authblk}
\usepackage[%
plainpages,%
colorlinks,% removes the boxes around links
urlcolor=black,%
filecolor=black,%
citecolor=Blue,% requires xcolor with option dvipsnames
pdfpagemode=UseOutlines,%
@larsvilhuber
larsvilhuber / remap_dell.sh
Created Nov 19, 2018
Re-adjust X11 and touch screen when using laptop and touch screen monitor
View remap_dell.sh
#!/bin/bash
# get Wacom IDS
[[ -z $1 ]] && undo= || undo=yes
WACOM_IDS=$(xinput --list | grep "Wacom" | awk -F= '{ print $2 } ' | awk ' { print $1 } ')
# get device
INTERNAL=LVDS1
for arg in $WACOM_IDS
do
xinput --map-to-output $arg $INTERNAL
done
View template.tex
\usepackage{etoolbox}
\usepackage{geometry}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{versions}
\usepackage{placeins} % for \FloatBarrier
\usepackage{setspace}
\newcommand{\red}{\color{red}}
\newcommand{\blue}{\color{blue}}
\newcommand{\green}{\color{green}}
@larsvilhuber
larsvilhuber / .gitignore
Last active Dec 6, 2018
gitignore for latex
View .gitignore
*.aux
*.log
*.nav
*.out
*.snm
*.toc
*.gz
*.blg
*.bbl
*.bcf
@larsvilhuber
larsvilhuber / config.do
Last active Jun 8, 2019
A stata config file to store parameters and file paths in a single project-specific location
View config.do
/* config.do */
/* Suggested by Lars Vilhuber */
/* Create a reproducible Stata sequence by calling this program from every other program in your sequence */
/* Get it at: https://gist.github.com/larsvilhuber/6bcf4ff820285a1f1b9cfff2c81ca02b */
/* Usage:
Adapt to your needs, save as config.do, then add
include "config.do"
in the author's main Stata program
*/
@larsvilhuber
larsvilhuber / 00_setup.do
Last active Sep 10, 2018
Setup file for Stata
View 00_setup.do
/* 00_setup.do */
/* Suggested by Lars Vilhuber */
/* Create a reproducible Stata sequence by running this file as the first part of the program sequence */
/* Get it at https://gist.github.com/larsvilhuber/8ead0ba85119e4085e71ab3062760190 */
/* install any packages locally */
// Make a path local to the project
// Also see my related config.do at https://gist.github.com/larsvilhuber/6bcf4ff820285a1f1b9cfff2c81ca02b
local pwd "/c/path/to/project"
capture mkdir `pwd'/ado
You can’t perform that action at this time.