Skip to content

Instantly share code, notes, and snippets.

View rspeicher's full-sized avatar

Robert Speicher rspeicher

View GitHub Profile
@rspeicher
rspeicher / application_helper.rb
Created August 12, 2012 07:02
icon helper method for FontAwesome
module ApplicationHelper
# Returns an element for use as a FontAwesome icon
#
# Examples:
# icon('trash')
# icon('refresh large')
def icon(name)
name = name.gsub(/\Aicon-/, '').split(' ').map { |v| "icon-#{v}" }
content_tag(:i, nil, class: name.join(' '))
@rspeicher
rspeicher / Guardfile.rb
Created November 30, 2011 00:33
Guardfile for auto-reloading Python koans
require 'guard/guard'
module ::Guard
class Inline < ::Guard::Guard
def run_all
system "sh run.sh"
end
def run_on_change(paths)
system "sh run.sh"
for year in 2010 2011 2012
do
for month in 01 02 03 04 05 06 07 08 09 10 11 12
do
sudo defaults write /Library/Preferences/com.apple.TimeMachine SkipPaths -array-add "~tsigo/Library/Application Support/Google/Chrome/Default/History Index $year-$month-journal"
sudo defaults write /Library/Preferences/com.apple.TimeMachine SkipPaths -array-add "~tsigo/Library/Application Support/Google/Chrome/Default/History Index $year-$month"
done
done
@rspeicher
rspeicher / gist:648415
Created October 27, 2010 04:07
Wowr benchmark history; i7 @ 2.8 GHz
ree-1.8.7-2010.02 / FakeWeb 1.3.0 - Commit 35f5937 - Fix benchmark script
Running tests 1000 times each...
user system total real
get_character 28.030000 0.470000 28.500000 ( 28.516329)
get_guild 16.080000 0.170000 16.250000 ( 16.239343)
get_item_info 3.090000 0.110000 3.200000 ( 3.206233)
get_item_tooltip 12.200000 0.330000 12.530000 ( 12.523533)
get_arena_team 1.450000 0.060000 1.510000 ( 1.505885)
@rspeicher
rspeicher / gist:590298
Created September 21, 2010 18:59
My nginx configure arguments
--conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-log-path=/var/log/nginx/access.log --with-http_dav_module --http-client-body-temp-path=/var/lib/nginx/body --with-http_ssl_module --http-proxy-temp-path=/var/lib/nginx/proxy --with-http_stub_status_module --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --with-debug --with-http_flv_module
# Changes to make this bitch work:
# Surround #{@full_filename} in quotes for paths with spaces in them
# Change the "metadata = " regex so that it matches the new (?) output of ffmpeg
def initialize(options = {})
if options[:raw_response]
@raw_response = options[:raw_response]
elsif options[:file]
if options[:ffmpeg_binary]
@ffmpeg_binary = options[:ffmpeg_binary]