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 / 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"
)
Loading
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import visa
import numpy as np
from matplotlib import pyplot as plt
rm = visa.ResourceManager()
scope = rm.open_resource('TCPIP::172.22.22.30::inst0::INSTR')
scope.timeout = 5000
scope.clear()
#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
template <typename Func, typename T>
T riemann(const Func& f, T x_min, T x_max, size_t N) {
T dx = (x_max - x_min) / N;
T sum = 0;
#include <iostream>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
struct Person {
std::string first_name;
std::string last_name;
int age;