Skip to content

Instantly share code, notes, and snippets.

View maietta's full-sized avatar

Nick Maietta maietta

View GitHub Profile
@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);
@maietta
maietta / migrate.ts
Created February 15, 2025 04:37
Bun script to migrate SQLite data into Pocketbase via Batch API
import { Database } from 'bun:sqlite';
import PocketBase from 'pocketbase';
const BATCH_SIZE = 50;
const SLEEP_TIME = 1000;
const pb = new PocketBase('https://tx-addresses.pockethost.io');
const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
async function migrateData() {
@maietta
maietta / Dockerfile
Created February 14, 2025 04:17
Self hosting SvelteKit SSR applications with Bun latest, with Health-checking.
ARG BUN_VERSION=latest
FROM oven/bun:${BUN_VERSION} AS builder
WORKDIR /app
ENV NODE_ENV=production
# Copy package files first
COPY --link bun.lock package.json ./
# Add conditional installation of svelte-adapter-bun and update config
@maietta
maietta / .env
Created January 17, 2025 04:46
Gitea Webhook Proxy for Coolify
COOLIFY_API_URL=https://coolify.yourdomain.com
COOLIFY_API_KEY=abc123
WEBHOOKS_SECRET=shared-secret-between-gitea-and-deploy
@maietta
maietta / coolify_webhook_proxy_handler.ts
Created January 12, 2025 06:20
Proxies webhook payloads from Gitea and triggers a deploy for a matching repo and branch.
import { serve } from "bun";
import fs from "fs";
// Extract the repository name and branch from the payload
function extractRepoInfo(payload: { repository: { full_name: string }; ref: string }) {
const repoName = payload?.repository?.full_name; // Repository name is in 'full_name'
const branch = payload?.ref?.split("/").pop(); // Branch name is after 'refs/heads/'
return { repoName, branch };
}