Skip to content

Instantly share code, notes, and snippets.

View mrb's full-sized avatar
🍕
Helping companies market and sell more software

Michael Bernstein mrb

🍕
Helping companies market and sell more software
View GitHub Profile
#
# Ideas stolen from lograge and brought to Rails 2.3
# https://github.com/mattmatt/lograge/blob/master/lib/lograge/log_subscriber.rb
#
module ImprovedControllerLogging
def self.included(base)
base.alias_method_chain :log_processing, :fixup
base.inject_alias_method_chain :perform_action,
:perform_action_with_benchmark,
@arirusso
arirusso / vidsampler.rb
Created April 23, 2012 19:52 — forked from marcel/gist:2100703
vidsampler – extract audio samples from online video
#!/usr/bin/env ruby
#
# vidsampler – extract audio samples from online video
#
# for OSX only
#
# Usage:
#
# ruby vidsampler.rb [youtube url] [minute:second] [duration]
#
@gdiggs
gdiggs / proof.md
Created April 17, 2012 13:55
Proof of @mrb's music tastes

It is given that @mrb prefers the inverse of c && s && n && !y. To calculate his musical preference regarding combinations of the set g = {c, s, n, y}, we apply DeMorgan's law to c && s && n && !y, producing: !c || !s || !n || y. This implies that @mrb will be happy given the presence of y in any combination, but if y is not present, neither can c, s, or n.

@ryandotsmith
ryandotsmith / process-partitioning.md
Created April 13, 2012 06:40
Process Partitioning

Process Partitioning

The Problem

When working with large, high volume, low latency systems, it is often the case that processing data sequentially becomes detrimental to the system's health. If we only allow 1 process to work on our data we run into several challenges:

  • Our process may fall behind resulting in a situation which it is impossible for our process to catch up.
  • Our singleton process could crash and leave our system in a degraded state.
  • The average latency of data processing could be dramatically affected by outlying cases.
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@seancribbs
seancribbs / Gemfile
Created March 14, 2012 20:25
Static/file resources in Webmachine
source :rubygems
gem 'webmachine'
gem 'rack'
@bwhitman
bwhitman / gist:2038886
Created March 14, 2012 19:34
The Stockturm. Long-Distance Song Effects from "The Tin Drum" by Günter Grass

The Stockturm. Long-Distance Song Effects

Dr. Hornstetter, the lady doctor who drops in on me almost every day just long enough to smoke a cigarette, who is supposed to be taking care of me but who, thanks to my treatment, leaves the room after every visit a little less nervous than she was when she came, a retiring sort who is intimate only with her cigarettes, keeps insisting that I suffered from isolation in my childhood, that I didn’t play enough with other children. Well, as far as other children are concerned, she may be right. It is true that I was so busy with Gretchen Scheffler’s lessons, so torn between Goethe and Rasputin, that even with the best of intentions I could have found no time for ring-around-a-rosy or post office. But whenever, as scholars sometimes do, I turned my back on books, declaring them to be the graveyards of the language, and sought contact with the simple folk, I encountered the little cannibals who lived in our building, and after brief association with them, felt very glad

Format layout

An rdb file begins with "REDIS0003" encoded as a bytestring. [9 bytes]


For each database in the dump

  • The first byte is the SELECT_DB opcode (0xfe) [1 byte]
  • The second byte is the length-encode database number (See below) [1-4 byte(s)]
@mrb
mrb / lahey_pizza.txt
Created February 25, 2012 17:41
Lahey Pizza
The pizza recipe is based on the book "My Bread" by Jim Lahey, which I
HIGHLY recommend. It has bunch of recipes based around the idea of
"no knead" bread - basically long fermentation times take place of
lengthy, annoying kneading. You can make great loaves with a similar
technique to the pizza recipe below. This is a kind of "Roman" style
pizza where you stretch the dough very thin on two 13" x 18" sheet
pans, cut the ingredients very thinly, layer it, and bake it hot for
about 25 minutes. To make two pies:
3 3/4 cups or 500 grams Bread Flour
From 4237aa29a9771208a2206ff2f7ec4745caee0cbf Mon Sep 17 00:00:00 2001
From: Aaron Patterson <[email protected]>
Date: Mon, 13 Feb 2012 10:40:06 -0800
Subject: [PATCH 1/2] mkmf should abort if the user is missing libhashring
---
ext/hash_ring/extconf.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ext/hash_ring/extconf.rb b/ext/hash_ring/extconf.rb