Skip to content

Instantly share code, notes, and snippets.


Stop all containers

$ docker stop $(docker ps -q)

Build docker image

$ cd /path/to/Dockerfile
HappyCodingRobot / esphome_neopixel_clock_effect.yaml
Created Oct 6, 2020 — forked from markusressel/esphome_neopixel_clock_effect.yaml
ESPHome configuration example to create an animated clock using the Neopixel 60 LED ring
View esphome_neopixel_clock_effect.yaml
# [...]
priority: -10
# enable clock effect after boot
- light.turn_on:
id: light_ring
brightness: 100%
effect: Clock
HappyCodingRobot / serialplot2
Created Jun 10, 2020 — forked from turbinenreiter/serialplot2
plotting data from serial port with matplotlib
View serialplot2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import serial
fig, ax = plt.subplots()
line, = ax.plot(np.random.rand(10))
ax.set_ylim(-5000, 5000)
xdata, ydata = [0]*100, [0]*100
raw = serial.Serial("/dev/ttyUSB1",9600)
HappyCodingRobot /
Created Apr 14, 2020 — forked from rot42/
Gnuk Token on ST Dongle with STM32F103CBU6

Gnuk Token on ST Dongle with STM32F103CBU6

Based on Daniel Kucera's implementation of the confirmation button, adapted for a different ST Dongle using an STM32F103CBU6 microcontroller.

STM32F103CBU6 microcontroller ST-LINK/V2 clone dongle

Order of the 4 SWD interface holes from left to right:

HappyCodingRobot / Local PR test and
Created Dec 19, 2019 — forked from adam-p/Local PR test and
Testing a pull request, then merging locally; and avoiding TOCTOU
View Local PR test and

It's not immediately obvious how to pull down the code for a PR and test it locally. But it's pretty easy. (This assumes you have a remote for the main repo named upstream.)

Getting the PR code

  1. Make note of the PR number. For example, Rod's latest is PR #37: Psiphon-Labs/psiphon-tunnel-core#37

  2. Fetch the PR's pseudo-branch (or bookmark or rev pointer whatever the word is), and give it a local branch name. Here we'll name it pr37:

$ git fetch upstream pull/37/head:pr37
HappyCodingRobot /
Created May 31, 2019 — forked from novel-yet-trivial/
A vertical scrolled frame for python tkinter that behaves like a normal Frame. Tested with python 2 and 3, windows and linux.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import tkinter as tk
except ImportError:
import Tkinter as tk
class VerticalScrolledFrame:
HappyCodingRobot /
Created May 31, 2019 — forked from sente/
Example of how to use __getattribute__(self,name) and __setattr__(self,name,val)
class Foo(object):
def __getattribute__(self, name):
print "getting attribute %s" % name
return object.__getattribute__(self, name)
def __setattr__(self, name, val):
print "setting attribute %s to %r" % (name, val)
return object.__setattr__(self, name, val)
HappyCodingRobot / 61-hp-mic-mute-hotkey.hwdb
Created Jan 8, 2019
Activate mic mute function key, ubuntu 18.04, HP Elitebook 820
View 61-hp-mic-mute-hotkey.hwdb
# see also: /lib/udev/hwdb.d/60-keyboard.hwdb
KEYBOARD_KEY_81=f20 # Fn+F8 on Elitebook, map to F20
# KEYBOARD_KEY_81=fn_esc # org entry
HappyCodingRobot /
Created Feb 7, 2018
XANES X1 Programmable LED light badge protocoll reverse engineering

XANES X1 Programmable LED light badge protocoll reverse engineering

General informations

  • VID:PID - 0416:5020
  • Product ID: LS32 Custm HID
  • uses HID Protocoll
  • 2 endpoints, uses endpoint 1 for data, all with report 0
  • 64 byte paket size

The Protocol

HappyCodingRobot / Scheduler_Example.c
Last active Aug 22, 2019
Very basic Round Robin scheduler for AVR
View Scheduler_Example.c
#include <avr/io.h>
#include <avr/interrupt.h>
#include <inttypes.h>
#include "scheduler.h"
// Task definitions
#define nTask1 1
#define nTask2 2