Skip to content

Instantly share code, notes, and snippets.

🐕

Igor Escobar igorescobar

🐕
Block or report user

Report or block igorescobar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View callback_disabler.rb
# In spec/support/callback_disabler.rb
module CallbackDisabler
def self.store_callbacks(model, filters)
model = constantize(model)
filters.each do |filter|
model.send("_#{filter}_callbacks").each do |callback|
stored_callbacks[model] << {
filter: filter, kind: callback.kind, raw_filter: callback.raw_filter
}
@igorescobar
igorescobar / utf8encode.rake
Created Oct 9, 2012 — forked from francesc/utf8encode.rake
Manage the UTF-8 encoding header for ruby 1.9
View utf8encode.rake
desc "Manage the encoding header of Ruby files"
task :utf8_encode_headers => :environment do
files = Array.new
["*.rb", "*.rake"].each do |extension|
files.concat(Dir[ File.join(Dir.getwd.split(/\\/), "**", extension) ])
end
files.each do |file|
content = File.read(file)
next if content[0..16] == "# coding: UTF-8\n\n" ||
You can’t perform that action at this time.