Skip to content

Instantly share code, notes, and snippets.

View thomcc's full-sized avatar
🦀

Thom Chiovoloni thomcc

🦀
View GitHub Profile
ChromeUtils.import("resource://gre/modules/SyncedBookmarksMirror.jsm");
async function addBookmarks() {
let buf = await SyncedBookmarksMirror.open({
path: ":memory:",
recordTelemetryEvent() {},
});
let menu = {
id: "menu",
@thomcc
thomcc / gist:d23fbed230f5e06d91409f31a2fc9985
Created November 5, 2020 10:55 — forked from rygorous/gist:2203834
float->sRGB8 using SSE2 (and a table)
// float->sRGB8 conversions - two variants.
// by Fabian "ryg" Giesen
//
// I hereby place this code in the public domain.
//
// Both variants come with absolute error bounds and a reversibility and monotonicity
// guarantee (see test driver code below). They should pass D3D10 conformance testing
// (not that you can verify this, but still). They are verified against a clean reference
// implementation provided below, and the test driver checks all floats exhaustively.
//