Skip to content

Instantly share code, notes, and snippets.

@joostjager
joostjager / cable.py
Last active September 5, 2023 18:55
Gym rep / time / distance counter
import cv2
import numpy as np
import time
# Initialize the webcam
cap = cv2.VideoCapture(0)
# Or alternatively read from file. Handy for development so that you don't need to keep working out to test.
# cap = cv2.VideoCapture('cable.mov')
@joostjager
joostjager / db_test.go
Last active January 20, 2023 08:44
Concurrent read test
//go:build kvdb_sqlite && !(windows && (arm || 386)) && !(linux && (ppc64 || mips || mipsle || mips64))
package sqlite
import (
"database/sql"
"fmt"
"net/url"
"path/filepath"
"testing"
@joostjager
joostjager / sqlitetest.md
Last active January 19, 2023 11:03
SQLITE test
// TestInterface performs all interfaces tests for this database driver.
func TestInterface(t *testing.T) {
	// dbType is the database type name for this driver.
	dir := t.TempDir()
	ctx := context.Background()

	pragmaOptions := []struct {
		name  string
		value string
2022-07-11T09:55:48.951+0200 INFO Success packet {"source": "spammer-2"}
2022-07-11T09:55:48.951+0200 INFO Success packet {"source": "user"}
2022-07-11T09:55:48.962+0200 INFO Success packet {"source": "spammer-0"}
2022-07-11T09:55:48.973+0200 INFO Success packet {"source": "spammer-2"}
2022-07-11T09:55:48.984+0200 INFO Success packet {"source": "spammer-2"}
2022-07-11T09:55:49.058+0200 INFO Success packet {"source": "spammer-2"}
2022-07-11T09:55:49.153+0200 INFO Success packet {"source": "spammer-2"}
2022-07-11T09:55:49.280+0200 INFO Success packet {"source": "spammer-0"}
2022-07-11T09:55:49.364+0200 INFO Success packet {"source": "spammer-0"}
2022-07-11T09:55:49.451+0200 INFO Success packet {"source": "user"}
2022-07-11T09:13:29.882+0200 INFO Success packet {"source": "spammer-2"}
2022-07-11T09:13:29.882+0200 INFO Success packet {"source": "user"}
2022-07-11T09:13:29.963+0200 INFO Success packet {"source": "spammer-0"}
2022-07-11T09:13:30.044+0200 INFO Success packet {"source": "spammer-2"}
2022-07-11T09:13:30.125+0200 INFO Success packet {"source": "spammer-2"}
2022-07-11T09:13:30.206+0200 INFO Success packet {"source": "spammer-1"}
2022-07-11T09:13:30.287+0200 INFO Success packet {"source": "spammer-0"}
2022-07-11T09:13:30.369+0200 INFO Success packet {"source": "spammer-1"}
2022-07-11T09:13:30.383+0200 INFO Success packet {"source": "user"}
2022-07-11T09:13:30.450+0200 INFO Success packet {"source": "spammer-2"}
package main
import (
"fmt"
"math/rand"
"time"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"golang.org/x/time/rate"
### Keybase proof
I hereby claim:
* I am joostjager on github.
* I am joostjager (https://keybase.io/joostjager) on keybase.
* I have a public key ASA7OiG3hLAzgvmFIhLEancXsDU9N6LRmtEnIUwZXZT3mwo
To claim this, I am signing this object: