Skip to content

Instantly share code, notes, and snippets.

View mathieuravaux's full-sized avatar

Mathieu Ravaux mathieuravaux

  • Paris
View GitHub Profile
@sfate
sfate / vim-on-heroku.sh
Created June 7, 2012 14:39 — forked from naaman/vim-on-heroku.sh
vim on heroku
#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin
@jboner
jboner / latency.txt
Last active May 31, 2024 08:23
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
@shayarnett
shayarnett / README
Created May 10, 2012 13:13
Snippet generator for RubyMotion ctags
Generate ctags with `rake ctags`
Run snipper.rb
Put resulting ruby.snippets file where your snippet plugin can pick it up. (I'm using snipmate)

Overview

Logplex is the Heroku logging multiplexor. Components throughout the Heroku platform publish syslog packets that are received and processed by a grid of logplex nodes. Users may retrieve their logs through requests to the logplex API.

Logplex relies on channel, token, drain and session objects. This data is stored in redis, but also cached for fast lookups in a normalized format in ETS tables. When logplex boots, all of the keys are loaded from redis and cached in ETS. When an object is created or deleted through the logplex API, other logplex nodes are notified of the change (via Erlang rpc calls) so that they may update their local ETS cache. We would like to explore the possibility of using nsync to manage replicating the dataset into ETS. This would speed up logplex boot times and save us from making Erlang RPC calls to update local caches on remote nodes.

To get started, fork logplex on github and follow the directions below to get logplex running locally.

Once you are up and runni

class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@funny-falcon
funny-falcon / cumulative_performance.patch
Created January 22, 2012 19:19
ruby-1.9.3-p0 cumulative performance patch.
diff --git a/common.mk b/common.mk
index ea244cc..4f22609 100644
--- a/common.mk
+++ b/common.mk
@@ -629,7 +629,8 @@ file.$(OBJEXT): {$(VPATH)}file.c $(RUBY_H_INCLUDES) {$(VPATH)}io.h \
gc.$(OBJEXT): {$(VPATH)}gc.c $(RUBY_H_INCLUDES) {$(VPATH)}re.h \
{$(VPATH)}regex.h $(ENCODING_H_INCLUDES) $(VM_CORE_H_INCLUDES) \
{$(VPATH)}gc.h {$(VPATH)}io.h {$(VPATH)}eval_intern.h {$(VPATH)}util.h \
- {$(VPATH)}debug.h {$(VPATH)}internal.h {$(VPATH)}constant.h
+ {$(VPATH)}debug.h {$(VPATH)}internal.h {$(VPATH)}constant.h \
# Store data in /usr/local/var/mongodb instead of the default /data/db
dbpath = /usr/local/var/mongodb
# Only accept local connections
bind_ip = 127.0.0.1
cpu = true
verbose = true
rest = true
@afternoon
afternoon / git-slim.py
Created December 5, 2011 14:42
Remove large objects from a git repository
#!/usr/bin/python
#
# git-slim
#
# Remove big files from git repo history.
#
# Requires GitPython (https://github.com/gitpython-developers/GitPython)
#
# References:
# - http://help.github.com/remove-sensitive-data/
@elbrujohalcon
elbrujohalcon / gen_event_repeater.erl
Created September 20, 2011 20:11
gen_event_repeater
%%%-------------------------------------------------------------------
%%% @author Fernando Benavides <fernando.benavides@inakanetworks.com>
%%% @copyright (C) 2011 Inaka Networks S.R.L.
%%% @doc It listens and just repeats...
%%% @end
%%%-------------------------------------------------------------------
-module(gen_event_repeater).
-author('Fernando Benavides <fernando.benavides@inakanetworks.com>').
-behaviour(gen_event).