Skip to content

Instantly share code, notes, and snippets.

View titoBouzout's full-sized avatar

Tito titoBouzout

  • Montevideo, Uruguay
View GitHub Profile
@chris-kruining
chris-kruining / binary.ts
Created February 8, 2024 09:08
Zod binary serialization/encoding POC
import { z, ZodDate, ZodNumber, ZodBoolean, ZodString, ZodObject, ZodDiscriminatedUnion, ZodEnum, ZodArray, ZodTypeAny, ZodLiteral } from "zod";
const textEncoder = new TextEncoder();
const textDecoder = new TextDecoder();
export async function serialize<T extends ZodTypeAny>(schema: T, data: z.infer<T>): Promise<ArrayBuffer> {
let accumulation = new Uint8Array();
for await (const k of _serialize(schema, data, '')) {
accumulation = concatTypedArrays(accumulation, k);
@bigmistqke
bigmistqke / createSharedArrayBuffer.ts
Last active November 29, 2024 13:34
createSharedArrayBuffer
import { createSignal } from "solid-js";
const signal = (buffer: Int32Array, index: number) => {
const s = createSignal(undefined, { equals: false });
const read = (debug?: string) => {
s[0]();
return buffer[index];
};
const write = (value: any) => {
@rain-1
rain-1 / LLM.md
Last active May 16, 2025 06:56
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@Steven24K
Steven24K / ForceDirectedGraph.ts
Created March 26, 2020 14:38
A Force directed graph layouting algorithm based on Fruchterman and Reingold's principle, written in Typescript.
/**
* Force directed graph layout algorithm according to Fruchterman and Reingold's principle.
* The algorithm can be summarized as follows:
* algorithm SPRING(G:graph);
* place vertices of G in random locations;
* repeat N times
* calculate the force on each vertex;
* move the vertex c4
* draw graph on canvas, plotter or any drawing tool.
*
@munificent
munificent / generate.c
Last active January 27, 2025 18:14
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@krrr
krrr / brightness.ahk
Last active December 7, 2024 06:29
Windows screen brightness fine tune (autohotkey)
#,::
AdjustScreenBrightness(-3)
Return
#.::
AdjustScreenBrightness(3)
Return
AdjustScreenBrightness(step) {
service := "winmgmts:{impersonationLevel=impersonate}!\\.\root\WMI"