Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#set -x
PROG=$0
# Install an updated rsync using homebrew with the instructions here:
# http://blog.jm3.net/2012/07/30/os-x-rsync
RSYNC="/usr/local/bin/rsync"
SRC="/"
class MetricsController < ApplicationController
before_filter :find_metric
respond_to :html, :json
def edit
if admin_signed_in?
@user = metric.user
end
@josephruscio
josephruscio / stats.rb
Created September 15, 2009 21:41 — forked from mojombo/stats.rb
Refactor with aggregate gem
# Using the aggregate gem (http://www.gemcutter.org/gems/aggregate),
# run the given block +num+ times and then print out the mean, min,
# max, std_dev, and histogram of the run duration. For example:
#
# irb> stats(100, 0, 10, 1) { sleep(rand / 100) }
# mean: 5.99ms
# min: 1.49ms
# max: 9.28ms
# stddev: 2.54ms
# value |------------------------------------------------------------------| count