Skip to content

Instantly share code, notes, and snippets.

View AaronH's full-sized avatar

Aaron Hurley AaronH

View GitHub Profile
# View IRB History of this session
#
# irb_history # return all console commands this session
# irb_history 25 # return last 25 console commands from this session
# irb_history :all # return all console commands from all sessions
# irb_history :all, 25 # return last 25 console commands
#
def hist(*args)
limit = args.last.class == Fixnum ? args.last : MAXHISTSIZE
puts Readline::HISTORY.entries.split("exit").
@AaronH
AaronH / delayed_job
Created August 26, 2009 23:41 — forked from akmathur/delayed_job
delayed_job script for daemon-spawn to prevent multiple instances of delayed_job
#!/usr/bin/env ruby
# -*- ruby -*-
require 'rubygems'
require 'daemon-spawn'
RAILS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
class DelayedJobWorker < DaemonSpawn::Base
def start(args)
ENV['RAILS_ENV'] ||= args.first || 'development'