Skip to content

Instantly share code, notes, and snippets.

@HappyCodingRobot
HappyCodingRobot / stm32_gpio_reg.md
Created January 27, 2023 15:53 — forked from iwalpola/stm32_gpio_reg.md
STM32 GPIO registers cheatsheet
@HappyCodingRobot
HappyCodingRobot / my_ys1_notes.md
Created December 21, 2022 10:43 — forked from JamesHagerman/my_ys1_notes.md
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
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
esphome:
# [...]
on_boot:
priority: -10
then:
# enable clock effect after boot
- light.turn_on:
id: light_ring
brightness: 100%
effect: Clock
@HappyCodingRobot
HappyCodingRobot / serialplot2
Created June 10, 2020 16:55 — forked from turbinenreiter/serialplot2
plotting data from serial port with matplotlib
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
HappyCodingRobot / README.md
Created April 14, 2020 14:31 — forked from rot42/README.md
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
HappyCodingRobot / Local PR test and merge.md
Created December 19, 2019 22:15 — forked from adam-p/Local PR test and merge.md
Testing a pull request, then merging locally; and avoiding TOCTOU

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
HappyCodingRobot / VerticalScrolledFrame.py
Created May 31, 2019 22:20 — forked from novel-yet-trivial/VerticalScrolledFrame.py
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 -*-
try:
import tkinter as tk
except ImportError:
import Tkinter as tk
class VerticalScrolledFrame:
"""
@HappyCodingRobot
HappyCodingRobot / class_attribute_test.py
Created May 31, 2019 22:02 — forked from sente/class_attribute_test.py
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)