Skip to content

Instantly share code, notes, and snippets.

View foosel's full-sized avatar
🐙
Working full-time on OctoPrint!

Gina Häußge foosel

🐙
Working full-time on OctoPrint!
View GitHub Profile
@foosel
foosel / .Xmodmap
Created January 31, 2021 23:45
KMonad config to turn a ThinkPad X240 keyboard UHK alike. Combined with .Xmodmap for german umlauts and fixed ins/end shenanigans.
! Fix ThinkPad shenanigans
keycode 118 = End
keycode 115 = Insert
! AltGr is Mode_switch
clear mod5
keycode 108 = Mode_switch
! AltGr shortcuts for umlauts
keycode 39 = s S ssharp
@foosel
foosel / mjpg-streamer.default
Created December 30, 2013 18:37
MJPG-Streamer init/default scripts by Sami Olmari (mirrored from http://pastebin.com/Eu5Cytk1 and http://pastebin.com/QCtC1sLc)
# Configuration for /etc/init.d/mjpg-streamer
# The init.d script will only run if this variable non-empty.
MJPG_STREAMER_USER="pi"
# Where mjpg-streamer is installed, this is important!
DAEMON_HOME=/home/pi/mjpg-streamer
# What arguments to pass to mjpg-streamer, here is few examples; You can change them by commenting one and
# uncommenting another:
@foosel
foosel / README.md
Last active January 11, 2024 20:23
OBS script that updates the YouTube livechat URL on a browser source on stream start.

youtube-live-chat-update.py

OBS script that updates the YouTube livechat URL on a browser source on stream start to the livechat associated with the (first) current livestream on a given channel. If no livestream is active, a placeholder page saying "No Stream." will be injected. You can style the text via the css class .nostream to match your background etc.

You will need a YouTube API key, see https://developers.google.com/youtube/v3/getting-started and https://developers.google.com/youtube/registering_an_application for more information on how to go about that.

Additionally you will require the channel ID of the channel for which you want to query the current live stream. You can retrieve that by inspecting the web site source of the channel in question and looking for externalId.

To use, download youtube-live-chat-update.py and add it as script to OBS Studio. Note: Be sure to configure a valid Python environment first, see here for more details.

@foosel
foosel / stl_to_svg.scad
Created December 7, 2021 13:59
STL to SVG conversion script using OpenSCAD. Takes an STL and projects it to the defined plane (default: XY), then saves the result as SVG.
FileToLoad = "";
Plane=0; // 0: XY, 1: XZ, 2: YZ
echo("File:", FileToLoad);
projection() {
if (Plane == 0) {
echo("Plane: XY");
import(FileToLoad);
} else if (Plane == 1) {
echo("Plane: XZ");