Skip to content

Instantly share code, notes, and snippets.

@jboner
jboner / latency.txt
Last active May 4, 2024 21:16
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
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 4, 2024 21:15
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@ncalm
ncalm / excel-lambda-list.allpairs.txt
Created April 26, 2024 12:41
This Excel LAMBDA function implements the functionality of F#'s List.allPairs function for creating a cross-join between two lists (vectors)
LIST.ALLPAIRS = LAMBDA(list1, list2,
LET(
list1Col, TOCOL(list1),
list2Col, TOCOL(list2),
list1length, ROWS(list1Col),
list2length, ROWS(list2Col),
resultRows, SEQUENCE(list1length * list2length, 1),
rowIndex1, CEILING(resultRows / list2length, 1),
rowIndex2, MOD(resultRows - 1, list2length) + 1,
HSTACK(INDEX(list1Col, rowIndex1), INDEX(list2Col, rowIndex2))
@lazydogP
lazydogP / eCDP_keygen.py
Last active May 4, 2024 21:13
Keygen for eCDP
#!/usr/bin/env python3
# Keygen for McDonald's eCDP(eCrew Development Program),
# a Nintendo DS software to train employees.
# This keygen is for the only dumped Japanese version of eCDP.
# ROM: https://archive.org/details/mcdonalds-japan-ecdp-rom-training-nintendo-ds-cartridge-dump
# Usage: Select the third option in main menu, enter two 6-digit numbers as you like,
# and use this script to calculate the third code.
@zygm0nt
zygm0nt / how_to_run.md
Last active May 4, 2024 21:13
Schotter_Georg-Nees - rectangles

Run with BBC Basic. Eg. with brandy emulator.

brandy -lo schotter
@kalinchernev
kalinchernev / countries
Created October 6, 2014 09:42
Plain text list of countries
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua & Deps
Argentina
Armenia
Australia
Austria
@Oifan
Oifan / .Cube World Alpha - Extras.md
Last active May 4, 2024 21:11
Cube World Alpha - Extras
#include <stdint.h>
#include <immintrin.h>
// credit: YumiYumiYumi
// (fixed by aqrit)
__m128i _mm_tzcnt_epi32(__m128i v) {
__m128i mask = _mm_set1_epi32(0xffffff81);
v = _mm_and_si128(v, _mm_sign_epi32(v, mask));
v = _mm_castps_si128(_mm_cvtepi32_ps(v));
@schacon
schacon / gist:1
Created July 15, 2008 18:17
the meaning of gist
This is gist.
There are many like it, but this one is mine.
It is my life.
I must master it as I must master my life.
Without me gist is useless.
Without gist, I am useless.