This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"color_scheme": "Packages/Color Scheme - Default/SpaceCadet.tmTheme", | |
"default_line_ending": "unix", | |
"draw_white_space": "all", | |
"ensure_newline_at_eof_on_save": true, | |
"font_size": 14.0, | |
"highlight_line": true, | |
"highlight_modified_tabs": true, | |
"show_tab_close_buttons": false, | |
"tab_size": 2, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function($){ | |
$('.toggle.hidden').hide(); | |
$(document).on('click','.toggle_button', function(){ | |
$(this).parent().find('.toggle').fadeToggle(); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
file = ARGV.shift | |
parameters = ARGV | |
unless file && !parameters.empty? | |
puts <<-end_usage | |
Usage #{$0} logfile param [param, ...] | |
Reads a rails log and extracts the given parameters, prints CSV. | |
Useful to include [action, controller] in parameters. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rvm env . -- --env > .powenv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "delegate" | |
class ObjectDelegator < SimpleDelegator | |
undef_method :class, :object_id | |
end | |
def Object.delegate(object, delegation) | |
ObjectDelegator.new(object).tap{|x| Array(delegation).each{|m| x.extend m } } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'rack-rewrite' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveRecord::Base.class_eval do | |
# Setup some useful generic scopes | |
named_scope :ordered, proc{ { :order => primary_key } } | |
named_scope :where, proc{|*conditions| { :conditions => conditions.size == 1 ? conditions.first : conditions } } | |
named_scope :joins, proc{|joins| { :joins => Array(joins).join(' ') } } | |
named_scope :limit, proc{|count| { :limit => count } } | |
named_scope :offset, proc{|offset| { :offset => offset } } | |
named_scope :order, proc{|order| { :order => order.to_s } } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.config.generators do |g| | |
g.template_engine :haml | |
g.javascript_engine :js | |
g.integration_tool :cucumber | |
g.test_framework :test_unit, :fixture => false, | |
:views => true, | |
:fixture_replacement => :factory_girl | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# :: is required for ruby 1.9.1 | |
# require_relative will fail in ruby 1.9.2 | |
require ::File.dirname(__FILE__) + '/lib/all' | |
trap("USR2") do | |
puts "Stopping due to timeout..." | |
puts caller | |
exit! 1 | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# config/initializers/load_smtp_settings.rb | |
# | |
smtp_settings = YAML.load(File.new('config/smtp_settings.yml'))[Rails.env].symbolize_keys! | |
ActionMailer::Base.smtp_settings = smtp_settings |