Please see the Hackpad where we can all contribute!
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
#usage ruby bydloscript.rb Здесь смешные надписи кириллицей лол! | |
source = ARGV.join(" ").strip.split(//) | |
table = { "а" => "a", "А" => "A", | |
"б" => "6", "Б" => "6", | |
"в" => "B", "В" => "B", | |
"г" => "r", "Г" => "r", | |
"д" => "D", "Д" => "D", | |
"е" => "e", "Е" => "E", | |
"ё" => "e", "Ё" => "E", |
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
module ObjectSpace | |
def self.profile(&blk) | |
require 'objspace' | |
enable_gc = GC.disable | |
ObjectSpace.trace_object_allocations(&blk) | |
objs = Hash.new(0) | |
ObjectSpace.each_object { |o| | |
if (file = ObjectSpace.allocation_sourcefile(o)) && (line = ObjectSpace.allocation_sourceline(o)) | |
objs["#{file}:#{line}:#{o.class.name}"] += 1 |
NewerOlder