Skip to content

Instantly share code, notes, and snippets.

View jgosmann's full-sized avatar

Jan Gosmann jgosmann

View GitHub Profile
@jgosmann
jgosmann / 00-runcom.ipy
Created July 30, 2015 19:39
IPython startup file
import matplotlib.pyplot as plt
import nengo
from nengo import spa
import numpy as np
import pandas as pd
import seaborn as sns
[default]
include_dirs = /opt/openblas/include
library_dirs = /opt/openblas/lib
[openblas]
libraries = openblas
include_dirs = /opt/openblas/include
library_dirs = /opt/openblas/lib
[lapack]
[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
init-hook="
from pylint_venv import inithook
inithook()"
### Keybase proof
I hereby claim:
* I am jgosmann on github.
* I am jgosmann (https://keybase.io/jgosmann) on keybase.
* I have a public key whose fingerprint is 8DBD 17B2 96E1 0C77 555E BB80 E739 2E7E 2D68 6DA1
To claim this, I am signing this object:
@jgosmann
jgosmann / gist:6f8e357dee0ccf626335
Last active August 29, 2015 14:04
Enable ssh-agent in KDE
echo -e '#!/bin/sh\n[ -n "$SSH_AGENT_PID" ] || eval "$(ssh-agent -s)"' > ~/.kde/env/ssh-agent-startup.sh
echo -e '#!/bin/sh\n[ -z "$SSH_AGENT_PID" ] || eval "$(ssh-agent -k)"' > ~/.kde/shutdown/ssh-agent-shutdown.sh
chmod 755 ~/.kde/env/ssh-agent-startup.sh ~/.kde/shutdown/ssh-agent-shutdown.sh
$lualatex = 'lualatex -synctex=1 %O %S';
$pdflatex = 'pdflatex -synctex=1 %O %S';
$xelatex = 'xelatex -synctex=1 %O %S';
$pdf_mode = 4; # 4 uses lualatex, set to 1 for pdflatex
add_cus_dep('nlo', 'nls', 0, 'nlo2nls');
sub nlo2nls {
system("makeindex \"$_[0].nlo\" -s nomencl.ist -o \"$_[0].nls\"");
}
@jgosmann
jgosmann / Helpers.hs
Created May 31, 2014 21:48
Tree.hs 12 KiB This module contains some helper functions. For example a function to generate permutations (but this could be implemented in a more easy way) or a function to display long lists a little bit nicer.
-- File: Helpers.hs
-- Date: 15-Nov-2008
-- Version: 1.0
--
-- Copyright (C) 2008 Jan Gosmann <[email protected]>
--
-- See: http://www.hyper-world.de
--
-- Description: This file provides a data structure to represent arithmetic
-- expressions.
@jgosmann
jgosmann / Tree.hs
Created May 31, 2014 21:47
This file provides a Haskell module with a data type for binary trees and functions to manipulate them.
-- File: Tree.hs
-- Date: 11-Nov-2008
-- Version: 1.0
--
-- Copyright (C) 2008 Julia Koslowski, Jan Gosmann <[email protected]>
--
-- See: http://www.hyper-world.de
--
-- Description: This file provides a Haskell module with a data type for binary
-- trees and functions to manipulate them.
#!/bin/sh
if test -n "$(find /mnt/backup/last_daily -mtime 1)"; then
echo 'Daily backup.'
/usr/bin/rsnapshot daily
date > /root/backup_w/last_daily
fi
if test -n "$(find /mnt/backup/last_weekly -mtime 7)"; then
echo 'Weekly backup.'
@jgosmann
jgosmann / pdf-recolor-highlights.py
Created March 6, 2014 19:31
Script to change the color of all highlight annotations in a PDF file.
#!/usr/bin/env python
import re
# PDF format reference: http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/PDF32000_2008.pdf
# pages 12 to 13 define the character sets
WHITESPACE = '\x00\x09\x0A\x0C\x0D\x20'
DELIMITER = '()<>[]{}/%'
def to_re_char_group(charset):