Skip to content

Instantly share code, notes, and snippets.

HappyCodingRobot /
Created January 27, 2023 15:53 — forked from iwalpola/
STM32 GPIO registers cheatsheet
HappyCodingRobot /
Created December 21, 2022 10:43 — forked from JamesHagerman/
Some useful YARD Stick One notes

Some useful YARD Stick One notes

This thing is a bit of a beast. People don't give it NEARLY the credit, or the documentation it deserves.

Two ways of using this thing: rfcat directly, or write a python script for it.

Basically, writing a python script is easier. Using rfcat directly is great but often, there are just too many silly settings to configure


Stop all containers

$ docker stop $(docker ps -q)

Build docker image

$ cd /path/to/Dockerfile
HappyCodingRobot / esphome_neopixel_clock_effect.yaml
Created October 6, 2020 09:52 — 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 June 10, 2020 16:55 — 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 April 14, 2020 14:31 — 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 December 19, 2019 22:15 — 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 22:20 — 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 22:02 — 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 January 8, 2019 14:22
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