Skip to content

Instantly share code, notes, and snippets.

View rschildmeijer's full-sized avatar

Roger Schildmeijer rschildmeijer

View GitHub Profile
@dln
dln / inotify-cmake.sh
Created July 17, 2012 10:36
Continuous build on the cheap, using inotify, cmake and a terminal
#!/bin/bash
# Watch paths (given as arguments), automatically build when something changes.
# The script does a couple opinionated things to make my life easier:
#
# * Terminal scrollbuffer is reset before each iteration, simplifying scrolling.
# * I use a filter script to colorize gcc output (clang errors would be nicer).
# * Output is copied to a log file (/tmp/build.log).
# - I open this file in Sublime or vim, which reloads the file on change (each build).
#
# Usage:
@jboner
jboner / latency.txt
Last active July 8, 2024 21:47
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
@kamermans
kamermans / analyze_haproxy_performance.pl
Created April 6, 2012 15:41
HAProxy log analyzer to show response latency distribution from the console
#!/usr/bin/perl
# HAProxy Performance Statistics
# by Steve Kamerman
#
# To use, pipe your HAProxy log with timing information (like "0/0/1/1/3 200") to
# this script. It will output min, max, med, avg and a latency distribution graph.
#
# Info on timing logging in HAProxy: http://code.google.com/p/haproxy-docs/wiki/TimingEvents
#
@dln
dln / gist:2148652
Created March 21, 2012 15:39
From #spotify @ Freenode
(04:20:13 PM) hlveheart: Oh awesome, there's an IRC channel
(04:20:23 PM) chiel: \o/
(04:20:58 PM) hlveheart: \o/. I'm having an affair guys.
(04:21:01 PM) ***hlveheart looks around
(04:21:05 PM) hlveheart: HER NAME IS SPOTIFY :)
(04:22:22 PM) lfranchi: hlveheart: bad news, you have to share
(04:24:03 PM) hlveheart: :{
@databyte
databyte / upgrade_postgres_9.0-9.1.sh
Created November 29, 2011 03:29
Upgrade PostgreSQL from 9.0 to 9.1
#!/bin/sh
#
# Upgrade PostgreSQL from 9.0 to 9.1
#
# by David Sommers
#
brew update postgres
@jacobk
jacobk / process_tornado_bm.py
Created December 9, 2010 20:04
Simple script to process raw data from Tornado BM
#!/usr/bin/env python
# encoding: utf-8
#
# Requires statlib http://code.google.com/p/python-statlib/
"""
process_tornado_bm.py
Created by Jacob Kristhammar on 2010-12-09.
"""