This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// converts UNIX seconds into relative format | |
function relativeDate($date) { | |
$secondsago = time() - $date; | |
if ($secondsago <= 59) {$timestamp = "less than a minute ago";} | |
else if ($secondsago <= 119) {$timestamp = floor(($secondsago / 60)) . " minute ago (" . strftime('%R', $date) . ")";} | |
else if ($secondsago <= 3599) {$timestamp = round(($secondsago / 60)) . " minutes ago (" . strftime('%R', $date) . ")";} | |
else if ($secondsago <= 7199) {$timestamp = round(($secondsago / 3600),1) . " hours ago (" . strftime('%a %R', $date) . ")";} | |
else if ($secondsago <= 86400) {$timestamp = round(($secondsago / 3600)) . " hours ago (" . strftime('%a %R', $date) . ")";} | |
else if ($secondsago <= 345600) {$timestamp = round(($secondsago / 86400)) . " days ago (" . strftime('%a %R', $date) . ")";} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- bundle exec jekyll build 2>&1 | tee output.log | |
- grep -i "error" output.log > /dev/null ; test $? -ne 0 # fail if there is an error in output.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:16.04 | |
MAINTAINER tilldettmering@gmail.com | |
RUN apt-get update &&\ | |
apt-get install --no-install-recommends -y \ | |
ksh \ | |
xvfb \ | |
wget &&\ | |
apt-get clean -y && rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(RColorBrewer) | |
brewer.pal(30, "RdYlBu") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{article} | |
\usepackage[scaled]{helvet} | |
\usepackage[T1]{fontenc} | |
\usepackage{verbatim} | |
\usepackage{graphicx} | |
\usepackage{epstopdf} | |
\usepackage[nomarkers,nofiglist,figuresonly]{endfloat} | |
\pagenumbering{gobble} % removes page numbering |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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} |