Skip to content

Instantly share code, notes, and snippets.

@kenoir
kenoir / test_record_writer_performance.py
Created March 26, 2026 09:35
Performance & memory investigation tests for OAI-PMH adapter pipeline
"""Tests investigating post-HTTP-response bottlenecks in window processing.
When running the reloader, the command hangs after the first HTTP 200 response:
Processing window 2026-03-25T18:00:00+00:00 -> 2026-03-25T19:00:00+00:00
HTTP Request: GET ... "HTTP/1.1 200 OK"
<hangs here>
Between the HTTP response and the next log message, the following silent
operations execute:
@kenoir
kenoir / test_record_writer_performance.py
Created March 26, 2026 09:35
Performance & memory investigation tests for OAI-PMH adapter pipeline
"""Tests investigating post-HTTP-response bottlenecks in window processing.
When running the reloader, the command hangs after the first HTTP 200 response:
Processing window 2026-03-25T18:00:00+00:00 -> 2026-03-25T19:00:00+00:00
HTTP Request: GET ... "HTTP/1.1 200 OK"
<hangs here>
Between the HTTP response and the next log message, the following silent
operations execute:
import time
import math
import random
import numpy as np
import pyvirtualcam
import cv2
# Toggle to visually debug sprite sheets on the output stream
_DEBUG_GESTURES = False # gesture diagnostics
_UNMIRROR_DEBUG_TEXT = True # if True, flip debug text region back for readability
import time
import math
import numpy as np
import pyvirtualcam
import cv2
# Use MediaPipe Face Mesh for robust, real-time facial landmarks
try:
import mediapipe as mp
@kenoir
kenoir / gist:aab31ac5a71841c9325655bd3f0ee188
Created April 8, 2024 08:31
Get ES indices sorted by size
GET /_cat/indices?h=index,store.size&bytes=gb&format=json&s=store.size:desc
@kenoir
kenoir / main.go
Created December 7, 2022 15:11
Advent of Code (Day 6)
package main
import (
"fmt"
"errors"
)
func find_unique(signal string) (int, error) {
signal_length := len(signal)
unique_length := 4
val checkResults = RepoRule.values.map(rule =>
(rule.evaluate(basicRepo), rule.violationMessage)
)
@kenoir
kenoir / get_github_app_token.sh
Created October 26, 2022 08:34 — forked from 987Nabil/get_github_app_token.sh
Get a GitHub App token via bash
# MIT No Attribution
# Copyright 2022 Nabil Abdel-Hafeez
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify,
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so.
type LambdaConfig = Record<string, string>;
type ConfigurableHandler = (config: LambdaConfig) => Promise<void>;
const buildLambdaHandler = (handler: ConfigurableHandler, prefix: string) => {
Log.info(`Finding config for: ${prefix}`);
// Include configuration logic to pull from env or wherever
const config: LambdaConfig = { 'foo/bar': 'baz' };
return () => handler(config);
@kenoir
kenoir / gist:a8fa446abb6b2bb5d21fe804a7704ca9
Created July 19, 2022 09:23
bucket_from_ssm_in_region.sh
for AWS_REGION in eu-west-1 us-west-1 ap-southeast-2 ca-central-1
do
AWS_REGION=$AWS_REGION AWS_PROFILE=frontend aws ssm get-parameter --name "/account/services/artifact.bucket" | jq "."
done