Skip to content

Instantly share code, notes, and snippets.

View bodokaiser's full-sized avatar
😀
Happy to be here!

Bodo Kaiser bodokaiser

😀
Happy to be here!
View GitHub Profile
@bodokaiser
bodokaiser / picolog.py
Created June 6, 2023 15:26
Python class wrapping the picosdk interface for the Pico Logger USB TC-08
import ctypes
import numpy as np
import numpy.typing as npt
from picosdk.usbtc08 import usbtc08 as tc08
from picosdk.functions import assert_pico2000_ok
MAX_CHANNELS = 8
@bodokaiser
bodokaiser / Dockerfile
Created June 2, 2023 08:07
Dockerfile for installing numpy, scipy, and numba from requirements.txt
FROM python:3.9-slim
RUN apt update && apt install --assume-yes --no-install-recommends \
build-essential
WORKDIR /tmp
COPY requirements.txt ./
RUN pip install --no-cache -r requirements.txt
from abc import ABC, abstractmethod
from argparse import ArgumentParser, BooleanOptionalAction
import numpy as np
from matplotlib import pyplot as plt
from scipy import linalg
pauli_z = np.array([[1, 0], [0, -1]], dtype=complex)
pauli_x = np.array([[1, 0], [0, -1]], dtype=complex)

How to flash the STM32 "blue pill" on macOS Mojave (arm64)

Valid as of March 27th 2022

OpenOCD debugger

Install the latest openocd version (the official version produces a [segmentation fault][1])

brew install openocd --head
<!DOCTYPE html>
<html>
<head>
<title>iFrame Proxy</title>
</head>
<body>
<iframe src="http://localhost:3000?domain=google.com" width="800" height="400"></iframe>
<script>
const domain = (new URL(document.location)).searchParams.get('domain')
@bodokaiser
bodokaiser / ook_pwm_zeromq_subscriber.js
Created July 12, 2020 17:27
ZeroMQ subscriber to GNU Radio ZeroMQ source for digital OOK PWM signal.
const zmq = require('zeromq')
const socket = zmq.socket('sub')
socket.connect('tcp://127.0.0.1:3000')
socket.subscribe('')
const shortSamples = 9
const longSamples = 34
const resetSamples = 348
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from datetime import date, timedelta
from dateutil import rrule
from shutil import copyfile
# start and end time of your work contract
start = date(2020, 3, 1)
end = date(2020, 8, 31)
# TODO: check if workday is public holiday
holidays = [
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bodokaiser
bodokaiser / README.md
Created April 11, 2020 05:37
Enable the libopencm3 framework in platformio for the STM32F072RB discovery board.

Enable the libopencm3 framework in platformio for the STM32F072RB discovery board.

Credit to manuelbl

Full file-paths:

  • <yourprojectpath>/platform.io
  • ~/.platformio/boards/disco_f072rb_libopencm.json
  • ~/.platformio/platforms/ststm32/builder/frameworks/libopencm3/libopencm3.py