Skip to content

Instantly share code, notes, and snippets.

View ArhanChaudhary's full-sized avatar
❄️

Arhan Chaudhary ArhanChaudhary

❄️
View GitHub Profile
@jboner
jboner / latency.txt
Last active August 20, 2025 21:38
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@angela-d
angela-d / gpg-key-migration.md
Created April 1, 2018 23:57
Move GPG Keys from One Machine to Another

Migrate GPG Keys from One Workstation to Another

Replace [your key] with your key ID

To obtain your key ID

gpg --list-secret-keys --keyid-format LONG

Which returns something like

@MPThLee
MPThLee / enableDiscordExperiments.js
Last active July 27, 2025 01:25
This code doesn't work anymore. I just decided to remove this code. You can check working code on comments.
/**
* !!!! This code doesn't work anymore !!!!
*
* - You can check working code on comments. I won't update this code anymore.
*
* Also, I just decided to remove this code. You can check revisions for old code.
* Since this code was made for discord client that almost 5 years ago, It seems like doesn't work anymore.
* I don't want people keep arguing in the comments, i decided to remove this code.
*
* Note: This code is now fulfilled with Javascript comments. This code won't work even if you pasted to console. doesn't do anything.
@plembo
plembo / ghpwithnamecheap.md
Last active August 15, 2025 18:32
GitHub Pages with Namecheap custom domain

Using GitHub Pages with a custom domain: Namecheap Edition

As often happens, I found the official documentation and forum answers to be "close, but no cigar", and so had to experiment a little to get things working.

The main problem for me was a lack of concrete configuration examples. That's not entirely GitHub's fault: having migrated from Google Domains to Namecheap in the middle of this project, I was once again reminded of how many different ways there are to do things in the name service universe [1].

Although you'd think the simplest setup would be to merely configure for the subdomain case (https://www.example.com), in my experience using the apex domain (https://example.com) instead resulted in fewer complications.

Procedure

So here's my recipe for using a custom domain with GitHub pages where Namecheap is the DNS provider:

<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<title>Rebane's Discord Colored Text Generator</title>
<meta charset="UTF-8">
<meta name="description" content="Rebane's Discord Colored Text Generator">
<meta name="author" content="rebane2001">
<style>
/*
// ==UserScript==
// @name @chaoticvibing Twitter Blue Nerd - twitter.com
// @namespace Violentmonkey Scripts
// @match *://*.twitter.com/*
// @match *://*.x.com/*
// @grant none
// @version 1.9.2
// @author @chaoticvibing - GH @busybox11
// @description 11/9/2022, 11:45:28 PM
// @updateURL https://gist.githubusercontent.com/busybox11/53c76f57a577a47a19fab649a76f18e3/raw
#!/bin/bash
while curl -sS "https://bruins.admission.ucla.edu/myApplication/Status.aspx" | tac | grep -q 'currently unavailable'
do
sleep 10
done
while true;
do
echo 'AVAILABLE!!'
echo $'\a'
sleep 3
@ScriptRaccoon
ScriptRaccoon / rubik.py
Last active September 29, 2024 20:18
Verifies that 1260 is the highest possible order of an element in the 3x3 Rubik's cube group
"""
This module verifies that 1260 is the highest possible order of an element in the 3x3 Rubik's cube group.
This is only an upper bound but it turns out that it can also be achieved, so this estimate is precise.
The approach is loosely based on the answer by 'jmerry' at https://math.stackexchange.com/questions/2392906/
"""
from functools import lru_cache
import math
@rayhanadev
rayhanadev / twitter-mutelist.txt
Last active July 8, 2025 01:26
Matthew's Twitter Mutelist
(R)
abortion
abortions
abused
accountability
AGI
alarm
alarming
America
angry
@kartva
kartva / optimizing-purdue-cs.md
Last active August 20, 2025 05:03
Optimizing Purdue CS

Important

From Appendix E: If this document was helpful, comment that. Your comments are valuable signals to future readers. (It's also validating.)

Note

This document uses special characters like the em-dash (—). These characters were lovingly hand-inserted and not a result of AI-generated text.

Tip

A reader wrote a half-rebuttal/half-complementary document that's double(!) the length of this one. I recommend checking it out after reading this document.