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
# Rakefile for building tex file
require "rake/clean"
BASE = "documentname"
TYPE = ".tex"
OUT = ".pdf"
TEXFILE = FileList[BASE+TYPE]
OUTFILE = FileList[BASE+OUT]
BIBTEXCMD = "bibtex"
#!/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
#
# 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
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!(/ /, '\\\\ ')
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/homebrew/lib
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()
# latex logic symbols imported from snipt.net
Allquantor = \forall
Existencequantor = \exists
OR = \vee
AND = \wedge
NOT = \neg
Implies = \Rightarrow
#!/bin/bash
#
# shell script to invoke gvim with working directory as default
# created for easier use of gvim in a mingw32 environment such as
# the git bash
#
if [ $# == 0 ]
then
C:\\Programme\\Vim\\vim72\\gvim.exe . &
# treat as binary to prevent newline fixes, showing in diffs and include in merges
# caveat: still shown as conflict in merges, although it won't have changed
*.pbxproj -crlf -diff -merge
#
# adds 'brew refresh' as an external command, which essentially does
# 'brew update' followed by 'brew outdated'
#
require 'update'
def outdated
outdated_brews.each do |keg, name, version|
if $stdout.tty? and not ARGV.flag? '--quiet'
versions = keg.cd{ Dir['*'] }.join(', ')