Skip to content

Instantly share code, notes, and snippets.

View stlehmann's full-sized avatar
:bowtie:

Stefan Lehmann stlehmann

:bowtie:
View GitHub Profile
@stlehmann
stlehmann / Default (Windows).sublime-keymap.json
Created March 20, 2015 07:13
My Sublime Text User Keymap
[
{ "keys": ["ctrl+shift+o"], "command": "prompt_add_folder" },
]
@stlehmann
stlehmann / .minttyrc
Created April 9, 2015 06:53
Mintty Monokai Scheme
ForegroundColour=248,248,242
BackgroundColour=39,40,34
CursorColour=253,157,79
Black=39,40,34
BoldBlack=117,113,94
Red=249,38,114
BoldRed=204,6,78
Green=166,226,46
BoldGreen=122,172,24
Yellow=244,191,117
@stlehmann
stlehmann / MarkdownTOC.sublime-settings.
Created June 16, 2015 19:15
My user settings for Sublime Text 3 Plugin MarkdownTOC
{
"default_autolink": true,
"default_bracket": "round",
"default_depth": 3,
"id_replacements": {
"-": " ",
"" : ["!","#","$","&","'","(",")","*","+",",","/",":",";","=","?","@","[","]","`","\"", ".","<",">","{","}","™","®","©"],
"a": "ä",
"u": "ü",
"o": "ö"
@stlehmann
stlehmann / MarkdownPreview.sublime-settings
Last active August 29, 2015 14:23
My user settings for Sublime Text MarkdownPreview Plugin
{
"parser": "default",
"enable_mathjax": true,
"enable_highlight": true,
"github_mode": "markdown",
"enabled_extensions": "default",
"github_inject_header_ids": true
}
@stlehmann
stlehmann / org.watson.ipython-notebook.plist
Created June 17, 2015 20:57
Launchctl Job definition for IPython Notebook
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>WorkingDirectory</key>
<!-- CHANGE THIS TO YOUR HOME DIRECTORY -->
<string>/Users/stefanlehmann</string>
<key>Label</key>
@stlehmann
stlehmann / setup.py
Last active September 21, 2018 12:06
Setup.py template with test command integration and version extraction
"""
Setup for Sensordb.
:author: Stefan Lehmann <[email protected]>
:license: MIT, see license file or https://opensource.org/licenses/MIT
:created on 2018-06-14 13:15:51
:last modified by: lehmann
:last modified time: 2018-06-14 13:21:47
@stlehmann
stlehmann / mathtextlabel.py
Created July 2, 2015 09:16
MathTextLabel for displaying math formulae in PyQt5 with matplotlib
from PyQt5.QtWidgets import QWidget
import matplotlib
matplotlib.use("Qt5agg")
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
import pylab
class MathTextLabel(QWidget):
def __init__(self, mathText, parent=None, **kwargs):
super().__init__(parent, **kwargs)
@stlehmann
stlehmann / Python_Makefile
Last active August 30, 2015 09:11
Makefile for embedding Python in C
P=mycprogram
OBJECTS=mycprogram.c
CFLAGS=$(shell python3.4-config --cflags)
LDFLAGS=$(shell python3.4-config --ldflags)
LDLIBS=$(shell python3.4-config --libs)
CC=C99
$(P): $(OBJECTS)
clean:
@stlehmann
stlehmann / addrmrows.py
Created October 31, 2015 17:25
Get row, count pairs where new items have been added / removed to the ordered list.
def add_rm_rows(old, new):
"""
Get row, count pairs where new items have been added / removed to the ordered list.
:old_list: list of items
:new_list: list of items
:return: list of [row, count] pairs where items have been added,
list of [row, count] pairs where items have been deleted
"""
@stlehmann
stlehmann / opencv_facedetection.py
Created November 18, 2015 18:10
frontal face detection with webcam
#!/usr/bin/env python
import os
import cv2
from PyQt5.QtWidgets import *
CASCADE_PATH = "/usr/local/share/OpenCV/haarcascades"
CASCADE_FILENAME = "haarcascade_frontalface_default.xml"