Skip to content

Instantly share code, notes, and snippets.

View diamondburned's full-sized avatar

Diamond diamondburned

View GitHub Profile
@diamondburned
diamondburned / output.txt
Created November 30, 2025 05:54
intiface-central output
$ intiface-engine --websocket-port 12345 --use-bluetooth-le
Intiface Server, starting up with stdout output.
2025-11-30T05:39:56.322616Z INFO intiface_engine::engine: Intiface CLI Setup finished, running server tasks until all joined.
2025-11-30T05:39:56.322630Z INFO buttplug::util::device_configuration: Loading from internal base device configuration...
2025-11-30T05:39:56.358523Z INFO buttplug::util::device_configuration: Loaded config version ConfigVersion { major: 3, minor: 15 }
2025-11-30T05:39:56.360127Z INFO buttplug::util::device_configuration: No user configuration provided.
2025-11-30T05:39:56.360702Z INFO intiface_engine::buttplug_server: Including Bluetooth LE (btleplug) Device Comm Manager Support
2025-11-30T05:39:56.360741Z INFO buttplug::server::device::server_device_manager: BtlePlugCommunicationManager: false
2025-11-30T05:39:56.363530Z INFO buttplug::server::server_builder: Buttplug Server Operating System Info: NixOS 25.11.0 [64-bit]
2025-11-30T05:39:56.366058Z INFO buttplug::server
@diamondburned
diamondburned / main.go
Created March 10, 2025 07:05
Gio + OpenGL Core Reproducing Program
// SPDX-License-Identifier: Unlicense OR MIT
// GLFW doesn't build on OpenBSD and FreeBSD.
//go:build !openbsd && !freebsd && !android && !ios && !js
// +build !openbsd,!freebsd,!android,!ios,!js
// The glfw example demonstrates integration of Gio into a foreign
// windowing and rendering library, in this case GLFW
// (https://www.glfw.org).
//
@diamondburned
diamondburned / watch-autolock.sh
Created November 3, 2024 21:58
Script to observe for smartwatch's BT signal strength and autolock when it's weak
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bluez
BT_DEVICE="XX:XX:XX:XX:XX:XX"
BT_RSSI_THRESHOLD=-15
get_rssi() {
out=$(hcitool rssi $BT_DEVICE) || return 1
out=${out#*: }
echo $out
@diamondburned
diamondburned / kubeconf
Created July 29, 2024 03:14
kubeconf is a program that assists in managing multiple kubeconfigs. It remembers where kubeconfigs are and allows switching between them.
#!/usr/bin/env bash
KUBECONF_CONFIG_DIR="${XDG_CONFIG_HOME:-"$HOME/.config"}/kubeconf"
KUBECONF_KNOWN_CONFIGS="$KUBECONF_CONFIG_DIR/known_configs"
kubeconf() {
case "$1" in
a|add)
_kubeconf::add "${@:2}"
;;
@diamondburned
diamondburned / gotk4-run.sh
Last active March 11, 2025 00:56
Run gotk4 programs using the system's Nixpkgs because Nix Flakes sucks!!!
#!/usr/bin/env bash
set -eo pipefail
NIX_EXPR=$(cat <<-'EOF'
{
mainProgram,
}:
let
pkgs = import <nixpkgs> { };
@diamondburned
diamondburned / script.js
Created May 4, 2024 06:18
Hypnohub Auto-load Bigger Thumbnails
// ==UserScript==
// @name Hypnohub Auto-load Bigger Thumbnails
// @version 1
// @grant none
// @match *://hypnohub.net/*
// @run-at document-end
// @noframes
// ==/UserScript==
async function urlExists(url) {
const ok = await fetch(url, {method: "GET"}).then(r => r.ok).catch(() => false)
// ==UserScript==
// @name WS hack
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over Discord!
// @author You
// @match https://discord.com/*
// @grant none
// @run-at document-start
// @require https://cdnjs.cloudflare.com/ajax/libs/pako/1.0.11/pako.min.js
@diamondburned
diamondburned / style.css
Last active March 27, 2024 07:41
freedesktop.org but readable
@-moz-document domain("freedesktop.org") {
.refentry {
max-width: 765px;
line-height: 1.5;
margin: auto;
position: relative;
}
.refentry pre {
line-height: 1.25;

This patch is carried over from Nixpkgs' pkgs/development/compilers/go/go_no_vendor_checks-1.21.patch.

It is required for Nixpkgs' buildGoModule to work with Go 1.14+.

@diamondburned
diamondburned / style.css
Created December 11, 2023 04:55
Advent of Code CSS but actually good
* {
box-sizing: border-box;
}
body {
margin: 0 auto;
padding: 1em 1.5em;
min-height: 100vh;
max-width: 800px;
min-width: auto;