Skip to content

Instantly share code, notes, and snippets.

View maietta's full-sized avatar

Nick Maietta maietta

View GitHub Profile
@maietta
maietta / docker-wp-restore.md
Last active April 16, 2026 15:43
WordPress & MariaDB Recovery: Restore gzipped tarball contents to Docker volumes and sync database via wp-config.php credentials.

WordPress Docker Volume Restoration Guide

This guide outlines the process of extracting a gzipped backup into a Docker volume and importing the corresponding SQL database.

1. Extract Files to Volume

Restores the wordpress/ folder from backup.tar.gz to the wordpress-12345 volume.

docker run --rm -v $(pwd):/backup -v wordpress-12345:/target busybox \
sh -c "tar -xzf /backup/backup.tar.gz -C /target --strip-components=1 wordpress/"

## 2. Sync Permissions
@maietta
maietta / bun-connect-over-cloudflare-tunnel.ts
Last active January 25, 2026 23:11
Connect to a server via Cloudflare Tunnel programmatically through Bun.
import { Client } from 'ssh2';
import { Duplex } from 'node:stream';
import { spawn } from 'node:child_process';
import { bin as cloudflaredBin } from 'cloudflared';
import { generateKeyPairSync } from 'node:crypto';
const hostname = 'ssh.somehostname.com';
const port = 22;
const username = 'root';
const password = 'secret';
@maietta
maietta / PHOTO_PROCESSING_FIXES.md
Created January 16, 2026 18:29
Hotfix for RETS processing

Photo Processing Fixes - Implementation Summary

Date: 2026-01-16
Status: ✅ COMPLETED


Changes Implemented

1. ✅ Fixed Race Condition in markAsProcessing (Issue #1)

@maietta
maietta / BRIGHTNESS_CONTROL_README.md
Created October 17, 2025 16:39
# Per-Monitor Brightness Control for Hyprland + Waybar (Tested with Omarchy)

Per-Monitor Brightness Control for Hyprland + Waybar

A comprehensive solution for controlling brightness on multiple monitors in Hyprland, with per-monitor Waybar widgets and keyboard shortcuts.

Features

  • 🖥️ Per-Monitor Control: Each Waybar instance shows and controls its own monitor's brightness
  • ⌨️ Keyboard Shortcuts: Control focused monitor brightness with Right Ctrl + Arrow keys
  • 🖱️ Waybar Widget: Scroll to adjust, click to set 100% or 0%
  • 🔄 Smart Detection: Automatically handles different monitor types:
@maietta
maietta / algo.md
Created May 23, 2025 21:14
# Stream Deck+ Button Detection Algorithm

Stream Deck+ Button Detection Algorithm

This document describes the algorithm used to detect button presses and releases on the Stream Deck+ device.

Data Format

The Stream Deck+ sends 14-byte packets for button events. The first byte (data[0]) determines the event type:

  • 1: Button or encoder event
  • 2: Touchscreen event
  • 3: Dial event
@maietta
maietta / .env
Created May 18, 2025 18:30
Pocketbase MCP with Cursor IDE config example.
POCKETBASE_URL=
POCKETBASE_ADMIN_EMAIL=
POCKETBASE_ADMIN_PASSWORD=
@maietta
maietta / pipecat-openrouter.py
Created May 13, 2025 17:10
Sample pipecat openrouter test script
import os
import asyncio
import random
from dotenv import load_dotenv
from loguru import logger
from pipecat.services.openrouter.llm import OpenRouterLLMService
from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext
# Sample questions to ask
QUESTIONS = [
@maietta
maietta / streamdeck-lcd-test.ts
Created March 10, 2025 07:02
Stream Deck Plus LCD testing in TYpeScript & Bun
import { openStreamDeck, listStreamDecks, StreamDeck } from '@elgato-stream-deck/node';
import sharp from 'sharp';
import HID from 'node-hid';
import usb, { LibUSBException } from 'usb';
async function main() {
try {
console.log('Looking for Stream Deck Plus devices...');
// Find the Stream Deck Plus device
@maietta
maietta / intro.md
Created March 6, 2025 20:04
Vibe Coding Cleanup Service

Marketing Website Outline: Vibe Coding Cleanup Crew

General Design Notes

  • Tone: Friendly yet authoritative—appeal to non-technical users while signaling deep expertise.
  • Visuals: Clean, modern design with subtle nods to AI (e.g., abstract code waves) and professionalism (e.g., polished app screenshots).
  • Call-to-Action (CTA): “Get a Free Project Assessment” or “Polish My App Now” on every page.

1. Homepage

@maietta
maietta / limbo.ts
Last active February 21, 2025 17:55
This program uses limbo-wasm to create an in-memory SQLite database that tracks and logs changes to a users table using triggers and a polling listener.
import { Database } from 'limbo-wasm';
// Initialize Limbo database in memory
const db = new Database(':memory:');
// Function to initialize the database with error handling
function initializeDatabase() {
try {
db.exec(`
CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT);