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 / async_serial_qt.py
Created April 13, 2018 11:48
Small PyQt5 tool for async access to the serial port
"""
A small GUI tool to test async serial access withing a Qt application.
:author: Stefan Lehmann <stefan.st.lehmann@gmail.com
:license: MIT license, see license.txt for details
:created on 2018-02-08 11:29:49
:last modified by: Stefan Lehmann
:last modified time: 2018-02-28 14:12:53
@stlehmann
stlehmann / provision.sh
Last active January 13, 2018 10:12
My provisioning script for Debian environment
# Provision script for a development environment on Debian including
# neovim, tmux, mc, Python3, git
# upgrade system
sudo apt-get update
sudo apt-get upgrade -y
# install main packages
sudo apt-get install -y man wget curl python3 python3-pip tmux neovim htop mc zsh git ruby
@stlehmann
stlehmann / mkdocs_serve.py
Created September 12, 2017 06:46
Run mkdocs server and open a webbrowser to show the contents.
import time
import subprocess
import webbrowser
subprocess.Popen(['mkdocs', 'serve'])
time.sleep(3)
webbrowser.open('http://localhost:8000')
@stlehmann
stlehmann / Makefile
Created September 4, 2017 17:48
Makefile for Python requirement files with pip-tools
.PHONY: all check clean
objects = $(wildcard *.in)
outputs = $(objects:.in=.txt)
all: $(outputs)
@stlehmann
stlehmann / preferences
Last active June 20, 2017 10:48
Debian apt preferences and sources
Package: *
Pin: release a=stable
Pin-Priority: 700
Package: *
Pin: release a=testing
Pin-Priority: 650
Package: *
Pin: release a=unstable
@stlehmann
stlehmann / config.py
Last active November 27, 2017 05:22
my ptpython configuration. Place in ~/.ptpython/config.py
"""
Configuration example for ``ptpython``.
Copy this file to ~/.ptpython/config.py
"""
from __future__ import unicode_literals
from prompt_toolkit.filters import ViInsertMode
from prompt_toolkit.key_binding.input_processor import KeyPress
from prompt_toolkit.keys import Keys
from pygments.token import Token
@stlehmann
stlehmann / MC Cheat Sheet
Last active April 23, 2017 20:10 — forked from samiraguiar/MC Cheat Sheet
Midnight Commander Cheat Sheet
Shortcut Description
---------------------------------------------------------------
C-o Drop to the console
Insert or C-t Select/deselect file
* Invert selection on files
+ Specify file selection options (including custom pattern)
- The same as above, but for deselecting
F5/F6 Copy/move selected files
@stlehmann
stlehmann / .xonshrc
Created April 14, 2017 19:58
xonsh config file
$PROMPT='{GREEN}{BLUE}{cwd_base} {gitstatus} > '
@stlehmann
stlehmann / app.py
Last active April 12, 2017 14:52
code for testing model inheritance with flask-admin
from flask import Flask, request, redirect, url_for
from flask_mongoengine import MongoEngine
from flask_admin import Admin
from flask_admin.base import expose
from flask_admin.contrib.mongoengine import ModelView
from flask_admin.helpers import get_form_data
from flask_admin.model.helpers import get_mdict_item_or_list
app = Flask(__name__)
@stlehmann
stlehmann / .zshrc
Last active November 21, 2018 12:31
my personal .zshrc. Clone in ~/myzsh and run install_zsh.py
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/root/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="agnoster"