Skip to content

Instantly share code, notes, and snippets.

View guest271314's full-sized avatar
💭
Fix WontFix

guest271314

💭
Fix WontFix
View GitHub Profile
@guest271314
guest271314 / show-me-your-crashes.md
Created October 13, 2025 02:16
Show me your crashes, or crash...
@guest271314
guest271314 / packages.txt
Created September 20, 2025 20:52
dpkg --set-selections
a2jmidid install
abgate install
accountsservice install
acl install
acpi-support install
acpid install
adduser install
adwaita-icon-theme install
aeolus install
albatross-gtk-theme install
@guest271314
guest271314 / imitation.md
Created September 20, 2025 19:53
Imitation is the best form of flattery...
@guest271314
guest271314 / return-0.md
Created September 10, 2025 05:22
When all you need to do for "Node.js compatibility" is return 0...
@guest271314
guest271314 / deno-websocket-22-bytes.md
Created September 2, 2025 07:28
Why does Deno send 22 extra bytes when closing a WebSocket connection?

Why does Deno send 22 extra bytes when closing a WebSocket connection?

[136, 144, 234, 110, 246, 61, 249, 233, 178, 82, 132, 11, 214, 78, 158, 28, 147, 92, 135, 7, 152, 90]
[136, 144, 51, 194, 179, 223, 32, 69, 247, 176, 93, 167, 147, 172, 71, 176, 214, 190, 94, 171, 221, 184]
@guest271314
guest271314 / hex-from-array.md
Last active August 17, 2025 18:45
Hex from array

From discord, AssemblyScript channel

guest271314 Let's say you have a TypedArray such as var u = Uint8Array.of(49, 48, 48, 48) and you know those values in hexidecimal will produce an integer parseInt(new TextDecoder().decode(u), 16) // 4096. How can that 4096 be derived without converting to a string, using DataView or other methods to get the integer?

PhoenixIllusion case insensitive ascii-to-hex could be brute forced via:

function hexFromArray(a) {
@guest271314
guest271314 / transfer-encoding-chunked-parser.js
Last active August 16, 2025 17:56
Transfer-Encoding: chunked parser JavaScript
function getChunkedData(u8) {
let crlfIndex = 0;
let chunkLength = "";
let chunkBuffer = new Uint8Array(0);
crlfIndex = u8.findIndex((v, k, array) => v === 13 && array[k + 1] === 10);
if (crlfIndex > -1) {
// https://gist.github.com/guest271314/d6e932154e11fffb75fd7d1a4b25f4f5
for (let i = 0; i < crlfIndex; i++) {
const hex = u8[i];
let intVal = hex & 0xF;
@guest271314
guest271314 / datachannel-stream.js
Created July 13, 2025 23:28
WHATWG Streams with WebRTC Data Channel
/*
https://github.com/w3c/webrtc-pc/issues/1732
https://github.com/w3c/webrtc-nv-use-cases/issues/44
https://github.com/w3c/webrtc-rtptransport/issues/8
https://www.w3.org/2023/12/05-webrtc-minutes.html#t14
*/
var decoder = new TextDecoder();
var local = new RTCPeerConnection({
sdpSemantics: "unified-plan",
@guest271314
guest271314 / deno-wt-server.js
Created July 13, 2025 17:51
Deno WebTrasport server
import certificates from "./cert.json" with { type: "json" };
const serverCertificateHashes = [{
algorithm: "sha-256",
value: Uint8Array.from(certificates[0].hash.digest)
}];
let requests = 0;
async function handleTransport(wt) {
let incomingTotalLength = 0;
let incomingCurrentLength = 0;
const buffer = new ArrayBuffer(0, { maxByteLength: 4 });
@guest271314
guest271314 / node-tcp-udp-server.js
Created June 30, 2025 03:18
Node.js TCP and UDP server
import { Server } from "node:net";
import { Duplex } from "node:stream";
import { createSocket } from "node:dgram";
const abortable = new AbortController();
const encoder = new TextEncoder();
const decoder = new TextDecoder();
const {
signal,