Skip to content

Instantly share code, notes, and snippets.

@renefritze
renefritze / print_bookletstyle.py
Created April 10, 2015 09:08
booklet printing
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pyPdf import PdfFileWriter, PdfFileReader
from reportlab.lib import pagesizes
from reportlab.pdfgen import canvas
from reportlab.lib.units import cm, mm, inch
from StringIO import StringIO
import sys, tempfile
@renefritze
renefritze / label.py
Created January 18, 2012 08:45
tex label list
#!/usr/bin/env python
import fnmatch
import os
import sys
from collections import defaultdict
try:
src_dir = sys.argv[1]
except IndexError:
src_dir = "."
@renefritze
renefritze / lpt.py
Created May 18, 2012 10:54
Link order test
#!/usr/bin/env python
import sys
import os
import subprocess
try:
threads = int(os.environ['LPT'])
except:
threads = 1
@renefritze
renefritze / .gitconfig
Created November 6, 2012 13:09
GIT config
[merge]
#tool = gvimdiff
tool = meld
prompt = false
[user]
name = NAME
email = EMAIL
signingkey = XXX
[github]
user = USER
@renefritze
renefritze / test_common_configuration.xml
Last active December 7, 2015 10:03
test_common_configuration.xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="33" failures="9" disabled="0" errors="0" timestamp="2015-12-07T11:00:18" time="0.014" name="AllTests">
<testsuite name="ConfigTest/0" tests="3" failures="1" disabled="0" errors="0" time="0">
<testcase name="Get" type_param="double" status="run" time="0" classname="ConfigTest/0" />
<testcase name="Set" type_param="double" status="run" time="0" classname="ConfigTest/0" />
<testcase name="Other" type_param="double" status="run" time="0" classname="ConfigTest/0">
<failure message="/home/r_milk01/projekte/uni/dune/stuff-demos/dune-stuff/dune/stuff/test/common_configuration.cc:213&#x0A;Value of: empty.has_sub(&quot;subsection&quot;)&#x0A; Actual: false&#x0A;Expected: true" type=""><![CDATA[/home/r_milk01/projekte/uni/dune/stuff-demos/dune-stuff/dune/stuff/test/common_configuration.cc:213
Value of: empty.has_sub("subsection")
Actual: false
Expected: true]]></failure>
#!/bin/sh
hg clone https://bitbucket.org/apdavison/sumatra_server_example smtserve
cd smtserve
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
python manage.py syncdb
python manage.py runserver
@renefritze
renefritze / orphans.py
Created August 28, 2012 09:29
finds cpp files from given dir that are never included in given dir
#!/usr/bin/env python
import sys
import re
import pprint
import os
import fnmatch
headers = { 'cpp': ['*.h', '*.hh', '*.hpp'] }
sources = { 'cpp': ['*.c', '*.cpp', '*.cc']}

Keybase proof

I hereby claim:

  • I am renemilk on github.
  • I am renemilk (https://keybase.io/renemilk) on keybase.
  • I have a public key ASCxu937rd0tugib087nxCRho59xGKqiyg6XhOufsfQOnQo

To claim this, I am signing this object:

@renefritze
renefritze / spilu_demo.py
Created January 3, 2017 10:53
Spilu problem demonstration
#!/usr/bin/env python3
from scipy.sparse.linalg import spilu
from scipy.sparse import identity
matrix = identity(2)
options = {'spilu_drop_tol':1e-4,
'spilu_fill_factor':10,
'spilu_drop_rule':'basic,area',
'spilu_permc_spec':'COLAMD'
@renefritze
renefritze / Dockerfile
Created January 30, 2017 14:27
dune-python pip pyparsing issue
from ubuntu:16.04
RUN apt-get update && \
apt-get install -y cmake g++ gcc git python3-dev ninja-build \
python3-virtualenv && \
mkdir /root/src && cd /root/src/ && \
git clone https://github.com/dune-community/dune-gdt-super.git && \
cd dune-gdt-super && git submodule update --init --recursive
CMD ["/root/src/dune-gdt-super/dune-common/bin/dunecontrol", "--opts=/root/src/dune-gdt-super/config.opts/stinson/gcc_debug", "all"]