Skip to content

Instantly share code, notes, and snippets.

@aienn
aienn / bydloscript.rb
Created March 11, 2013 22:23
CMeLLIHa9l_KupuJIJIuLLa_no3BoHuT!
#usage ruby bydloscript.rb Здесь смешные надписи кириллицей лол!
source = ARGV.join(" ").strip.split(//)
table = { "а" => "a", "А" => "A",
"б" => "6", "Б" => "6",
"в" => "B", "В" => "B",
"г" => "r", "Г" => "r",
"д" => "D", "Д" => "D",
"е" => "e", "Е" => "E",
"ё" => "e", "Ё" => "E",
@andremedeiros
andremedeiros / talks.md
Last active August 29, 2015 14:06
Baruco 2014 talks

Baruco 2014 talks

Please see the Hackpad where we can all contribute!

@tiegz
tiegz / object_profiler.rb
Last active August 29, 2015 14:03
Object Profiler for ruby 2.1.0+
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