Skip to content

Instantly share code, notes, and snippets.

@Boorj
Boorj / Vosk TTS model N-API wrapper using ffi-rs library.md
Last active October 23, 2025 00:25
Vosk TTS model N-API wrapper using ffi-rs library

Updated version of vosk for node

Nothing difficult: just changed define a signature and wrapped each call parameter group to tuples.

@KristofferEriksson
KristofferEriksson / useTextSelection.ts
Last active March 24, 2025 14:37
A React Typescript hook that tracks user text selections & their screen positions
import { useEffect, useState } from "react";
type UseTextSelectionReturn = {
text: string;
rects: DOMRect[];
ranges: Range[];
selection: Selection | null;
};
const getRangesFromSelection = (selection: Selection): Range[] => {