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 / fused-silica-refractive-index.jl
Created June 28, 2023 07:29
Refractive indices for fused silica using the Sellmeier equation
### A Pluto.jl notebook ###
# v0.19.24
using Markdown
using InteractiveUtils
# ΓòöΓòÉΓòí ec26df3c-14b8-11ee-282f-c51a3afd5185
begin
using Unitful
using Statistics
@bodokaiser
bodokaiser / README.md
Last active June 19, 2023 09:06
Stanford Research Instruments PTC10

Stanford Research Instruments PTC10

Usage

go run main.go > time_date.csv

Show help for optional arguments:

@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 = [