Skip to content

Instantly share code, notes, and snippets.

@gburca
gburca / latency.txt
Last active January 31, 2017 16:32 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
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
Context switch 25,000 ns 25 us
#!/bin/bash
BIN=/usr/bin
MAN=/usr/share/man/man1
PRIORITY=360
BINV=3.6
MANV=3.6.1
update-alternatives --install $BIN/clang clang $BIN/clang-$BINV $PRIORITY \
@gburca
gburca / Tellico2Calibre.py
Last active April 23, 2016 19:02
Import Tellico data into Calibre
#!/usr/bin/env python
"""
The following script will import Tellico book data into Calibre.
For more details, see:
http://ebixio.com/blog/2016/04/23/import-tellico-books-into-calibre/
"""
import os, sys
@gburca
gburca / vim-tail.sh
Last active February 14, 2017 04:12
#!/bin/bash
# Usage: vim-tail.sh <filename>
#
# This script turns vim into a `tail -f` equivalent, but with syntax
# highlighting and all the other goodies.
#
# A version of vim compiled with +clientserver is required.
# Run `vim --version` to see what options were compiled in.
# On Ubuntu 14.04, vim.tiny, vim.basic and vim.nox won't work.
@gburca
gburca / flac2mp3dir.sh
Created August 10, 2010 16:48
flac2mp3dir.sh
#!/bin/bash
# Author: Gabriel Burca (gburca dash flac2mp3dir at ebixio dot com)
# Version: 1.0
#
# Copyright (C) 2006-2009 Gabriel Burca (gburca dash flac2mp3dir at ebixio dot com)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2