Skip to content

Instantly share code, notes, and snippets.

View guest271314's full-sized avatar
💭
Fix WontFix

guest271314

💭
Fix WontFix
View GitHub Profile
@bogeychan
bogeychan / adapter.ts
Last active April 3, 2025 21:14
Basic Bun HTTP2 Adapter for ElysiaJS
// based on https://github.com/elysiajs/elysia/blob/main/src/adapter/bun/index.ts
import type { ElysiaAdapter, MaybePromise } from "elysia";
import { BunAdapter } from "elysia/adapter/bun";
import { isNumericString } from "elysia/utils";
import { ReadStream as NodeReadStream } from "node:fs";
import {
createSecureServer,
type Http2ServerRequest,
@hopeseekr
hopeseekr / StackOverflow Stats.md
Last active December 5, 2025 23:45
StackOverflow Dec 2024 stats

Disclaimer: I'm in the Top 1% of StackOverflow contributors with 23,315 rep points.

I asked 1 high-quality question in 2024, and it was closed almost immediately, and I haven't engaged with the site since.

If someone with 20,000+ karma has their nicely-formatted questions closed so quickly, what must the newbies and rank-in-file encounter? This is probably a big reason why it's declining.


@Hakkadaikon
Hakkadaikon / websocket_flame_parse.c
Created December 30, 2024 10:07
Websocket frame parse (RFC6455)
/**
* @file websocket_frame_parse.c
*
* @brief Parses each parameter of a websocket frame stored in network byte order.
* @see RFC6455 (https://datatracker.ietf.org/doc/html/rfc6455)
*/
#include <alloca.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
@vitaly-t
vitaly-t / chain-arrays.ts
Last active October 2, 2024 13:45
Logically concatenates arrays
/**
* Iterable arrays chain, extended for "getLength" and "at" accessor.
*/
export interface IArraysChain<T> extends RelativeIndexable<T>, Iterable<T> {
/**
* Calculates total length of all input arrays combined.
*/
getLength(): number;
}
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[338],{578:(e,t,r)=>{e.exports=r.p+"7cf7ced34f0a1ece31b4.wasm"},338:(e,t,r)=>{var n;r.r(t),r.d(t,{default:()=>a});const a=(n="file:///private/tmp/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.mjs",function(e={}){var t,a,o=e;function i(e){e={log:e||function(){}};for(const t of i.za)t(e);return o.quickJSEmscriptenExtensions=e}o.ready=new Promise(((e,r)=>{t=e,a=r})),i.za=[],o.quickjsEmscriptenInit=i,i.za.push((e=>{e.getWasmMemory=function(){return Q}}));var _,u=Object.assign({},o),l="./this.program",s="object"==typeof window,f="function"==typeof importScripts,S="";(s||f)&&(f?S=self.location.href:"undefined"!=typeof document&&document.currentScript&&(S=document.currentScript.src),n&&(S=n),S=0!==S.indexOf("blob:")?S.substr(0,S.replace(/[?#].*/,"").lastIndexOf("/")+1):"",f&&(_=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}));var c,T=o.print||con
@jimmywarting
jimmywarting / cjs-in-esm.md
Last active January 27, 2024 18:02
using cjs in esm runtime (NodeJS)
@orl0
orl0 / bun.sh
Created October 30, 2023 13:43
#!/bin/sh
if command -v bun > /dev/null 2>&1; then
if [ -p /dev/stdin ]; then
stdin_fd="$(mktemp -t XXXXXXXX.bun_stdin.ts)"
command cat - >"$stdin_fd"
command exec 0<&-
command bun "$@" "$stdin_fd"
@jordanbtucker
jordanbtucker / base64.js
Last active March 4, 2025 08:39
Base64
export function bytesToBase64(bytes) {
return btoa(String.fromCharCode(...bytes));
}
export function bytesToBase64URL(bytes) {
return bytesToBase64(bytes)
.replaceAll("+", "-")
.replaceAll("/", "_")
.replaceAll("=", "");
}
@voluntas
voluntas / h2c.go
Created August 22, 2023 00:55
HTTP/2 over TCP
package main
import (
"net/http"
"github.com/labstack/echo/v4"
"golang.org/x/net/http2"
"golang.org/x/net/http2/h2c"
)
@tghpereira
tghpereira / Readme.md
Last active March 8, 2025 17:43
Create native api websocket in nodejs (Experimental)

Create native websocket api in node js (Experimental)

Goal

Allow greater control of websockets in the api without relying on libs with socket.io and ws. Looking for the basic implementation of reading and writing data and connection handshake for projects where socket.io and ws do not support the required functionalities in the project.

Issues encountered

It is not possible to receive or send text messages longer than 65522 characters.