Skip to content

Instantly share code, notes, and snippets.

View cooperpellaton's full-sized avatar
👨‍🎨
Making memes!

Cooper Pellaton cooperpellaton

👨‍🎨
Making memes!
View GitHub Profile
@jboner
jboner / latency.txt
Last active July 13, 2025 02:09
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
@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active May 6, 2025 10:00
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@niw
niw / SafariHack.m
Last active August 29, 2015 14:09
Show favicon on Safari tabs.
/*
SafariHack
==========
Use with SIMBL or compatible extension like EasySIMBL. Only tested on OS X 10.10.
LICENSE
-------
Copyright (c) 2014 Yoshimasa Niwa
@vasanthk
vasanthk / System Design.md
Last active July 12, 2025 23:12
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip
# Unzip
unzip protoc-3.2.0-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active May 7, 2025 16:40
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
@sidsenkumar11
sidsenkumar11 / README.md
Last active March 30, 2025 14:46
GDB Tutorial

GDB for the Uninitiated

Overview

You're working on a C project for CS 2200. There's 2 days left before the assignment is due and for some reason, you're getting a segmentation fault after writing your last function. You've looked over your code 23 times but you just can't figure out where the bug is! Giving up and calling it a day, you decide to go to office hours and ask a TA for help.

If it sounds like this might be you in the near future, then allow me to run through a typical scenario for what happens when you come in and ask for help. You'll sit down, wait for 30 minutes while the TAs get through the queue of students asking questions, and finally notice that it's your turn next. The TA will walk over and ask you what's up. You'll explain that your code is seg-faulting and for the life of you, you can't figure out why. So the TA will take a quick peak at your code for any obvious errors, and then ask you the following question:

Did you run it through GDB?

#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@cooperpellaton
cooperpellaton / choco-bootstrap.ps1
Last active March 7, 2021 23:54
🍫 A PowerShell script that self-elevates and installs programs from Chocolatey.
# List of packages to be installed.
$Packages = 'firefox', 'vlc', '7zip', 'vscode', `
'everything', 'sharex', 'scansnapmanager', 'steam', 'discord', `
'Revo.Uninstaller', 'battle.net'
# Packages that won't be installed and the user will be reminded of.
$Extras = "Windows Store apps, Oculus, AMD/Radeon Drivers"
# Get the ID and security principal of the current user account
$myWindowsID = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$myWindowsPrincipal = new-object System.Security.Principal.WindowsPrincipal($myWindowsID)
@gagarine
gagarine / fish_install.md
Last active July 2, 2025 09:47
Install fish shell on macOS Mojave with brew

Installing Fish shell on MacOS (Intel and M1) using brew

Fish is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your default shell.

Note that you need the https://brew.sh/ package manager installed on your machine.

Install Fish

brew install fish