Skip to content

Instantly share code, notes, and snippets.

View Kubuxu's full-sized avatar

Jakub Sztandera Kubuxu

  • Protocol Labs
  • Kraków, Poland
View GitHub Profile
#!/usr/bin/env bash
set -x
set -euo pipefail
IFS=$'\n\t'
HTTP_API="${1:-localhost:5001}"
tmpdir=$(mktemp -d)
export PPROF_TMPDIR="$tmpdir"
pushd "$tmpdir"
N = 600;
x = 1:N;
mean = 61;
scale = 3;
noisy = random('Rayleigh', scale, 1, N) + mean;
drop = 0.5/100; % packet drop chance
for i = x
if drop > rand()
name time/op
Buzhash2/1K-4 601ns ± 4%
Buzhash2/1M-4 910µs ± 2%
Buzhash2/16M-4 18.8ms ± 1%
Buzhash2/100M-4 116ms ± 2%
Rabin/1K-4 74.3µs ± 3%
Rabin/1M-4 6.12ms ± 3%
Rabin/16M-4 92.1ms ± 4%
Rabin/100M-4 576ms ± 3%
Default/1K-4 590ns ± 5%
@Kubuxu
Kubuxu / rand_reads
Last active December 8, 2019 19:53
4KiB, 2525KiB/s
8KiB, 5177KiB/s
12KiB, 6992KiB/s
16KiB, 10.0MiB/s
24KiB, 12.4MiB/s
32KiB, 19.8MiB/s
64KiB, 38.7MiB/s
128KiB, 40.8MB/s
256KiB, 39.6MiB/s
512KiB, 54.8MiB/s

Ingredients for 12 buns:

  • 450g of white, high protein flour
  • 15g of potato starch or flour
  • 10g of sugar
  • 20g of fresh yeast (I think it might not be easy to find in US so active dry or instant should work too, use about 8g or less).
  • 125ml of milk
  • 125ml of lukewarm water
  • 7g of salt
  • 25g of neutral oil (sunflower, canola)
defer func() {
var fr [3]uintptr
runtime.Callers(1, fr[:])
frames := runtime.CallersFrames(fr[:])
if _, ok := frames.Next(); !ok {
return
}
frame, ok := frames.Next()
if !ok {
return
@Kubuxu
Kubuxu / github-notifications-beta-unsubscribe-repo.user.js
Last active June 20, 2023 16:35
Userscrip which adds a button to GitHub Beta Notifications Dashboard for unsubscribing from repos
// ==UserScript==
// @name GitHub Notifications Beta Automatic Unsubscribe (Local)
// @namespace https://kubuxu.com/
// @version 0.2
// @description Adds a button to GitHub Beta Notifications Dashboard for unsubscribing from repos
// @author @Kubuxu
// @match https://github.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant none
// @require http://code.jquery.com/jquery-latest.js