Skip to content

Instantly share code, notes, and snippets.

View anataliocs's full-sized avatar

Chris Anatalio anataliocs

View GitHub Profile
@anataliocs
anataliocs / ignore_ds_files_git.sh
Created May 28, 2026 21:25
Global git ignore for MacOS .DS_Store files
touch ~/.gitignore_global
printf ".DS_Store\n.DS_Store?\n._*\n" >> ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
git config --global core.excludesfile
@anataliocs
anataliocs / gist:68c17a8c53e60e067e65e9a6e76926e8
Created May 28, 2026 14:41
Script to run govulncheck and cross-reference github security advisories and display in table
#!/bin/bash
set -o pipefail
TEMP_JSON=$(mktemp)
govulncheck -format json ./... > "$TEMP_JSON"
PARSED_DATA=$(jq -r '.osv.aliases[] | select(startswith("GHSA-"))' "$TEMP_JSON" 2>/dev/null | sort -u)
@anataliocs
anataliocs / gist:9edfc4a8f5ef892ddd568a08e6df6e60
Last active May 6, 2026 16:22
shell script debug mode to see what line it fails on
# add to top of file
PS4='+ [${BASH_SOURCE}:${LINENO}] ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
set -x # Enable debug mode
@anataliocs
anataliocs / gist:85484ad8e78caf486a9bb6442865e36f
Created April 24, 2026 13:33
Make a script executable for a github action without needing to run chmod every run
git update-index --chmod=+x .github/scripts/coverage.sh
@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
@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');
@anataliocs
anataliocs / main.md
Created November 10, 2025 19:16 — forked from hediet/main.md
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"];
@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