Skip to content

Instantly share code, notes, and snippets.

Avatar
😀
Happy to be here!

Bodo Kaiser bodokaiser

😀
Happy to be here!
View GitHub Profile
View qsim.py
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)
View stm32-bluepill-macos.md

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
View index.html
<!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 Jul 12, 2020
ZeroMQ subscriber to GNU Radio ZeroMQ source for digital OOK PWM signal.
View ook_pwm_zeromq_subscriber.js
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
View ook_decoder.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View worktime.py
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 = [
View digital-electronics-1.ipynb
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 Apr 11, 2020
Enable the libopencm3 framework in platformio for the STM32F072RB discovery board.
View README.md

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
@bodokaiser
bodokaiser / context.ts
Last active Jul 20, 2022
React Hook integration for AWS Amplify Auth
View context.ts
import React from "react"
import { CognitoUser } from "@aws-amplify/auth"
import { useAuth } from "./hooks"
import { SignInInput } from "./types"
interface AuthState {
user: CognitoUser | null
signIn(input : SignInInput): Promise<void>
signOut(): Promise<void>
@bodokaiser
bodokaiser / main.go
Created Aug 9, 2019
Example on how to sql/driver Scanner and Valuer interface with jackx/pgx.
View main.go
package main
import (
"database/sql/driver"
"log"
"github.com/jackc/pgx"
"github.com/jackc/pgx/pgtype"
)