Skip to content

Instantly share code, notes, and snippets.

View justinledwards's full-sized avatar

Justin Edwards justinledwards

  • Florida Ninth Circuit Courts
  • Florida
View GitHub Profile
#!/bin/bash
# llama-server startup script for Qwen3.6-27B Q4_K_M MTP GGUF
# Uses official Docker image with CUDA backend
#
# MTP model from: https://huggingface.co/unsloth/Qwen3.6-27B-MTP-GGUF
# Downloaded to: ~/.cache/huggingface/hub/models--unsloth--Qwen3.6-27B-MTP-GGUF/
#
# Key settings for 128k context on RTX 3090:
# -c 128144 : context (128K, VRAM-limited with MTP)
# -ngl 99 : offload all layers to GPU
@justinledwards
justinledwards / audiowaveform.js
Created September 2, 2025 14:43
easy to follow explanation of audio waveform code
useEffect(() => {
// If we do not have audio data yet or the canvas is not available, stop here.
if (!lastRenderedBuffer || !waveformRef.current) return;
// 1) Get the canvas and its 2D drawing context.
const canvas = waveformRef.current;
const ctx = canvas.getContext("2d");
// Canvas width and height in pixels.
const w = canvas.width;
@justinledwards
justinledwards / audio_whiteness_batch_v2.py
Last active August 28, 2025 19:35
white noise analysis
#!/usr/bin/env python3
"""
audio_whiteness_batch_v2.py
Batch detector that flags files which are not white noise, with better
handling of decode errors and blank regions. It
1) tries robust ffmpeg decode options
2) removes long silent or near silent spans before PSD analysis
3) requires a minimum usable coverage ratio
@justinledwards
justinledwards / index.js
Last active July 5, 2025 18:10
Project tasks mcp
import express from "express";
import { randomUUID } from "node:crypto";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
import { isInitializeRequest } from "@modelcontextprotocol/sdk/types.js";
import { z } from "zod";
import sqlite3 from "sqlite3";
import { open } from "sqlite";
// --- Database Setup ---
@justinledwards
justinledwards / dadjoketest.sh
Created June 24, 2025 20:40
Prometheus Alertmanager Test (Dadjoke Version)
#!/bin/bash
# This script fetches a random dad joke and then sends it as a
# test alert to Alertmanager.
echo "Fetching a random dad joke from icanhazdadjoke.com..."
# Fetch the joke as plain text and store it in a variable.
# The User-Agent is requested by the API's documentation.
JOKE=$(curl -s -H "Accept: text/plain" -H "User-Agent: Prometheus Alert Test (https://example.com)" https://icanhazdadjoke.com/)
@justinledwards
justinledwards / sampler.js
Created June 10, 2025 20:15
sampler demo app
import React, { useState, useRef, useEffect, useCallback } from 'react';
// --- Helper Functions ---
/**
* Decodes audio data from an ArrayBuffer into an AudioBuffer.
* @param {AudioContext} audioContext - The global AudioContext.
* @param {ArrayBuffer} arrayBuffer - The audio data to decode.
* @returns {Promise<AudioBuffer>} A promise that resolves with the decoded AudioBuffer.
*/
@justinledwards
justinledwards / esp-paper.yml
Created April 29, 2025 19:17
proper calendar from a single source on esphome
esphome:
name: epaper
friendly_name: epaper
esp32:
board: esp32-c3-devkitm-1
framework:
type: arduino
logger:
@justinledwards
justinledwards / dust-blows-by.md
Last active March 21, 2025 15:36
Dust blows by

Introduction

Dust always blows by. It drifts across the cracked pavement, settling gently, almost politely, onto everything that stands still too long. Out here, everything eventually succumbs to the dust—the rusted cars, the skeletal remains of abandoned buildings, even the hollow eyes of those who've lingered too long in one place.

The world hadn't ended with a bang as so many had predicted. There was no single catastrophic event that people could point to and say, "That's when it all fell apart." Instead, civilization had unraveled gradually, a tapestry coming loose thread by thread—climate disasters, resource wars, pandemics, economic collapse. Each crisis alone might have been survivable, but together they formed an avalanche that buried the old world beneath layers of chaos and desperation.

A decade later, dust had become the most honest historian of humanity's decline. It recorded the absence of care, the abandonment of hope, the slow surrender to entropy. In the places where people once bustled a

@justinledwards
justinledwards / matrix.py
Created February 19, 2025 15:14
Matrix python
#!/usr/bin/env python3
import os
import sys
import time
import random
import curses
# ANSI escape codes for text formatting
LIGHT_GREEN = '\033[92m'
DARK_GREEN = "\033[0;32m"
@justinledwards
justinledwards / App.svelte
Created September 15, 2024 23:25
prime fireworks
<script>
import { writable } from 'svelte/store';
import { onMount } from 'svelte';
// Declare reactive stores
const primesStore = writable([]);
const progressStore = writable(0);
const timeStore = writable(0);
let isRunning = false;