Skip to content

Instantly share code, notes, and snippets.

View ArhanChaudhary's full-sized avatar
❄️

Arhan Chaudhary ArhanChaudhary

❄️
View GitHub Profile
@kdkasad
kdkasad / .clang-format
Last active April 7, 2025 21:13
Clang-Format style definition for CS 240
---
# Written by Kian Kasad <[email protected]>.
# See https://clang.llvm.org/docs/ClangFormatStyleOptions.html.
# Requires clang-format >=20.x.x.
Language: C
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveAssignments: None
@kartva
kartva / optimizing-purdue-cs.md
Last active May 2, 2025 05:41
Optimizing Purdue CS
@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
#!/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
// ==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
<!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>
/*
@plembo
plembo / ghpwithnamecheap.md
Last active April 8, 2025 03:29
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:

@MPThLee
MPThLee / enableDiscordExperiments.js
Last active May 5, 2025 21:01
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.
@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

@jboner
jboner / latency.txt
Last active May 6, 2025 05:49
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