Skip to content

Instantly share code, notes, and snippets.

View marcinbunsch's full-sized avatar

Marcin Bunsch marcinbunsch

View GitHub Profile
@marcinbunsch
marcinbunsch / profiling_tool.rb
Created December 29, 2011 14:22 — forked from ksarna/profiling_tool.rb
Profiling rails requests with ruby-prof
# You can use this class in your console. For example
# p = ProfilingTools.new
# p.profiled_request(:controller => :welcome, :action => :index)
# this will profile whole application stack and save file in your tmp/profiler folder
# You can also use +request+ method just to see the output for example:
#
# p.request(:controller => :offers, :action => :index)
#
# p.response.body
# p.response.cookies # and so on
@marcinbunsch
marcinbunsch / things-yammer-checkin
Created July 8, 2011 11:41 — forked from cziko/things-yammer-checkin
Things - Yammer checkin script
#!/usr/bin/ruby
# gem install things-client --source http://gemcutter.org
# gem install broadcast
require 'rubygems'
require 'things'
require 'broadcast'
@marcinbunsch
marcinbunsch / gist:1044437
Created June 24, 2011 08:30
Rails production prompt change as a Rails initializer
# Put this file in config/initializers/irb.rb
# Works in Rails 3.0+, should also work in 2.3
# Override the IRB, to provide the Rails environment in the prompt
module IRB
class << self
def setup_with_prompt_override(ap_path)
setup_without_prompt_override(ap_path)
env = (Rails.env.to_sym == :production ? "\033[00;31mPRODUCTION\033[00m" : Rails.env)