Skip to content

Instantly share code, notes, and snippets.

@esynr3z
esynr3z / fj-codex.sh
Created December 14, 2025 09:31
firejail wrapper for codex-cli
#!/usr/bin/env bash
# firejail wrapper for codex-cli
#
# - it requires that codex is logged in at host
# - it creates .codex temprorary directory in current pwd
# - codex home is moved to the current temp directory to store conversations and history
# - no files are available to codex outside current working directory
set -euo pipefail
@arianvp
arianvp / SSH_MACOS_SECURE_ENCLAVES.md
Last active March 15, 2026 07:11
Native Secure Enclaved backed ssh keys on MacOS

Native Secure Enclave backed ssh keys on MacOS

It turns out that MacOS Tahoe can generate and use secure-enclave backed SSH keys! This replaces projects like https://github.com/maxgoedjen/secretive

There is a shared library /usr/lib/ssh-keychain.dylib that traditionally has been used to add smartcard support to ssh by implementing PKCS11Provider interface. However since recently it also implements SecurityKeyProivder which supports loading keys directly from the secure enclave! SecurityKeyProvider is what is normally used to talk to FIDO2 devices (e.g. libfido2 can be used to talk to your Yubikey). However you can now use it to talk to your Secure Enclave instead!

@tkafka
tkafka / Detect electron apps causing macOS Tahoe lag.md
Last active March 10, 2026 05:41
Detect Electron apps on mac where the Electron hasn't yet been updated to fix the system wide lag
@MichaelMoroz
MichaelMoroz / BH.shader
Last active March 25, 2025 16:06
VR Schwarzschild black hole shader (works with SPS and SPS-I)
Shader "Misha/Schwartzschild"
{
Properties
{
[Header(Black Hole)]
_EventHorizonRadius("Event Horizon Radius", Range(0.0, 0.5)) = 0.075
[Header(Accretion)]
[HDR] _AccretionColor("Color", Color) = (1,1,1,1)
@raysan5
raysan5 / installer_optimization_adventure.md
Last active February 13, 2026 11:16
10x Optimizations! An installer creation adventure!

10x Optimization! An installer creation adventure

Background: creating an installer tool

Lately I've been working on rInstallFriendly v2.0, my simple and easy-to-use tool to create fancy software installers.

rInstallFriendly, some visual_styles

rInstallFriendly v2.0, some of its multiple visual styles available. Style is fully customizable!

@remorses
remorses / renamer.ts
Last active December 25, 2025 23:58
Babel `BatchRenamer`, 100x faster babel `scope.rename()` when you have many identifier to rename
// original https://github.com/babel/babel/blob/9c77558234c87b9220604fbc1519089e2d6334e2/packages/babel-traverse/src/scope/lib/renamer.ts#L61
import splitExportDeclaration from '@babel/helper-split-export-declaration'
import type { Scope } from '@babel/traverse'
import { visitors } from '@babel/traverse'
import { traverseNode } from '@babel/traverse/lib/traverse-node'
import * as t from '@babel/types'
import { NodePath, Visitor } from '@babel/core'
import type { Identifier } from '@babel/types'
@Devaniti
Devaniti / SystemSetup.ps1
Last active December 14, 2025 15:03
Setup script for new Windows 11 graphic developer PC.
# Script for setting up new Windows 11 PC for graphic development
# You need need to run it with administator rights
if (!([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList @("-ExecutionPolicy Bypass", "-File `"$($MyInvocation.MyCommand.Path)`"")
Exit
}
Push-Location $env:TEMP
function ShowFileExtensions {
@skeeto
skeeto / heap.c
Last active August 1, 2025 19:22
updatable heap example
// Ref: https://old.reddit.com/r/C_Programming/comments/14a1l4j
// This is free and unencumbered software released into the public domain.
#include <stdint.h>
typedef struct {
long priority;
int32_t index;
} HeapItem;
typedef struct {
@mmozeiko
mmozeiko / win32_webgpu.c
Last active March 3, 2026 18:25
setting up and using WebGPU in C using Dawn
// example how to set up WebGPU rendering on Windows in C
// uses Dawn implementation of WebGPU: https://dawn.googlesource.com/dawn/
// download pre-built Dawn webgpu.h/dll/lib files from https://github.com/mmozeiko/build-dawn/releases/latest
#include "webgpu.h"
#define _CRT_SECURE_NO_DEPRECATE
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
@mmozeiko
mmozeiko / upng.h
Last active October 8, 2024 03:47
uncompressed png writer & reader
#pragma once
// uncompressed png writer & reader
// supports only 8-bit and 16-bit formats
// Performance comparison for 8192x8192 BGRA8 image (256MB)
// Compiled with "clang -O2", AVX2 requires extra "-mavx2" or "/arch:AVX2" argument
//
// For libpng (compressed) uses default libpng/zlib compression settings
// For libpng (uncompressed) case following two functions are used: