Skip to content

Instantly share code, notes, and snippets.

@mplekh
mplekh / ytpbspeed.py
Last active March 24, 2026 16:24
Calculate a comfortable playback speed for YouTube videos
import re
import numpy as np
from youtube_transcript_api import YouTubeTranscriptApi
def fetch_transcript(video_id: str):
api = YouTubeTranscriptApi()
transcript_list = api.list(video_id)
# 1. Try manual English
try:
@mplekh
mplekh / tapegpt.py
Last active March 12, 2026 00:43
Karpathy's microgpt modified to use Wengert Tape architecture (Flat Array of Values instead of Graph of Objects)
import math
import random
random.seed(42)
# -----------------------------------------------------------------------------
# Tape-based Autograd Engine
# -----------------------------------------------------------------------------
class Tape: