Skip to content

Instantly share code, notes, and snippets.

View anataliocs's full-sized avatar

Chris Anatalio anataliocs

View GitHub Profile
@anataliocs
anataliocs / microgpt.py
Created February 12, 2026 05:52 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and inference a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@karpathy
karpathy / microgpt.py
Last active February 28, 2026 13:26
microgpt
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@anataliocs
anataliocs / shut-down-process.sh
Last active December 4, 2025 06:11
Search for and kill processes running on a certain port with a specific command name
#!/bin/bash
set -e
port="9944"
printf "\nSearches for processes running on port %s and performs a kill 9 on each pid" "$port"
printf "\n------------------------- \n"
printf "\nPrinting output from command: lsof -i :%s \n" "$port"
lsof -i :$port
@anataliocs
anataliocs / start-docusaurus.sh
Last active December 3, 2025 14:32
Start docusaurus and export logs to file
#!/bin/bash
set -e
touch docs.log
chmod 775 docs.log
nohup yarn start --port 3000 > docs.log 2>&1 & echo $! > run.pid
echo "Docusaurus running on process: $(cat run.pid)"
echo "Docusaurus running on port 3000"
echo ""
@anataliocs
anataliocs / quote-json-keys.js
Created November 24, 2025 17:52
When you console.log() a JSON config, the object keys may not be quoted. This script will take in a file and wrap all the object keys in double quotes
// Utility script: Wrap all unquoted parameter names (object keys) with double quotes
// Usage: quote-json-keys.js
const fs = require('fs');
const path = require('path');
const filePath = path.join(__dirname, 'config.json');
let text = fs.readFileSync(filePath, 'utf8');
@franciscoaguirre
franciscoaguirre / generate-xcm.ts
Last active September 9, 2025 00:19
Interacting with the XCM precompile with Hardhat
import {
passetHub,
XcmV3MultiassetFungibility,
XcmV3WeightLimit,
XcmV5AssetFilter,
XcmV5Instruction,
XcmV5Junction,
XcmV5Junctions,
XcmV5WildAsset,
XcmVersionedXcm,
@anataliocs
anataliocs / git.md
Last active May 14, 2025 06:28
Stellar Toronto Builder Summit—EasyA Consensus Hackathon 2025 Helpful Scripts

Reset Repo and Re-choose front-end framework

Reset vanillajs and

git add . && git stash && rm -rf node_modules && rm -rf snapchain-vanillajs/target

Reset astro

@ChristopherA
ChristopherA / Mermaid_on_Github_Examples.md
Last active February 18, 2026 23:02
Mermaid on Github Examples

Mermaid on Github Examples

All of these diagrams are dynamically rendered during html display by Github, the images generated from text inside the Github-Flavored Markdown. None are static images. Mermaid support was released for Github on 2022-02-14

Pros & Cons:

  • Pro: You don't need to care about the layout.
  • Con: You cannot control the layout.

Notes:

  • Not all the features of Mermaid (in particular symbols B-->C[fa:fa-ban forbidden], hyperlink and tooltips) are supported by Github.
@eneko
eneko / list-of-curl-options.txt
Last active February 12, 2026 09:25
List of `curl` options
$ curl --help
Usage: curl [options...] <url>
--abstract-unix-socket <path> Connect via abstract Unix domain socket
--alt-svc <file name> Enable alt-svc with this cache file
--anyauth Pick any authentication method
-a, --append Append to target file when uploading
--basic Use HTTP Basic Authentication
--cacert <file> CA certificate to verify peer against
--capath <dir> CA directory to verify peer against
-E, --cert <certificate[:password]> Client certificate file and password
@hediet
hediet / main.md
Last active February 15, 2026 06:19
Proof that TypeScript's Type System is Turing Complete
type StringBool = "true"|"false";


interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };

type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];