Skip to content

Instantly share code, notes, and snippets.

View fabiogaluppo's full-sized avatar

Fabio Galuppo fabiogaluppo

View GitHub Profile
@a1k0n
a1k0n / donut.c
Created October 23, 2023 04:03
donut shift and add only
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#define debug(...)
//#define debug printf
// torus radii and distance from camera
@vasanthk
vasanthk / System Design.md
Last active April 24, 2024 17:22
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?
@bishboria
bishboria / springer-free-maths-books.md
Last active March 22, 2024 11:19
Springer made a bunch of books available for free, these were the direct links
@tjanczuk
tjanczuk / xpub-xsub.js
Created August 24, 2015 23:59
How to connect 5 publishers with 5 subscribers over TCP using ZeroMQ's XPUB/XSUB proxy
// How to connect 5 publishers with 5 subscribers
// over TCP using ZeroMQ's XPUB/XSUB proxy.
// sub (connect)
// <-8701->
// (bind) xpub <---> xsub (bind)
// <-8700->
// (connect) pub
var zmq = require('zmq');
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

int k;
double sin() ,cos();
main(){
float A=0, B=0, i, j, z[1760];
char b[1760];
printf("\x1b[2J");
for(; ; ) {
memset(b,32,1760);
memset(z,0,7040);
for(j=0; 6.28>j; j+=0.07) {