Skip to content

Instantly share code, notes, and snippets.

View detro's full-sized avatar
🇺🇦
I may be slow to respond.

Ivan De Marino detro

🇺🇦
I may be slow to respond.
View GitHub Profile
@detro
detro / numbers_to_know.md
Last active September 7, 2025 17:47
Numbers to Know (cheatsheet) - Useful during System Design Interviews

Latency Numbers

Operation $ns$ (nano) $\mu s$ (micro) $ms$ (milli) notable 1Bx
L1 cache reference $0.5 ns$ $0.5 s$
Branch mispredict $5 ns$ $5 s$
L2 cache reference $7 ns$ 14x L1 cache $7 s$
Mutex lock/unlock $25 ns$ $25 s$
Main Memory reference $100 ns$ 20x L2 cache, 200x L1 cache $1.6\ mins$
Compress 1K bytes with Zippy
@gene1wood
gene1wood / all_aws_managed_policies.json
Last active April 30, 2025 20:07
A list of all AWS managed policies and they're policy documents as well as a short script to generate the list
This file has been truncated, but you can view the full file.
{
"APIGatewayServiceRolePolicy": {
"Arn": "arn:aws:iam::aws:policy/aws-service-role/APIGatewayServiceRolePolicy",
"AttachmentCount": 0,
"CreateDate": "2019-10-22T18:22:01+00:00",
"DefaultVersionId": "v6",
"Document": {
"Statement": [
{
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active September 28, 2025 13:24
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@detro
detro / sleepsort.js
Created June 16, 2011 10:05
sleepsort in (Phantom)JS
// sleepsort.js - Sort integers from the commandline in a very ridiculous way: leveraging timeouts :P
function sleepSort(array, callback) {
var sortedCount = 0,
i, len;
for ( i = 0, len = array.length; i < len; ++i ) {
setTimeout((function(j){
return function() {
console.log(array[j]);
++sortedCount;