Skip to content

Instantly share code, notes, and snippets.

@polyfjord
polyfjord / batch_reconstruct.bat
Created August 3, 2025 10:51
Batch script for automated photogrammetry tracking workflow
:: ================================================================
:: BATCH SCRIPT FOR AUTOMATED PHOTOGRAMMETRY TRACKING WORKFLOW
:: By polyfjord - https://youtube.com/polyfjord
:: ================================================================
:: USAGE
:: • Double-click this .bat or run it from a command prompt.
:: • Frames are extracted, features matched, and a sparse
:: reconstruction is produced automatically.
:: • Videos that have already been processed are skipped on
:: subsequent runs.
@bradleyhodges
bradleyhodges / snowflake_id.sql
Created May 24, 2025 06:15
Ultra-tuned PL/pgSQL Snowflake ID generator for Supabase Postgres. Provides 41-bit millisecond timestamps, 10-bit node IDs, and a 12-bit cached, cycling sequence entirely within a dedicated schema. No C extensions required.
-- Create separate schema for Snowflake logic. See: https://supabase.com/docs/guides/database/extensions?queryGroups=database-method&database-method=dashboard#enable-and-disable-extensions#:~:text=To%20avoid%20namespace%20pollution,%20we%20do%20not%20recommend%20creating%20other%20entities%20in%20the%20extensions%20schema.
CREATE SCHEMA IF NOT EXISTS snowflake_ext;
-- High-performance 12-bit sequence
CREATE SEQUENCE IF NOT EXISTS snowflake_ext.sequence_12bit
AS BIGINT
START 0
INCREMENT 1
MINVALUE 0
MAXVALUE 4095
@ipenywis
ipenywis / cursor-memory-bank-rules.md
Last active November 9, 2025 15:22
Cursor Memory Bank

Cursor's Memory Bank

I am Cursor, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.

Memory Bank Structure

The Memory Bank consists of required core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:

flowchart TD
@t3dotgg
t3dotgg / try-catch.ts
Last active November 11, 2025 09:56
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@awni
awni / mlx_distributed_deepseek.md
Last active November 11, 2025 01:00
Run DeepSeek R1 or V3 with MLX Distributed

Setup

On every machine in the cluster install openmpi and mlx-lm:

conda install conda-forge::openmpi
pip install -U mlx-lm

Next download the pipeline parallel run script. Download it to the same path on every machine:

<?php declare(strict_types = 1);
namespace App\Tests;
use Closure;
use PHPUnit\Framework\Assert;
use ReflectionClass;
use ReflectionFiber;
use ReflectionFunction;
use ReflectionGenerator;
@majkinetor
majkinetor / collection.bru
Last active November 21, 2024 08:31
bruno auto login and refresh every 10 minutes
script:pre-request {
const { login } = require('./utils')
await login(req)
}
@babldev
babldev / Dockerfile
Last active March 6, 2024 16:37
Next.js + worker orchestration on Google Cloud example
# Alpine image is smaller but Prisma is broken on M1 https://github.com/prisma/prisma/issues/8478
# FROM node:18-alpine AS builder
# RUN apk update
# RUN apk add --no-cache openssl
FROM node:18-slim AS runner
RUN apt-get update \
&& apt-get install -y openssl
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
@kconner
kconner / macOS Internals.md
Last active November 6, 2025 09:43
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options: