Skip to content

Instantly share code, notes, and snippets.

View saurvs's full-sized avatar

Saurav Sachidanand saurvs

View GitHub Profile
@ddevault
ddevault / Makefile
Last active February 20, 2024 14:17
Tiny Wayland compositor
WAYLAND_PROTOCOLS=/usr/share/wayland-protocols
# wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up
# to your build system yourself and provide them in the include path.
xdg-shell-protocol.h:
wayland-scanner server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
xdg-shell-protocol.c: xdg-shell-protocol.h
@mmsatari
mmsatari / cross-compiler.sh
Last active September 24, 2017 19:16 — forked from bijanebrahimi/cross-compiler.sh
build a linux cross compiler for FreeBSD targets
#!/bin/bash
# http://marcelog.github.io/articles/cross_freebsd_compiler_in_linux.html
# http://linux-tips.com/t/how-to-build-a-freebsd-toolchain-for-linux/288
export TARGET=amd64-marcel-freebsd9.2
export PREFIX=/usr/cross-build
export TARGET_PREFIX=$PREFIX/$TARGET
export PATH=$PATH:$PREFIX/bin
mkdir -p $TARGET_PREFIX{,/lib,/include}
mkdir build-{binutils,gmp,mpfr,mpc,gcc}
(function() {
var width = 500,
height = 500;
var projection = d3.geo.albersUsa()
.scale(1280)
.translate([width / 2, height / 2]);
var path = d3.geo.path()
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 25, 2024 06:23
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jboner
jboner / latency.txt
Last active April 26, 2024 21:27
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