Skip to content

Instantly share code, notes, and snippets.

View richrd's full-sized avatar

Richard Lewis richrd

View GitHub Profile
@richrd
richrd / uhk_adaptive_mode.py
Created November 18, 2020 16:58
Simple Adaptive Mode for the UHK on Linux
import os
import Xlib
import Xlib.display
"""
Simple Adaptive Mode script for the Ultimate Hacking Keyboard on Linux
This script listens to window focus changes and switches keymaps when
a matching window is found. It switches back to the default keymap when
switching away from a matched window.
@richrd
richrd / conversation-view.css
Last active December 20, 2019 19:03
The Lounge conversation view CSS
#chat .msg {
display: flex;
flex-wrap: wrap;
}
#chat .msg:not(.previous-source) {
margin-top: 1em;
}
#chat .msg.previous-source {
margin-top: 0em;
}
#
# HTTP Server that returns an image from the RaspberryPi camera
#
import io
import time
import picamera
import pyco_http
def get_image():