This file contains hidden or 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
% scientific abbreviations made easy | |
\newcommand{\compare}[2]{\cite[cf. #2]{#1}} | |
\newcommand{\page}[2]{\cite[p.#2]{#1}} | |
\newcommand{\pageF}[2]{\cite[p.#2 et seq.]{#1}} | |
\newcommand{\pageFF}[2]{\cite[p.#2 et seqq.]{#1}} | |
% example call | |
% \pageFF{my_source_key}{43} |
This file contains hidden or 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 python | |
from sh import git | |
def main(): | |
print "before:" | |
print git('br') | |
for br in git('br', '--no-color'): | |
br = br.strip() | |
if "master" in br: continue |
This file contains hidden or 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 multiprocessing import Pool, cpu_count | |
def multi_process_map(fn, args): | |
'''Applyes function fn to each element in args running in a seperate process. | |
This will block until all function calls are finished. | |
This uses a process pool, which size equals the number of available cpu's. | |
fn: a funtion that takes one argument | |
args: a list of arguments to that function |
This file contains hidden or 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 time | |
def timeit(method): | |
def timed(*args, **kw): | |
ts = time.time() | |
result = method(*args, **kw) | |
te = time.time() | |
print '%r (%r, %r) %2.2f sec' % \ |
This file contains hidden or 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
$(document).keypress(function(e) { | |
var element; | |
switch (e.keyCode) { | |
case 119: // W | |
element = $('#up'); | |
break; | |
case 97: // A | |
element = $('#left'); | |
break; | |
case 115: // S |
This file contains hidden or 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
// add this line to your sublime config | |
"file_exclude_patterns": ["*.aux", "*.bbl", "*.blg", "*.fdb_latexmk", "*.fls", "*.out", "*.synctex.gz", "*.DS_Store", "*.pdf"] |
This file contains hidden or 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 | |
help="usage: coffee-mashine coffe-source-dir compile-dir" | |
if [ ! $1 ] | |
then | |
echo "coffe-source-dir is missing" | |
echo $help | |
exit 1 | |
fi |
This file contains hidden or 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 | |
#thanks to http://blog.walkingsmarts.com/twitter-client-in-3-bash-lines/ | |
read -s pass | |
url="http://eimantas:[email protected]/statuses/update.xml" | |
curl -d "status=$*" $url |
This file contains hidden or 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
07-28 20:26:05:202 csync.owncloud - Authentication required | |
07-28 20:26:05:202 csync.owncloud - Call the csync callback for ownCloud | |
07-28 20:26:05:817 csync.owncloud - Skipping target resource. | |
07-28 20:26:05:817 csync.owncloud - Simple propfind OK. | |
07-28 20:26:05:817 csync.owncloud - opendir returning handle 0x7fec5a461390 | |
07-28 20:26:05:817 csync.owncloud - closedir method called 0x7fec5a461390! | |
07-28 20:26:05:817 csync.owncloud - => open called for owncloud://apps.moinz.de/own-cloud/files/webdav.php/clientsync/csync_timediff.ctmp | |
07-28 20:26:05:817 csync.owncloud - Stating directory owncloud://apps.moinz.de/own-cloud/files/webdav.php/clientsync | |
07-28 20:26:05:817 csync.owncloud - owncloud_stat owncloud://apps.moinz.de/own-cloud/files/webdav.php/clientsync called | |
07-28 20:26:05:817 csync.owncloud - I have no stat cache, call propfind for /own-cloud/files/webdav.php/clientsync. |
This file contains hidden or 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 is Mac specific! | |
# It installes the latest nightly build of XBMC. | |
# Have fun. Take a look at https://github.com/Velrok/scripts . | |
working_dir="/tmp/updateXBMC" | |
mount_dir="$working_dir/mount" | |
if [ ! -d $working_dir ] |