View imgrename.sh
#!/bin/bash | |
# Rename image files with md5 hash | |
mkdir out | |
for f in *.tif | |
do | |
splt=(${f//_/ }) | |
c=$(cat ${splt[0]}\_${splt[1]}\_* | md5) # 329L_23_* | |
o=${splt[0]}\_${splt[1]}\-${c:0:10}\_${splt[2]} |
View ml.R
library(caret) | |
library(doMC) | |
registerDoMC(cores = 4) # use multiple cores | |
set.seed(1234) | |
col.of.interest <- c( | |
'response', 'A', 'B', 'C' | |
) |
View install-r.sh
#!/bin/bash | |
# This can take a while. Run in a screen environment. | |
# Modify for the version you want to install. | |
RVERSION=3.2.2 | |
sudo apt-get install screen gfortran libreadline6-dev libx11-dev libxt-dev | |
cd ~ |
View bahncard-vs-auto.Rmd
```{r echo = FALSE, results = 'show'} | |
library(knitr) | |
``` | |
# Vergleich Pendeln mit Auto vs. Bahn mit BahnCard 50 | |
```{r} | |
# Fahrten pro Jahr (Wochenenden pro Jahr abzgl. Urlaub/Feiertage) | |
n.fahrten <- (52 - 7) * 2 # Fahrten in eine Richtung |
View gist:4045392
#!/bin/bash | |
# Puts all eps files in folder in figure environment | |
rm figures.tex | |
echo "\documentclass[a4paper,10pt]{article} | |
\usepackage[utf8]{inputenc} | |
\usepackage{graphicx} % support the \includegraphics command and options | |
\usepackage{epstopdf} |
View bbox.sh
#!/bin/bash | |
# This script recalculates all bounding boxes of all eps files in the same folder | |
# requires epstool | |
for f in *.eps | |
do | |
g=$(echo $f | sed 's/\(.*\)\..*/\1/') | |
echo Processing $f ... | |
epstool --copy --bbox $g.eps $g-new.eps | |
done |
View gist:4587442
\documentclass{article} | |
\usepackage{tikz} | |
\usepackage{pgfplots} | |
\usepackage[scaled]{helvet} | |
\usepackage[T1]{fontenc} | |
\usepackage{verbatim} | |
\renewcommand*\familydefault{\sfdefault} %% Only if the base font of the document is to be sans serif |
View gist:4943573
\documentclass{article} | |
\usepackage[scaled]{helvet} | |
\usepackage[T1]{fontenc} | |
\usepackage{verbatim} | |
\usepackage{graphicx} | |
\usepackage{epstopdf} | |
\usepackage[nomarkers,nofiglist,figuresonly]{endfloat} | |
\pagenumbering{gobble} % removes page numbering |
View gist:5070274
def rgb(r,g,b): # Just returns r, g, b in this case. Can be used to reformat RGB values if necessary. | |
return r,g,b | |
def heat(min, max, val, type): # Takes min and max values and the value to be heatmapped. Type is the look up table, see below. | |
min = float(min) | |
max = float(max) | |
val = float(val) | |
val = (val - min) / (max - min) # normalize val to min and max |
View gist:5075213
#!/bin/bash | |
# This script creates eps files from all .gd or .exec files in a directory. | |
if [ ! -d "img/" ]; | |
then | |
mkdir img | |
fi | |
rm img/*-gd.eps | |
touch execfile # Create execfile |
OlderNewer