Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
export CUDA_MALLOC_ASYNC_SUPPORTED=1
export GGML_CUDA_FORCE_MMQ=1
IMAGE="${IMAGE:-llama-turboquant:cuda}"
HOST_PORT="${HOST_PORT:-8080}"
NETWORK="${NETWORK:-runner-network}"
@gvoze32
gvoze32 / ffmpeg mp3 to mp4.MD
Last active July 20, 2026 19:02
Convert mp3 audio to MP4 using ffmpeg in terminal.

To convert audio mp3 to MP4 by ffmpeg, use the following command

ffmpeg -f lavfi -i color=c=black:s=1280x720:r=5 -i audio.mp3 -crf 0 -c:a copy -shortest output.mp4

Description

This generates mp4 formatted video with blank black background with the color source filter instead of using an image.

Since it is just black video this is one case with lossless mode (-crf 0) will have a smaller file size than the default lossy mode.

@leonid-ed
leonid-ed / udp_to_local.c
Last active July 20, 2026 19:02
Examples of using raw sockets (c, linux, raw socket)
/*
An example of using raw sockets.
You can capture packets by tcpdump:
tcpdump -X -s0 -i lo -p udp
*/
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
@rex
rex / favorite-libraries.md
Last active July 20, 2026 19:01
A list of my favorite libraries, grouped for sanity
@rex
rex / loading_messages.json
Created January 2, 2019 17:56
Funny loading messages
[
"swapping space and time",
"downloading golf balls",
"warming up reactor",
"reticulating splines",
"searching for the answer to life, the universe, and everything",
"counting backwards from infinity",
"pay no attention to the man behind the curtain",
"Calculating gravitational constant in your bay",
"following the white rabbit",
@rex
rex / css-reloader.js
Created June 12, 2019 16:23
A handy script to aid in UI development; reloads only CSS without reloading the entire page.
window.css_refresh_index = 0;
const begin = () => {
var nodes = document.querySelectorAll('link');
[].forEach.call(nodes, function (node) {
node.href += '?___ref=0';
});
}
const refresh = () => {
if (!window.css_refresh_index) {
@rex
rex / AGENTS.md
Last active July 20, 2026 18:54
Utility prompts for AI agents to perform various commonplace tasks inside a codebase

Role: You are an expert AI-assisted software engineer. Your task is to analyze a given codebase and generate a set of robust, best-practice AGENTS.md files to help other AI coding agents understand and contribute to this project effectively.

Objective: Create one AGENTS.md file at the project root and, where appropriate, additional AGENTS.md files in key subdirectories (like packages in a monorepo or distinct modules like /frontend and /api). These files will serve as the primary instruction set for AI agents.

Process:

  1. Analyze Codebase Structure:

    • Scan the entire file tree to identify the project's overall architecture.
  • Identify the primary package.json, pyproject.toml, go.mod, pom.xml, build.gradle, requirements.txt, or similar dependency/build file to understand the project's main language, framework, and build system.
@somebox
somebox / teensy-41-guide.md
Created June 29, 2025 01:40
Teensy 4.1 Best Practices

Teensy 4.1 Microcontroller: A Community Reference Guide

This guide synthesizes practical knowledge, best practices, and known issues for the Teensy 4.1 microcontroller, based on extensive community discussions. It is intended for developers, hobbyists, and engineers designing circuits and software with the Teensy 4.1. The information was reviewed by a human, with summarization and structuring help from Gemini 2.5 Studio.

Getting Started: Development Environment & Toolchain

Arduino IDE & Teensyduino Setup

  • Best Practice: For reliable development, use the official Teensyduino installer with a supported version of the Arduino IDE.
    • For Arduino IDE 1.8.x, only specific versions are supported, with 1.8.19 being the most recommended. Teensy support must be added by running the Teensyduino installer and pointing it to the IDE's location.
@rex
rex / esp32-capabilities-and-pinouts.md
Last active July 20, 2026 18:50
ESP32 Capabilities and Pinouts

ESP32 Audio & Peripherals Quickstart — with Pinout & Mermaid Diagram

Author: Bex (for Pierce)
Scope: How to generate real audio (polyphony) on ESP32, what “peripherals” are, and a practical overview of ESP32 (WROOM-32 class) pins & capabilities. Includes a ready-to-run chord synth and a Mermaid pinout diagram.

⚠️ Board variance note: The mapping below targets the common ESP32-WROOM-32 / DevKit v1 family. Some boards re-label or reserve certain pins (e.g., PSRAM modules, onboard flash). Always confirm with your module’s schematic/datasheet.


1) Real Polyphony on ESP32 (Why DAC beats PWM)

@barraIhsan
barraIhsan / 8BitDoUltimate2Wireless.md
Last active July 20, 2026 18:49
8BitDo Ultimate 2 Wireless on GNU/Linux, SteamOS, and Windows

Most of the source comes from: Steam Beta Forum

Thank you so much to everyone in the forum for contributing, for reaching out to 8BitDo to request switching between XInput/DInput/Switch mode on the dongle, to Valve for adding support on DInput mode, to the SDL developers (and 8bitdo) for adding support on DInput mode, and finally, to the Linux kernel developers for adding support on XInput mode.

This gist summarizes everything from that forum.

Switching Mode

So after the latest firmware update (as the time of writing: Controller 1.06, Adapter 1.04), its now possible to switch to DInput and Switch mode by holding B (DInput) or Y (Switch) while turning on t