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
\usepackage{color, soul} | |
% allow highlighting reference | |
\soulregister\cite7 | |
\soulregister\ref7 | |
\soulregister\pageref7 | |
% comment out one of the two: | |
\newcommand{\markasnew}[1]{\hl{#1}} % highlight | |
%\newcommand{\markasnew}[1]{{#1}} % don't highlight |
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
import os # walking through file system | |
import sys # command lines arguments | |
import wave # for reading .wav files | |
# Turn number of seconds (int) to '[minutes] min [seconds] s' (string) | |
def seconds2timestr(time_in_seconds): | |
if time_in_seconds is not None: | |
time_in_minutes = int(time_in_seconds/60) | |
remaining_seconds = int(time_in_seconds%60) | |
return str(time_in_minutes) + "min " + str(remaining_seconds) + "s" |
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
#!/usr/bin/env | |
for f in *.png; do | |
convert ./"$f" ./pdf/"${f%.png}.pdf" | |
echo "Converting "$f" to ""${f%.png}.pdf" | |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import os # for getting files from directory | |
import sys # for accessing command line arguments | |
# Command line arguments | |
assert len(sys.argv)<4, "batchrename takes at most 1 command line argument\n"+\ | |
"Use: python batchrename.py [folder_name]" |
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
\usepackage{hyperref} | |
% Make clickable footnote | |
\newcommand{\hyperfootnote}[1][]{\def\ArgI{{#1}}\hyperfootnoteRelay} | |
% relay to new command to make extra optional command possible | |
\newcommand\hyperfootnoteRelay[2][]{\href{#1#2}{\ArgI}\footnote{\href{#1#2}{#2}}} | |
% the first optional argument is now in \ArgI, the second is in #1 | |
% Takes at most 3 parameters (see http://www.tex.ac.uk/FAQ-twooptarg.html for info on multiple optional parameters) | |
% If first parameter isn't given, it's value is '' (empty string in text before footnote reference) |
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
# -*- coding: UTF-8 -*- | |
# Copyright 2015 Brecht De Man | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |