Skip to content

Instantly share code, notes, and snippets.

View larsvilhuber's full-sized avatar

Lars Vilhuber larsvilhuber

View GitHub Profile
@larsvilhuber
larsvilhuber / acrodefs.tex
Created December 20, 2018 16:00
acronyms frequently used by me
%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 December 8, 2018 01:07
Get all files used by a LaTeX compile
#/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 December 29, 2018 18:01
Default biblatex setup
%!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 November 19, 2018 15:32
Re-adjust X11 and touch screen when using laptop and touch screen monitor
#!/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
@larsvilhuber
larsvilhuber / template.tex
Last active December 19, 2018 05:00
LaTeX setup
\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 December 6, 2018 14:34
gitignore for latex
*.aux
*.log
*.nav
*.out
*.snm
*.toc
*.gz
*.blg
*.bbl
*.bcf
@larsvilhuber
larsvilhuber / config.do
Last active November 24, 2020 17:22
A stata config file to store parameters and file paths in a single project-specific location
/* 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 September 10, 2018 12:40
Setup file for Stata
/* 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
@larsvilhuber
larsvilhuber / ced2ar.sh
Created April 17, 2018 20:31
Shell script to start CED2AR desktop app
#!/bin/bash
# now open a browser, after letting Tomcat spin up
echo "
============ CED2AR ===============
To exit CED2AR, hit CTRL-C in the Terminal.
Waiting 10s for Tomcat to start"
@larsvilhuber
larsvilhuber / gitcreate.sh
Created March 26, 2018 18:26 — forked from robwierzbowski/gitcreate.sh
A simple litte script. Create and push to a new github repo from the command line.
#!/bin/bash
# https://gist.github.com/robwierzbowski/5430952/
# Create and push to a new github repo from the command line.
# Grabs sensible defaults from the containing folder and `.gitconfig`.
# Refinements welcome.
# Gather constant vars
CURRENTDIR=${PWD##*/}
GITHUBUSER=$(git config github.user)