Skip to content

Instantly share code, notes, and snippets.

View raphaelrk's full-sized avatar

Raphael raphaelrk

View GitHub Profile
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<time.h>
#define B 8
#define E 32
#define H 64
#define V 27
"""
The most atomic way to train and run inference for 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
@deezeddd
deezeddd / gist:106b688e28faea4b428816ba4ca61338
Created October 9, 2025 20:37
claude-switch-multi [Used to switch between multiple accounts]
#!/bin/bash
# Claude Code Multi-Account Switcher
# Usage: ./claude-switch-multi.sh [account1|account2|account3|save-current|list|status]
CLAUDE_DIR="$HOME/.claude"
@vogler
vogler / clean-url-readme-tab.github.com.tamper.js
Last active September 13, 2025 11:18
GitHub: remove `?tab=readme-ov-file` from URL
// ==UserScript==
// @name GitHub: remove `?tab=readme-ov-file` from URL
// @description GitHub: remove `?tab=readme-ov-file` from URL
// @namespace https://gist.github.com/vogler
// @downloadURL https://gist.github.com/vogler/74edff6de37c3a13eeff8c99c6bed910/raw/clean-url-readme-tab.github.com.tamper.js
// @version 0.1
// @author Ralf Vogler
// @match https://github.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant none
@kconner
kconner / macOS Internals.md
Last active March 4, 2026 17:23
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@wcandillon
wcandillon / line-sdf.tsx
Last active February 18, 2025 20:00
React Native Line SDF
import React from "react";
import {
Canvas,
Skia,
Shader,
Fill,
vec,
useTouchHandler,
useValue,
useComputedValue,
@WebReflection
WebReflection / esx.md
Last active October 6, 2024 12:35
Proposal: an ESX for JS implementation
@EllyLoel
EllyLoel / reset.css
Last active September 30, 2025 18:40
CSS Reset
/*
Made by Elly Loel - https://ellyloel.com/
With inspiration from:
- Josh W Comeau - https://courses.joshwcomeau.com/css-for-js/treasure-trove/010-global-styles/
- Andy Bell - https://piccalil.li/blog/a-modern-css-reset/
- Adam Argyle - https://unpkg.com/open-props@1.3.16/normalize.min.css / https://codepen.io/argyleink/pen/KKvRORE
Notes:
- `:where()` is used to lower specificity for easy overriding.
*/
@siboehm
siboehm / site_search_urls.md
Last active August 17, 2025 19:30
Collection of site search urls

Site-specific search URLs

These work in Firefox and Chrome, where %s is replaced with the search query. For Raycast and Alfred, the %s should be replaced with {query}. For more details also see my blogpost.

How to add

  • Chrome: Settings -> Search engine -> Manage search engines and site search -> Add
  • Firefox: Bookmarks -> Manage Bookmarks -> Add Bookmark, then set the keyword to the desired shortcut

I recommend picking keywords that are easy to memorize, like am=Amazon, an=Anaconda, gi=Github,... and switching to three letters when the two letter abbreviation appears to commonly in a sentence (eg goi=Google images, gom=Google Maps).

@rsalzer
rsalzer / RandomWikimediaPicture.js
Created November 2, 2020 21:49
Scriptable-Script to show a random featured picture on Wikimedia Commons as a Widget
//Showing random wikimedia-commons-featured-picture
const url = `https://randomincategory.toolforge.org/Featured_pictures_on_Wikimedia_Commons?server=commons.wikimedia.org&type=file&debug=1`
const req = new Request(url)
const res = await req.loadString()
let titleRegExp = new RegExp("Location: https://commons.wikimedia.org/wiki/(.*)")
let titleMatch = res.match(titleRegExp)
let title = titleMatch[1].replace("<br>", "");
let titleEncoded = encodeURI(title)
let url2 = `https://commons.wikimedia.org/w/api.php?action=query&titles=${titleEncoded}&prop=pageimages&format=json&pithumbsize=500`
const req2 = new Request(url2)