Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mstrehler's full-sized avatar

Marco Strehler mstrehler

  • Switzerland
View GitHub Profile
@mstrehler
mstrehler / vip-vimrc.txt
Created May 8, 2016 07:28
vim command abbrev (cabbrev) for "vim in der Praxis"
" Folgende Abkürzung dient dazu, die Uebungdsatein aus dem Buch
" "Vim in der Praxis" schneller in den Buffer zu laden.
" Dazu mit ":" in den Command-Modus wechseln, "vip<space>" und
" noch die entsprechende Dateiangabe aus dem Buch ergänzen.
" Wichtig dabei ist, dass als Abkürzungs-Trigger nicht ein Space,
" sondern der Slash benutzt wird, dann kann der Rest des Pfades
" gleich eingfügt werden.
" Richtig Trigger Slash-> Resultat: .../vip/x (x=Curserposition)
" Falsch Trigger Space -> Resultat: .../vip x
:cabbrev vip edit ~/Documents/vip
@mstrehler
mstrehler / rsyncd.conf
Created March 22, 2016 09:59
rsync daemon configuration
# Global Part
log file = /var/log/rsync.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
# The RSYNC_USER_NAME environment variable may be used to request that rsync run as the authorizing user.
# If you want a rsync to run as the same user that was received for the rsync authentication, this setup is useful:
uid = %RSYNC_USER_NAME%
gid = *
@mstrehler
mstrehler / Makefile
Created March 22, 2016 09:23
the snippet checks for the existence of a file from within a Makefile.
# from make documentation.
# $(wildcard pattern): 'pattern' is a file name pattern [...].
# The result of wildcard is a space-separated
# list of the names of existing files that match the pattern.
path2file = test.txt
ifneq ("$(wildcard $(path2file))","")
fileexists = 1
else
@mstrehler
mstrehler / makefile_var_handling
Last active March 5, 2016 08:23
Flexible handling of variables in a makefile
# Example for the ultimate flexible variable handling in a makefile.
# Code adapted from "The GNU Make Book", pos. 300 (e-book).
#
# Case 1: Default in makefile
# With no environment variable and no option set in command line,
# TEST contains foo:
# $ make
# foo file
#
# Case 2: Environment variable
@mstrehler
mstrehler / latex_Makefile
Created March 3, 2016 11:49 — forked from hmaarrfk/latex_Makefile
Latex makefile
doc=your_document_name
name=$(doc)
BUILD=build
FIGS_DIR=figs
TARGET=$(doc).pdf
TOPSOURCE=$(doc).tex
@mstrehler
mstrehler / .git_commit_msg.txt
Last active March 2, 2016 09:33 — forked from danielfilho/.git_commit_msg.txt
Template for commit messages.
# If this commit is applied, it will ...
# Why was this change made?
# Any references to tickets, articles etc?
@mstrehler
mstrehler / .gitignore_global
Created February 29, 2016 20:26
A .gitignore_global file for LaTeX projects with MacOS
# .gitignore_global for LaTeX projects with MacOS
# v1.0
#
# To add run in terminal
# git config --global core.excludesfile ~/.gitignore_global
#
# Thanks to:
# https://gist.github.com/rbochet/871983
# https://gist.github.com/octocat/9257657
#
@mstrehler
mstrehler / markerfolding.bib
Created February 4, 2016 09:38
Marker-Folding für vim (Beispiel für ein bib-File)
% Beispiel für Marker-Folding (hier ein BibTex-File *.bib)
% Die Datei enthält Ende eine Modline, die die foldmethod setzt
% (=marker). Die gefoldeten Anteile müssen in dreifache geschweifte Klammern
% gesetzt werden {{{ }}}. Auskommentierungen werden ignoriert.
% Vim-Befehle: Mit zo wird der Fold geöffnet, mit zc geschlossen.
% zM schliesst alle Folds, egal
% wo der Cursor sich befindet, zR öffnet alle.
% String-Definitionen {{{
@mstrehler
mstrehler / literatur.bib
Created February 4, 2016 07:34
Definition und deutsch-englische Übersetzung des Referenz-Typs für bib-File
% Die folgenden Strings sind Uebersetzung der englischen Ausdrücke zur
% Identifikation der Referenz. Siehe dazu APA Syle Guide Electronic Reference,
% Pos. 205. Sie müssen mit dem Tag 'type' eingebunden werden. Sie erscheinen
% dann mit apacite wie vorgegeben in eckigen Klammern.
% Mit Auskommentierung kann so einfach zwischen Deutsch u. englischem
% Literaturverzeichnis umgeschaltet werden.
% Englisch
@STRING(apparatus = "Apparatus and data file")
@STRING(audio = "Audio file")