Skip to content

Instantly share code, notes, and snippets.

View SagePtr's full-sized avatar
🍴
Eating everything

Sage Pointer SagePtr

🍴
Eating everything
View GitHub Profile
@SagePtr
SagePtr / mini_quic_generator.php
Last active March 20, 2026 19:04
Mini QUIC generator (dirty code version, PHP)
<?php declare(strict_types=1);
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
<?php
class DerHelpers
{
public const COSE_ALG_EDDSA = -8;
public const COSE_ALG_ES256 = -7;
public const COSE_ALG_RS256 = -257;
public const COSE_KTY_OKP = 1;
@SagePtr
SagePtr / gist:67d99bef609ad44925ccb1fbeacf81aa
Created July 7, 2025 17:59
Turing Complete finding optimal 3-bit decoder
const { Combination } = require("js-combinatorics");
const and = (a,b) => a & b;
const nor = (a,b) => !(a | b);
const or = (a,b) => (a | b);
const nand = (a,b) => !(a & b);
const b2i = (a) => a ? 1 : 0;
const ops = [
{'name': 'and', 'fn': and},