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
@AndiH
AndiH / multimaptest.cpp
Created August 21, 2014 13:08
Small C++ multimap example
// Small example to show working with multimaps
// See cplusplus.com: http://www.cplusplus.com/reference/map/multimap/l
#include <map>
#include <iostream>
int main() {
std::multimap<int, double> mymultimap; // binid, multiplicity
mymultimap.insert(std::pair<int, double>(199, 20.1));
@AndiH
AndiH / panda.sty
Last active August 29, 2015 14:03
PANDA with a beautiful and context-aware bar on top of the P
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{panda}[2014/07/14 PANDAs Name with Style]
% INFO:
% Prints the PANDA experiment's name with a well-looking bar on top of the P
% Works for bold-faced as well italic (slanted)-faced type faces
%
% Created by Andreas Herten, 2014-07-10
% Based on code provided by Enrico Gregorio (egreg) at StackExchange (http://tex.stackexchange.com/a/188725/56326)
%
@AndiH
AndiH / backupThesis.sh
Created July 7, 2014 19:34
Small script for backing up a folder with rsync (to local Dropbox) and gsync (to Google Drive)
#!/usr/bin/env bash
# Backups the local version of my PhD thesis to Dropbox and Google Drive
# Andreas Herten, 2014
main() {
local baseDir="/Users/Andi/Documents/Studium/Promotion/Thesis/LaTeX"
local logFile="thesis.log"
local gDriveTargetDir="Thesis/Backup/"
local gDriveLogfile=$baseDir/"gsync."$logFile
@AndiH
AndiH / README.md
Last active June 3, 2018 16:41
Microtype Examples
@AndiH
AndiH / README.md
Created June 17, 2014 09:39
ROOT Tree/Ntuple Workflow Comparisons

There are different ways of handeling ROOT's NTuple / Trees.

I summarize them in the different methods of analyze.C and compare their performances.
generate.C generates real-looking, though fake data needed to run over with analyze.C.

See my blog post on the results and explanation: LINK.

@AndiH
AndiH / getResolutionOfYouTubeVideo.py
Created May 18, 2014 11:28
Retrieve (max.) resolution of YouTube Video
import urllib2, argparse
from bs4 import BeautifulSoup
def getWidthAndHeight(videoURL):
video = urllib2.urlopen(videoURL)
videoSoup = BeautifulSoup(video)
width = height = 0
for element in videoSoup.find_all('meta'):
if (element.get('property') == 'og:video:width'):
width = int(element.get('content'))
@AndiH
AndiH / graph.py
Created November 22, 2013 13:39
simple pyplot + prettyplotlib example
import numpy as np #numerical stuff
import pylab as pl #for poly line fit
import sys
import prettyplotlib as ppl # makes nicer colors and generally better to look at graphs
from prettyplotlib import plt # This is "import matplotlib.pyplot as plt" from the prettyplotlib library
from prettyplotlib import mpl # This is "import matplotlib as mpl" from the prettyplotlib library
# change font to Open Sans (has some kerning issues, though)
mpl.rcParams.update({'font.family':'Open Sans'})
@AndiH
AndiH / sshvol
Created October 28, 2013 11:44
sshvol – Commandline-mounts a remote ssh volume. Got that from some one who got that from some one who…
#! /bin/bash
# fast mount of home at remote server by its name or alias in .ssh/config
# usage: autosshfs <server-name> (without trailing : or path)
SERVER=$1
MOUNT_DIR=/Volumes
if [[ -z $SERVER ]]; then
echo "usage: sshvol <server-name>[:<server_path>]"
exit 1
@AndiH
AndiH / LaTeX Symbols.csv
Created September 7, 2013 09:00
List of LaTeX symbol to import in aText. Write the LaTeX command prepended by a ; and the text substition inserts the Unicode symbol for this LaTeX character. Based on this list: http://www.cl.cam.ac.uk/~mgk25/ucs/examples/TeX.txt, but expanded (and expandable) -- see comments!
;\aleph
;\forall
;\hbar
;\emptyset
;\exists
;\imath ı
;\nabla
;\neg ¬
;\surd
;\flat
@AndiH
AndiH / allaTextAbbreviations.csv
Last active December 22, 2015 07:19
All my aText abbreviations.
tkvm Thank you very much
ddate 【date:full】
ttime 【time:short】
:-)
(c) ©
(r) ®
(p)
TM
c/o
1/2 ½