Skip to content

Instantly share code, notes, and snippets.

View mrtazz's full-sized avatar
👨‍🔧
computer plumbing

Daniel Schauenberg mrtazz

👨‍🔧
computer plumbing
View GitHub Profile
import sys
import time
def progressbar(it, prefix = "", size = 60):
count = len(it)
def _show(_i):
x = int(size*_i/count)
sys.stdout.write("%s[%s>%s] %i/%i\r" % (prefix, "="*x, "-"*(size-x), _i, count))
sys.stdout.flush()
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/homebrew/lib
IMAGES = FileList["**/*.eps"]
desc "convert eps to pdf"
task :epsconvert do
IMAGES.each do |i|
dir = File.dirname(i)
file = File.basename(i, ".eps")
pdffile = dir+"/"+file+".pdf"
pdffile.gsub!(/ /, '\\\\ ')
i.gsub!(/ /, '\\\\ ')
#
# vim search and replace regex to transform and shorten numbers
# from excel to tex
#
s/\([0-9]\{1,3}\),\?\([0-9]\{0,2}\)[0-9]* \|\t\|\n/\1,\2 \& /g
#!/usr/bin/env python
#
# simple timer for pomodoro like counting
# Usage: pomodoro.py WORKTIME BREAKTIME
#
import sys
import os
from time import gmtime, strftime, sleep
# Rakefile for building tex file
require "rake/clean"
BASE = "documentname"
TYPE = ".tex"
OUT = ".pdf"
TEXFILE = FileList[BASE+TYPE]
OUTFILE = FileList[BASE+OUT]
BIBTEXCMD = "bibtex"
#!/bin/sh
#
# script to backup to a mounted sparseimage
#
# tests if the image is mounted and if not,
# tries to mount it. After backup, the image
# is detached again
#
SOURCE=~/
#!/bin/sh
#
# Shell script to sync all content of the DropBox
# download folder to the OSX download folder
#
# Best used when attached to a folder action
#
SOURCE="/Users/mrtazz/DropBox/Downloads/"
DESTINATION="/Users/mrtazz/Downloads"
@mrtazz
mrtazz / license
Created January 27, 2010 11:56 — forked from defunkt/license
#!/bin/sh -e
# Usage: license
# Prints an MIT license appropriate for totin' around.
#
# $ license > COPYING
#!/bin/sh
echo "Copyright (c) `date +%Y` Daniel Schauenberg
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
#!/bin/sh
git stash
git symbolic-ref HEAD refs/heads/$1
rm .git/index
git clean -f -d