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

Latency numbers (cheat sheet)

Operation nanosec microsec millisec 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 m
Compress 1K bytes with Zippy 3,000 ns 3 µs `5
@gene1wood
gene1wood / all_aws_managed_policies.json
Last active April 4, 2024 18:11
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": [
{
"Action": [
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 7, 2024 06:03
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;