Skip to content

Instantly share code, notes, and snippets.

name code-refactor-review
description Reviews code changes for reuse, composition, codebase consistency, and slop. Use when asked to review PRs/diffs, check code reuse, composition, cleanliness, or whether code fits the codebase.

Code Refactor Review

Review code changes the way Sahaj usually asks for review: go deep on reuse, composition, codebase consistency, and anything that reads like slop.

First Pass

@hediet
hediet / main.md
Last active June 21, 2026 11:21
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"];
@mattppal
mattppal / security-checklist.md
Last active June 21, 2026 11:20
A simple security checklist for your vibe coded apps

Frontend Security

Security Measure Description
Use HTTPS everywhere Prevents basic eavesdropping and man-in-the-middle attacks
Input validation and sanitization Prevents XSS attacks by validating all user inputs
Don't store sensitive data in the browser No secrets in localStorage or client-side code
CSRF protection Implement anti-CSRF tokens for forms and state-changing requests
Never expose API keys in frontend API credentials should always remain server-side
@shawwwn
shawwwn / uping.py
Last active June 21, 2026 11:15
µPing: Ping library for MicroPython
# µPing (MicroPing) for MicroPython
# copyright (c) 2018 Shawwwn <shawwwn1@gmail.com>
# License: MIT
# Internet Checksum Algorithm
# Author: Olav Morken
# https://github.com/olavmrk/python-ping/blob/master/ping.py
# @data: bytes
def checksum(data):
if len(data) & 0x1: # Odd number of bytes

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

@MuYouGuanX
MuYouGuanX / javdb-top250.md
Created August 15, 2025 16:23 — forked from jinjier/javdb-top250.md
JavDB top 250 movies list. [Updated on 2025/08]
@eyecatchup
eyecatchup / calc-sapisidhash.js
Last active June 21, 2026 11:12
Calculate SAPISIDHASH
// Generates the SAPISIDHASH token Google uses in the Authorization header of some API requests
async function getSApiSidHash(SAPISID, origin) {
function sha1(str) {
return window.crypto.subtle.digest("SHA-1", new TextEncoder("utf-8").encode(str)).then(buf => {
return Array.prototype.map.call(new Uint8Array(buf), x=>(('00'+x.toString(16)).slice(-2))).join('');
});
}
const TIMESTAMP_MS = Date.now();
const digest = await sha1(`${TIMESTAMP_MS} ${SAPISID} ${origin}`);
@sunmeat
sunmeat / app.py
Last active June 21, 2026 11:12
dependency / association relationship example python
class Person:
def __init__(self, name, surname=""):
self.name = name
self.surname = surname
class Cat:
def __init__(self, nick, suit=""):
self.nick = nick
self.suit = suit # порода
@sunmeat
sunmeat / app.py
Created February 16, 2026 09:51
атрибути класу (статичні поля) в пайтон
class Monster:
# це і є "статичне поле" (атрибут класу)
count = 0
def __init__(self, health=100, attack=10, mana=50):
# ініціалізація екземплярних (звичайних) атрибутів
self.health = health
self.attack = attack
self.mana = mana