Skip to content

Instantly share code, notes, and snippets.

View W3SS's full-sized avatar
🎯
Focusing

Wendel Santana W3SS

🎯
Focusing
View GitHub Profile
@W3SS
W3SS / README.md
Created February 22, 2026 16:21 — forked from hofmannsven/README.md
Command Line Cheatsheet
@W3SS
W3SS / terminal-cheat-sheet.txt
Created February 22, 2026 16:20 — forked from cferdinandi/terminal-cheat-sheet.txt
Terminal Cheat Sheet
# Terminal Cheat Sheet
pwd # print working directory
ls # list files in directory
cd # change directory
~ # home directory
.. # up one directory
- # previous working directory
help # get help
-h # get help
@W3SS
W3SS / gist:a35e4bf45e5b2a8b6a8ceed9b9357955
Created February 22, 2026 15:27 — forked from karpathy/gist:7bae8033dcf5ca2630ba
Efficient LSTM cell in Torch
--[[
Efficient LSTM in Torch using nngraph library. This code was optimized
by Justin Johnson (@jcjohnson) based on the trick of batching up the
LSTM GEMMs, as also seen in my efficient Python LSTM gist.
--]]
function LSTM.fast_lstm(input_size, rnn_size)
local x = nn.Identity()()
local prev_c = nn.Identity()()
local prev_h = nn.Identity()()
@W3SS
W3SS / gist:3981d64aabb44e8d4321aef6eeb7e2e6
Created February 22, 2026 15:27 — forked from karpathy/gist:f3ee599538ff78e1bbe9
Batched L2 Normalization Layer for Torch nn package
--[[
This layer expects an [n x d] Tensor and normalizes each
row to have unit L2 norm.
]]--
local L2Normalize, parent = torch.class('nn.L2Normalize', 'nn.Module')
function L2Normalize:__init()
parent.__init(self)
end
function L2Normalize:updateOutput(input)
@W3SS
W3SS / min-char-rnn.py
Created February 22, 2026 15:27 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@W3SS
W3SS / README.md
Created February 22, 2026 15:22 — forked from hofmannsven/README.md
Git CLI Cheatsheet
@W3SS
W3SS / yarn_cheatsheet.md
Created February 22, 2026 14:11 — forked from princeppy/yarn_cheatsheet.md
yarn cheatsheet
@W3SS
W3SS / pytorch_strangeness.py
Created February 19, 2026 02:45 — forked from karpathy/pytorch_strangeness.py
pytorch strangeness
import torch
import torch.nn as nn
torch.manual_seed(42)
x = torch.randn(2, 768)
# matrix multiply "ignores" the second row when calculating the first row
w = torch.randn(768, 768)
z1 = x[0] @ w
z2 = (x @ w)[0]
@W3SS
W3SS / stablediffusionwalk.py
Created February 16, 2026 03:00 — forked from karpathy/stablediffusionwalk.py
hacky stablediffusion code for generating videos
"""
stable diffusion dreaming
creates hypnotic moving videos by smoothly walking randomly through the sample space
example way to run this script:
$ python stablediffusionwalk.py --prompt "blueberry spaghetti" --name blueberry
to stitch together the images, e.g.:
$ ffmpeg -r 10 -f image2 -s 512x512 -i blueberry/frame%06d.jpg -vcodec libx264 -crf 10 -pix_fmt yuv420p blueberry.mp4
@W3SS
W3SS / add_to_zshrc.sh
Created February 12, 2026 22:13 — forked from karpathy/add_to_zshrc.sh
Git Commit Message AI
# -----------------------------------------------------------------------------
# AI-powered Git Commit Function
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It:
# 1) gets the current staged changed diff
# 2) sends them to an LLM to write the git commit message
# 3) allows you to easily accept, edit, regenerate, cancel
# But - just read and edit the code however you like
# the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/
gcm() {