Skip to content

Instantly share code, notes, and snippets.

View notnotrishi's full-sized avatar
🤷‍♂️

Rishi notnotrishi

🤷‍♂️
View GitHub Profile
@notnotrishi
notnotrishi / app.py
Created January 6, 2026 01:31
Flask app to convert single image to 3D scene (Gaussian splat) using Apple's SHARP model and render them with GaussianSplats3D viewer by Mark Kellogg
"""
Flask application for converting images to 3D using Apple's SHARP model.
Installation:
1. Clone ml-sharp repository:
git clone https://github.com/apple/ml-sharp
cd ml-sharp
pip install -r requirements.txt
2. Install Flask and Flask-CORS:
@notnotrishi
notnotrishi / main.py
Created January 6, 2026 01:29
Flask app to convert single image to 3D scene (Gaussian splat) using Apple's SHARP model and render them with Spark viewer
"""
Flask application for converting images to 3D using Apple's SHARP model.
Installation:
1. Clone ml-sharp repository:
git clone https://github.com/apple/ml-sharp
cd ml-sharp
pip install -r requirements.txt
2. Install Flask and Flask-CORS:
@notnotrishi
notnotrishi / beeper_watcher.c
Last active December 30, 2025 19:54
Lightweight C daemon to watch Beeper Desktop for new messages on macOS/Linux (hack around missing webhooks). Polls the local API, keeps a low RSS (<1MB), reads token/optional hook from env or ini, and can fire any shell command on new unread (e.g., curl). Run directly, under nohup, or via launchd/systemd for persistence.
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/resource.h>
#include <sys/time.h>
(() => {
// Detect environment
const detectEnvironment = () => {
const ua = navigator.userAgent;
const isVSCode = ua.includes('Visual Studio Code') ||
typeof acquireVsCodeApi !== 'undefined' ||
window.vscodeApi !== undefined;
const isElectron = ua.includes('Electron') || typeof require !== 'undefined';
const isChrome = /Chrome/.test(ua) && !/Edge/.test(ua);
const isFirefox = /Firefox/.test(ua);
@notnotrishi
notnotrishi / stt.py
Created August 19, 2025 23:57
Cartesia STT streaming example
import asyncio
import os
import pyaudio
from cartesia import AsyncCartesia
async def streaming_stt_example():
"""
Advanced async STT example for real-time streaming applications.
This example captures microphone input and processes it in real-time
with proper error handling and demonstrates endpointing and word timestamp features.
@notnotrishi
notnotrishi / estimate_corner_radius.py
Last active July 23, 2025 00:21
Estimate corner radius
# This function estimates the corner radius of a window by checking multiple directions from each corner
# and finding the distance where the image changes from transparent to solid.
# It’s useful for detecting rounded corners in screenshots of macOS windows or pixel data of images etc.
def estimate_corner_radius(self, image_or_array, threshold=128, samples=8):
import math
import numpy as np
# if input is a PIL Image, convert to numpy array
if hasattr(image_or_array, 'convert'):