Skip to content

Instantly share code, notes, and snippets.

View rwoeber's full-sized avatar

Richard Wöber rwoeber

  • Würzburg, Germany
View GitHub Profile
@rwoeber
rwoeber / Dockerfile
Last active October 12, 2022 07:03
Alpine-Dockerfile with LaTex installed
FROM alpine:3.15.0
RUN apk update
RUN apk upgrade
RUN apk add --no-cache perl wget fontconfig freetype
# run install-tl to generate a profile
@rwoeber
rwoeber / sudo.zsh
Created November 25, 2021 13:24
Use Touch ID for Sudo on Mac (and survive system updates)
# source https://news.ycombinator.com/item?id=26302139
sudo() {
unset -f sudo
if [[ "$(uname)" == 'Darwin' ]] && ! grep 'pam_tid.so' /etc/pam.d/sudo --silent; then
sudo sed -i -e '1s;^;auth sufficient pam_tid.so\n;' /etc/pam.d/sudo
fi
sudo "$@"
}
@rwoeber
rwoeber / get_latest_release.sh
Created April 3, 2021 18:22 — forked from lukechilds/get_latest_release.sh
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@rwoeber
rwoeber / installed_apps.sh
Created August 26, 2019 06:08
List All Apps Downloaded from the Mac App Store via Command Line
find /Applications -path '*Contents/_MASReceipt/receipt' -maxdepth 4 -print |\sed 's#.app/Contents/_MASReceipt/receipt#.app#g; s#/Applications/##'
# even more detail:
system_profiler -xml SPApplicationsDataType
@rwoeber
rwoeber / destructuring.md
Created December 10, 2018 14:44 — forked from yang-wei/destructuring.md
Elm Destructuring (or Pattern Matching) cheatsheet

Should be work with 0.18

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
@rwoeber
rwoeber / config.cson
Created April 5, 2016 06:44
Fix "Erlang home configuration setting missing" in atom
"*":
"autocomplete-elixir":
elixirPath: "/usr/local/bin"
erlangHome: "/usr/local/bin"
core:
themes: [
"atom-dark-ui"
"base16-tomorrow-dark-theme"
]
editor:
@rwoeber
rwoeber / menu.html
Created March 16, 2016 12:12 — forked from jgoyon/menu.html
Horizontal menu, full width sub menu
<div id="menu">
<ul id="nav">
<li><a href="#">Menu 1</a>
<ul>
<li><a href="#">Menu 1 Submenu item 1</a></li>
<li><a href="#">Menu 1 Submenu item 2</a></li>
<li><a href="#">Menu 1 Submenu item 3</a></li>
</ul>
</li>
@rwoeber
rwoeber / glyps.tex
Created February 25, 2016 13:34
Table of glyphs with XeTeX
% via http://tex.stackexchange.com/questions/23863/generating-a-table-of-glyphs-with-xetex
\documentclass[landscape]{article}
\usepackage{geometry}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}
\usepackage{multicol}
\setlength{\columnseprule}{0.4pt}
\usepackage{multido}
\setlength{\parindent}{0pt}
\begin{document}
@rwoeber
rwoeber / .latexmkrc
Last active February 25, 2016 07:15 — forked from davegurnell/.latexmkrc
Sample latexmk file to provide continuous compilation and preview with MacTex on OS X
# Sample latexmk configuration to use xelatex and Preview on OS X.
# Should help if you want to use latexmk with MacTeX.
#
# 1. Install MacTeX
# 2. Put this file in ~/.latexmkrc
# 3. Continuously recompile and preview your document with the command:
# latexmk -pvc myfile.tex
$pdflatex = 'xelatex -interaction=nonstopmode %O %S';
$pdf_previewer = 'open -a Preview "%S"';
@rwoeber
rwoeber / mix.exs
Created January 16, 2016 15:56 — forked from jeffweiss/mix.exs
Retrieving application version number in mix.exs from git describe
defmodule MyApp.Mixfile do
use Mix.Project
def project do
[app: :my_app,
version: get_version,
elixir: "~> 1.0",
elixirc_paths: elixirc_paths(Mix.env),
compilers: Mix.compilers,
build_embedded: Mix.env == :prod,