Skip to content

Instantly share code, notes, and snippets.

View AndiH's full-sized avatar
🤖
q|^_^|p

Andreas Herten AndiH

🤖
q|^_^|p
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AndiH
AndiH / fauxshell.tex
Created August 23, 2017 08:56
LaTeX Fauxshell
% See: https://tex.stackexchange.com/a/387460/56326
% \usepackage[minted]{tcolorbox}
% \tcbuselibrary{skins}
\definecolor{topbar}{RGB}{220,220,220}
\definecolor{main}{RGB}{30,30,30}
\definecolor{quit}{RGB}{248,73,73}
\definecolor{min}{RGB}{252,182,37}
\definecolor{max}{RGB}{41,198,52}
\colorlet{offwhite}{white!96!black}
\newtcblisting{fauxshell}{%
@AndiH
AndiH / Pandas-Analysis.ipynb
Created May 11, 2017 22:21
Data Analysis with Python 101/2
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AndiH
AndiH / cuda-error-macro.F90
Created February 3, 2017 13:43
Error-Handling Macros for CUDA C/C++ and CUDA Fortran
#define CUDA_SUCCESS 0
#define CUDA_CALL__(e,fmt,c) \
e=c; \
if(e/=CUDA_SUCCESS) \
write(*,fmt) "CUDA Error ",e," in ",__FILE__,":",__LINE__,": ",trim(cudaGetErrorString(e))," (",#c,")"
#define CUDA_CALL(c) CUDA_CALL__(gpuStatus,fmt,c)
module debug
character(len=27) :: fmt = "(A,I0,A,A,A,I0,A,A,A,A,A,A)"
integer :: gpuStatus
@AndiH
AndiH / slidenotes.tex
Created October 19, 2016 08:08
Snippet for adding speaker notes to a LaTeX Beamer presentation
\tikzset{
notes box/.style={
anchor=north,
fill=white,
text width=0.98\paperwidth,
outer sep=0pt,
font=\relsize{-2}
},
notes box additional/.style={},
notes box title/.style={
@AndiH
AndiH / Makefile
Last active May 10, 2016 08:52
Fortran Makefile Boilerplate
FC = pgfortran
FCFLAGS += -Minfo=all
SOURCE=thebinary.F90
# BINARY=$(patsubst %.F90, %.bin, $(SOURCE)) # Alternative: Instead of calling it manually `thebinary.bin`, use $(BINARY). This is not resolved by my command line tab autocompliation, hence I rather not do it
DEPENDENCIES=a.o b.o c.o
.PHONY: all
all: message thebinary.bin
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// ==UserScript==
// @name Beautify danluu.com
// @namespace http://danluu.com/
// @description Beautifies Dan Luu's website, because it's plain text
// @version 0.1
// @include http://danluu.com/*
// @grant doCSS
// ==/UserScript==
@AndiH
AndiH / .latexmkrc
Created January 25, 2016 14:05
One current .latexmkrc steering configuration file
$ENV{'TEXINPUTS'}=':.//:./__include/theme/juelich2/:'; # set environment variable to steer pdflatex to use also the __include directory
$recorder = 1; # try to use the .fls to notice changed files
$pdf_mode = 1; # generate PDFs, not DVIs
# $bibtex_use = 2; # run BibTeX/biber when appears necessary
$pdflatex = "pdflatex --shell-escape %O %S"; # add shell-escape
$pdf_previewer = "open -a /Applications/Skim.app %O %S"; # actually only important if in continuous preview mode, -pvc
$clean_ext = 'nav snm vrb'; # also clean those extensions when invoking latexmk -c
## The following is for glossaries
# add_cus_dep('glo', 'gls', 0, 'run_makeglossaries');
@AndiH
AndiH / run.py
Created January 25, 2016 14:00
Run script for Markdown —Pandoc&latexmk→ PDF Beamer presentation generation
#!/usr/bin/env python
# Small script to call Pandoc and latexmk
# Andreas Herten, Jan 2016
import argparse, subprocess, os
if __name__ == '__main__':
parser = argparse.ArgumentParser(description = "Run LaTeX generation", prefix_chars="-+")
parser.add_argument("-v", "--verbose", action="count", help="Turns on verbose for latexmk (-v) and verbose for pandoc (-vv)")