Skip to content

Instantly share code, notes, and snippets.

View bestie's full-sized avatar
❤️‍🔥

Stephen Best bestie

❤️‍🔥
View GitHub Profile
@bestie
bestie / racknroll.ru
Created July 5, 2021 16:52
A Rack app for rick rollin'
body = <<~HTML
<html>
<body>
<div class="tenor-gif-embed" data-postid="12136175" data-share-method="host" data-width="100%" data-aspect-ratio="1.4777448071216617"><a href="https://tenor.com/view/rick-ashley-dance-80s-music-gif-12136175">Rick Ashley Dance GIF</a> from <a href="https://tenor.com/search/rickashley-gifs">Rickashley GIFs</a></div><script type="text/javascript" async src="https://tenor.com/embed.js"></script>
</body>
</html>
HTML
app = ->(env) {
[
@bestie
bestie / thread_sleep_with_custom_state.rb
Last active September 7, 2022 10:22
Ruby Thread#stop / #Thread.stop? doesn't work how you might think.
# This does work because a my custom thread status is unambiguous.
#
# However, you may notice that setting the status and sleeping are not atomic.
require "net/http"
responses = []
thread = Thread.new do
Thread.current[:what_i_am_doing] = "starting"
@bestie
bestie / build-u-a-ruby.sh
Last active November 14, 2024 17:39
Bash script to build Ruby from source, extracted from build instructions in the repo
#!/usr/bin/env bash
set -e
./configure --with-opt-dir=$(brew --prefix gmp):$(brew --prefix jemalloc)
export CONFIGURE_ARGS=""
for ext in openssl readline libyaml zlib; do
CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-$ext-dir=$(brew --prefix $ext)"
done
@bestie
bestie / Dockerfile
Created April 7, 2025 10:26
Earthly auto-skip DB dumper
FROM golang:1.24-bookworm
WORKDIR /app
COPY dumper.go .
RUN go mod init boltdbdumper && \
go get go.etcd.io/bbolt@latest && \
go mod tidy && \
go build -o dumper