Skip to content

Instantly share code, notes, and snippets.

View flexiondotorg's full-sized avatar
❄️
Nix & NixOS

Martin Wimpress flexiondotorg

❄️
Nix & NixOS
View GitHub Profile
@flexiondotorg
flexiondotorg / README.md
Created October 19, 2026 14:10
macos-alloc-bench: an Ebitengine draw call benchmark for Metal

macos-alloc-bench

macos-alloc-bench measures the frame rate of an Ebitengine scene that the CPU cost of draw calls and render passes limits. It uses only the public Ebitengine API.

Each frame draws -draws 8x8 sprites with DrawImage into -targets offscreen images of 64x64 pixels, and then draws each offscreen image onto the screen. The draws alternate between BlendSourceOver and BlendLighter, so that no draws merge. The offscreen images are unmanaged, so each one has its own texture, and each change of destination starts a render pass. With -targets 64 -draws 6000, a frame has 6,128 draw calls and 128 render passes.

Vsync is off, the window is 1280x800, and the TPS is 60. The program skips 3 seconds of warm-up, measures 20 seconds, writes one JSON line, and quits.

Build

@flexiondotorg
flexiondotorg / starship.toml
Created December 2, 2024 16:19
A delightful Catppuccin theme for Starship
add_newline = false
command_timeout = 1000
format = "[](surface1)$os[](bg:surface2 fg:surface1)$username$sudo[](bg:overlay0 fg:surface2)$hostname[](bg:mauve fg:overlay0)$directory[](fg:mauve bg:peach)$c$dart$dotnet$elixir$elm$erlang$golang$haskell$haxe$java$julia$kotlin$lua$nim$nodejs$rlang$ruby$rust$perl$php$python$scala$swift$zig$package$git_branch[](fg:peach bg:yellow)$git_status[](fg:yellow bg:teal)$container$direnv$nix_shell$cmd_duration$jobs$shlvl$status$character"
palette = "catppuccin_mocha"
[c]
format = "[ $symbol]($style)"
style = "fg:base bg:peach"
symbol = ""
@flexiondotorg
flexiondotorg / twitch-metrics.sh
Last active December 16, 2021 07:00
Get Twitch channel metrics via DecAPI
#!/usr/bin/env bash
TWITCH_CHANNEL="wimpysworld"
METRICS_PATH="${HOME}/Studio/OBS/twitch-metrics"
mkdir -p "${METRICS_PATH}"
for ENDPOINT in $(wget -q https://decapi.net/twitch/ -O - | jq -r '[.endpoints[] | select(contains("CHANNEL")) | select(contains("USER") | not)] | @tsv'); do
ENDPOINT_NAME=$(echo "${ENDPOINT}" | cut -d'/' -f5)
ENDPOINT_URL="${ENDPOINT//\{CHANNEL\}/${TWITCH_CHANNEL}}"
# Get the 5 most recent followers and skip deprecated endpoints.
@flexiondotorg
flexiondotorg / streamdeck.sh
Last active September 19, 2022 13:34
Install StreamDeck Unix on Ubuntu
#!/usr/bin/env bash
if [ "$(id -u)" -ne 0 ]; then
echo "ERROR! Must be root."
exit 1
fi
export GOPATH="/tmp/go"
if [ -d "${GOPATH}" ]; then
rm -rf "${GOPATH}"
@flexiondotorg
flexiondotorg / aitums-butler.py
Last active November 3, 2021 13:31
Aitum's Butler PoC
#!/usr/bin/env python3
import argparse
import http.server
import signal
import socketserver
import subprocess
import sys
from urllib.parse import urlparse
@flexiondotorg
flexiondotorg / install_dockerslim.sh
Created September 17, 2021 14:00
DockerSlim scripted install
#!/usr/bin/env bash
function get_dockerslim() {
local DIST=""
local EXT=""
local FILENAME=""
local KERNEL=""
local MACHINE=""
local TMP_DIR=""
local URL=""
@flexiondotorg
flexiondotorg / tlp-stat.md
Created April 14, 2021 09:39
tlp-stat for USB audio suspend bug
--- TLP 1.3.1 --------------------------------------------

+++ Configured Settings:
defaults.conf L0004: TLP_ENABLE="1"
defaults.conf L0005: TLP_PERSISTENT_DEFAULT="0"
defaults.conf L0006: DISK_IDLE_SECS_ON_AC="0"
defaults.conf L0007: DISK_IDLE_SECS_ON_BAT="2"
defaults.conf L0008: MAX_LOST_WORK_SECS_ON_AC="15"
defaults.conf L0009: MAX_LOST_WORK_SECS_ON_BAT="60"
@flexiondotorg
flexiondotorg / hotshot-racing-grand-prix.sh
Created December 20, 2020 23:07
Hotshot Racing Standings
#!/usr/bin/env bash
# The format of the input data file is as follows:
#
# Name, Emoji Country Flag, Space seperated race finishes
#
# For example:
#
# Wimpy,🇬🇧,1 2 3 3 4
# popey,🇬🇧,2 3 1 2 2
@flexiondotorg
flexiondotorg / Ayatana-TODO.md
Last active September 20, 2020 19:44
Migrate Ubuntu Indicators to Ayatana Indicators

Migrate to Webcamoid

  • Update seeds
  • Update and upload ubuntu-mate-meta

Migrate to Ayatana Indicators

  • Sync mate-indicators-applet from Debian unstable
  • Modify Ubuntu MATE seeds to include ayatana-indicators-* and artica-greeter
  • Update and upload ubuntu-mate-meta
@flexiondotorg
flexiondotorg / slide-shot.sh
Created January 16, 2020 23:52
Take screenshots suitably scaled for use in Ubuntu Ubiquity slideshows.
#!/usr/bin/env bash
# Grab a screen shot of a window correct scaled for use in the
# Ubuntu Ubiquity slide shows.
RES_X=896
RES_Y=702
# Get the window we want to resize
TMP_XWININFO=$(mktemp -u)
echo -e "Please select the window you\nwould like to screenshot by clicking the\nmouse in that window."