Skip to content

Instantly share code, notes, and snippets.

View stettberger's full-sized avatar

Christian Dietrich stettberger

View GitHub Profile
@stettberger
stettberger / ledger-account.el
Created January 26, 2019 10:31
ledger-account-rename
(defun ledger-account--rename (account-old account-new)
"Rename account in ledger file."
(let ((count 0))
(beginning-of-buffer)
(while (not (eobp))
(let* ((left-point (point))
(next-change
(or (next-single-property-change (point) 'face (current-buffer))
(point-max)))
(face (face-at-point left-point))
@stettberger
stettberger / gdb_trace.py
Created April 9, 2018 13:43
GDB Function Call Trace
# Example Invocation:
#
# gcc test.c -o test -g
# TRACE_FUNCTIONS=fib TRACE_FILE=log gdb -x gdb_trace.py test
# cat log
#
# Log File Format:
#
# ('call', Parent Call ID, Call ID, Breakpoint Name, Symbol Name, Arguments)
# ('return', Call Id, Breakpoint Name, Return Value)
@stettberger
stettberger / monitor.py
Created October 26, 2012 08:34
Monitor configuration script for using with herbstluftwm
#!/usr/bin/python
import optparse
import os
from subprocess import *
import pipes
import sys
def quote_args(args):
http://www.univis.uni-erlangen.de/form?__s=2&dsc=anew/lecture_plan&lvs=tech/IMMD/inform/bfs,//IMMD2/inf2ge,nat/dma/zentr/mathem_8,tech/IMMD/lsinfs_1/sosy3_7,//IMMD4/sp,//inform/uebfs__1,//lsinfs_1/bungen_8,//IMMD4/sp_2_7_0,nat/dma/zentr/bungen_18&anonymous=1&collection=2010w/nat/dma/zentr/bungen_18,/mathem_8,////tech/IMMD/IMMD2/inf2ge,//IMMD4/sp,/sp_2_7_0,//inform/bfs,/uebfs__1,//lsinfs_1/bungen_8,/sosy3_7&ref=coll&sem=2010w&__e=903
@stettberger
stettberger / sqlite-diff.py
Created October 5, 2010 13:18
diff two sqlite databases
#!/usr/bin/python
import sys, sqlite3, tempfile, subprocess, os
def do_select(connection, table, fields):
connection.row_factory = sqlite3.Row
c = connection.cursor()
# If no fields are given, use all fields
if fields == []:
(defun gist-created-callback (status)
(let ((location (cadr status)))
(message "Paste created: %s" location)
(when gist-view-gist
(browse-url location))
(kill-new location)
(kill-buffer (current-buffer))))