Skip to content

Instantly share code, notes, and snippets.

@BaksiLi
BaksiLi / install_zellij.sh
Created August 9, 2023 10:48
Install Zellij (latest release) on Linux (incl. Ubuntu) and Darwin
#!/bin/bash
# Get the architecture of the machine
arch=$(uname -m)
os=$(uname -s)
# Download the Zellij binary
if [ "$os" == "Darwin" ]; then
filename="zellij-${arch}-apple-darwin.tar.gz"
url="https://github.com/zellij-org/zellij/releases/latest/download/$filename"
@miguelmota
miguelmota / install.sh
Last active January 15, 2025 08:57
Arch linux install Ly display manager
chmod +x ~/.xinitrc
sudo pacman -S ly
sudo systemctl enable ly.service
sudo systemctl start ly.service
# config
sudo vim /etc/ly/config.ini
sudo systemctl restart ly.service
@savarin
savarin / bplustree.py
Last active February 23, 2025 19:07
Python implementation of a B+ tree
"""Simple implementation of a B+ tree, a self-balancing tree data structure that (1) maintains sort
data order and (2) allows insertions and access in logarithmic time.
"""
class Node(object):
"""Base node object.
Each node stores keys and values. Keys are not unique to each value, and as such values are
stored as a list under each key.
@jboner
jboner / latency.txt
Last active May 6, 2025 05:49
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