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
<!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
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 = [
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
@bodokaiser
bodokaiser / context.ts
Last active August 10, 2023 01:00
React Hook integration for AWS Amplify Auth
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 August 9, 2019 08:14
Example on how to sql/driver Scanner and Valuer interface with jackx/pgx.
package main
import (
"database/sql/driver"
"log"
"github.com/jackc/pgx"
"github.com/jackc/pgx/pgtype"
)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import sys
import numpy as np
import matplotlib
matplotlib.use('Qt5Agg')
from PyQt5 import QtWidgets
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QDialog, QWidget