This file contains 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
# Replace european accents and umlauts with their simple counterparts | |
# ä -> a, ç -> c, etc. | |
class String | |
def simplify | |
gsub(/[àáâãäåæ]/i, 'a'). | |
gsub(/[ç]/i, 'c'). | |
gsub(/[èéêë]/i, 'e'). | |
gsub(/[ìíîï]/i, 'i'). | |
gsub(/[ñ]/i, 'n'). |
This file contains 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 -wKU | |
# ... do some awesome stuff (requires, variable initialization, etc.) | |
require 'irb' | |
require 'irb/completion' | |
IRB.start |
This file contains 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
# All Models in rails (that are already loaded) | |
Object.constants.map { |c| | |
c.constantize | |
}.select { |klass| | |
klass.is_a?(Class) && klass < ActiveRecord::Base | |
} |
NewerOlder