Skip to content

Instantly share code, notes, and snippets.

View Brendonovich's full-sized avatar

Brendan Allan Brendonovich

View GitHub Profile
@Brendonovich
Brendonovich / vite-opencode-picker.ts
Last active September 30, 2026 15:23
Development-only Vite element picker for sending UI feedback to OpenCode V2
// Now available as a Vite plugin!
// https://npmx.dev/@brendonovich/vite-plugin-opencode
import type { IncomingMessage, ServerResponse } from "node:http";
import type { Plugin } from "vite";
import {
transformAsync,
types,
type NodePath,
#!/usr/bin/env node
import fs from "node:fs/promises";
import nPath from "node:path";
const projectPath = process.argv[2];
const contentDir = nPath.join(projectPath, "content");
const segmentsDir = nPath.join(contentDir, "segments");
const exists = (path) =>
use ffmpeg::{
codec as avcodec,
format::{self as avformat},
};
use std::path::Path;
// F32 sample buffer with AUDIO_FORMAT
// Always packed/interlaced
pub struct AudioSampleBuffer {
samples: Vec<f32>,
@Brendonovich
Brendonovich / main.swift
Created January 20, 2025 14:11
Camera recording with swift
// I want this to be frame-by-frame in future
import Cocoa
import PlaygroundSupport
import AVFoundation
class WebcamRecorder: NSObject, AVCaptureFileOutputRecordingDelegate {
private var captureSession: AVCaptureSession?
private var videoOutput: AVCaptureMovieFileOutput?
@Brendonovich
Brendonovich / main.rs
Last active January 20, 2025 17:38
Frame-by-frame h264 decoding with AVAssetReader
// the equivalent in rust via cidre
use std::time::Instant;
use cidre::{av, ns};
const PATH: &str = r#"./assets/display.mp4"#;
#[tokio::main]
async fn main() {
let asset = av::UrlAsset::with_url(&ns::Url::with_fs_path_str(PATH, false), None).unwrap();
@Brendonovich
Brendonovich / CLA.md
Created January 17, 2024 05:12
MacroGraph CLA

Contributor License Agreement

We are incredibly thankful for contributions we receive from the community. We require our external contributors to sign a Contributor License Agreement ("CLA") in order to ensure that our projects remain licensed under Free and Open Source licenses such as AGPLv3 or Apache 2 allowing MacroGraph Technologies to build a sustainable business.

MacroGraph Technologies is committed to having a true Free and Open Source Software ("FOSS") license for our non-commercial software. A

This file has been truncated, but you can view the full file.
"use strict";
const https = require("https");
const querystring = require("querystring");
const aws4 = require("aws4");
class PollyTTS {
constructor(credentials) {
this.credentials = credentials;
}