Skip to content

Instantly share code, notes, and snippets.

View vitorsouzaalmeida's full-sized avatar

Vitor vitorsouzaalmeida

View GitHub Profile
@vitorsouzaalmeida
vitorsouzaalmeida / lc-interpreter.ml
Created October 1, 2025 01:28
Lambda Calculus Interpreter (beta-reduction + alpha-conversion)
type term = Var of string | Abs of string * term | App of term * term
let rec to_string t =
match t with
| Var x -> x
| Abs (x, body) -> "λ" ^ x ^ "." ^ to_string body
| App (t1, t2) -> "(" ^ to_string t1 ^ " " ^ to_string t2 ^ ")"
let fresh_var =
let counter = ref 0 in
@vitorsouzaalmeida
vitorsouzaalmeida / gh_notifications.md
Created September 29, 2025 12:23
How to delete Github spam notifications
gh api notifications | jq '.[] | {id, title: .subject.title, repo: .repository.full_name }'
gh api --method DELETE notifications/threads/ID
@vitorsouzaalmeida
vitorsouzaalmeida / delete-v0-chats.ts
Created September 23, 2025 21:47
Delete all your V0 chats
import { createClient } from 'v0-sdk';
const V0_API_KEY = '';
const v0 = createClient({ apiKey: V0_API_KEY });
const deleteAllV0Chats = async () => {
console.log('Fetching all your V0 chats...');
try {
const chatsResponse = await v0.chats.find();
@vitorsouzaalmeida
vitorsouzaalmeida / delete_yt_history.js
Created September 5, 2025 03:40
select and click all "delete" buttons from Youtube history page
const a = document.querySelectorAll(
".style-scope.ytd-video-renderer > .top-level-buttons.style-scope.ytd-menu-renderer > .style-scope.ytd-menu-renderer > yt-button-shape > .yt-spec-button-shape-next.yt-spec-button-shape-next--text.yt-spec-button-shape-next--mono.yt-spec-button-shape-next--size-m.yt-spec-button-shape-next--icon-only-default")
a.forEach((e) => e.click())
@vitorsouzaalmeida
vitorsouzaalmeida / main.ml
Created August 17, 2025 20:30
Modern compiler implementation in ML - Intro ex. 1
type id = string
type binop = Plus | Minus | Times
type stm = CompoundStm of stm * stm
| AssignStm of id * exp
| PrintStm of exp list
and exp = IdExp of id
| NumExp of int
| OpExp of exp * binop * exp
| EseqExp of stm * exp
@vitorsouzaalmeida
vitorsouzaalmeida / bordersrc
Created May 24, 2025 02:50
Tiling window manager (Yabai) + Window borders + skhdrc (shortcuts) + status bar
// ~/.config/borders/bordersrc
options=(
style=round
width=3.0
hidpi=on
active_color=0xffe2e2e3
inactive_color=0xff414550
)
@vitorsouzaalmeida
vitorsouzaalmeida / clean_code.md
Created March 7, 2024 12:53 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@vitorsouzaalmeida
vitorsouzaalmeida / a.v
Created August 13, 2023 01:42
Proof in Coq that natural numbers are infinity
Theorem plus_1_n : forall n : nat, n + 1 = S n /\ S n > n.
Proof.
intros n.
split.
- induction n as [| n' IHn'].
+ simpl. reflexivity.
+ simpl. rewrite <- IHn'. reflexivity.
- induction n as [| n' IHn'].
+ simpl. apply le_n.
+ simpl. apply le_n_S. apply IHn'.

Como Pensar

Ler e entender um pouco desse artigo. https://wiki.c2.com/?FeynmanAlgorithm

  • Reconhecer como você pensa
  • Descrever métodos que você usa para pensar
  • Entender métodos diferentes de pensar
  • Fazer perguntas sobre tudo(incluindo sobre perguntas)

Perguntas

@vitorsouzaalmeida
vitorsouzaalmeida / youtube_format_code_itag_list.md
Created December 30, 2022 18:43 — forked from sidneys/youtube_format_code_itag_list.md
YouTube video stream format codes itags

YouTube video stream format codes

Comprehensive list of YouTube format code itags

itag Code Container Content Resolution Bitrate Range VR / 3D
5 flv audio/video 240p - - -
6 flv audio/video 270p - - -
17 3gp audio/video 144p - - -
18 mp4 audio/video 360p - - -
22 mp4 audio/video 720p - - -