Skip to content

Instantly share code, notes, and snippets.

View NathanBaulch's full-sized avatar

Nathan Baulch NathanBaulch

  • Melbourne, Australia
View GitHub Profile
@NathanBaulch
NathanBaulch / metrics
Created June 15, 2023 12:10
OpenMetrics monolithic test exposition
# TYPE test01_a counter
# HELP test01_a counter_exemplars
test01_a_total 0 123
# TYPE test02_a counter
# HELP test02_a counter_exemplars_empty_brackets
test02_a_total{} 0 123
# HELP test03_cc_seconds counter_unit
# TYPE test03_cc_seconds counter
# UNIT test03_cc_seconds seconds
test03_cc_seconds_total 1.0
@NathanBaulch
NathanBaulch / redisotel.go
Last active May 3, 2023 21:14
Pass OTEL span context across Redis pub/sub boundary
package redisotel
import (
"context"
"strings"
"sync"
"github.com/redis/go-redis/v9"
"go.opentelemetry.io/otel/propagation"
"go.opentelemetry.io/otel/trace"
@NathanBaulch
NathanBaulch / rumble.sh
Last active August 14, 2022 11:35
Benchmark submissions to APS #038 unique words with unique letters
#!/bin/bash
# This script will download, configure, compile, run and compare 20 code responses to Matt
# Parker's "Can you find: five five-letter words with twenty-five unique letters?" video.
# Please run the script twice with the first execution elevated (sudo).
## INSTALL SYSTEM DEPENDENCIES
if [ "$EUID" -eq 0 ]
then
@NathanBaulch
NathanBaulch / main.go
Last active January 22, 2023 11:07
Optimized solution to APS #038 unique words with unique letters
package main
import (
"bufio"
"fmt"
"io"
"math"
"os"
"runtime"
"sort"
@NathanBaulch
NathanBaulch / redis-scan.sh
Last active March 13, 2018 05:24 — forked from obscurerichard/redis-scan.sh
A bash script that scans Redis keys by pattern using SCAN
#!/bin/bash
if [ "$#" -lt 1 ]
then
echo "Scan keys in Redis matching a pattern using SCAN (safe version of KEYS)"
echo "Usage: $0 <host> [port] [database] [pattern]"
exit 1
fi
host=${1:-}
port=${2:-6379}
### Keybase proof
I hereby claim:
* I am nathanbaulch on github.
* I am nathanbaulch (https://keybase.io/nathanbaulch) on keybase.
* I have a public key ASClmd0yeLMqsAvBrpbGYyfhBZd9S5wm6PzNLaNDAQltgAo
To claim this, I am signing this object: