Skip to content

Instantly share code, notes, and snippets.

@truemped
truemped / setup-statsd.sh
Created April 11, 2012 08:46 — forked from collegeman/setup-statsd.sh
Turn an Ubuntu 10.04 linode into a StatsD/Graphite server
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
# download the Node source, compile and install it
git clone https://github.com/joyent/node.git
cd node
./configure
make
sudo make install
# install the Node package manager for later use
@truemped
truemped / async_mock_example.py
Created November 17, 2012 09:57
Tornado Asynchronous Mock
from mock import CallableMixin, NonCallableMock
class AsyncCallableMixin(CallableMixin):
"""Change the __call__ method such that it does not return but call the
`callback` kwarg with the return value.
"""
def __call__(_mock_self, *args, **kwargs):
cb = kwargs.get('callback', None)
@truemped
truemped / list.md
Created March 1, 2013 19:07 — forked from pbailis/list.md

A friend asked me for a few pointers to interesting, mostly recent papers on data warehousing and "big data" database systems, and I figured I'd share the list. This is biased and rather incomplete but maybe of interest to someone. While many are obvious choices, I think there are a few underappreciated gems.

###Dataflow/Stream Processing Engines:

Dryad--general-purpose distributed parallel dataflow engine
http://research.microsoft.com/en-us/projects/dryad/eurosys07.pdf

Google Dremel--columnar storage for fast queries (c.f. Impala)
http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en/us/pubs/archive/36632.pdf

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

  1. General Background and Overview
@truemped
truemped / latency.txt
Last active August 29, 2015 14:16 — forked from jboner/latency.txt
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
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
  1. General Background and Overview
;; Based on https://clojuredocs.org/clojure.core/condp#example-542692cbc026201cdc326bea
(defn parse-arg [s]
(condp (comp next re-matches) s
#"([+-])(\w+)" :>> (fn [[f k]] [(keyword k) (= f "+")])
#"(\w+)=(\w+)" :>> (fn [[k v]] [(keyword k) v])
(throw (IllegalArgumentException. s))))
(parse-arg "+foo") ;=> [:foo true]
(parse-arg "-foo") ;=> [:foo false]
@truemped
truemped / springer-free-maths-books.md
Created December 29, 2015 09:55 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links