ほげaaa ほげ aaa
$ ruby test_before.rb # before patch
3.7357151369942585
$ ruby test.rb # after patch
1.2525334189995192
3.7357151369942585 / 1.2525334189995192 * 1000000
=> 2982527.3164992435 times faster!
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
def log(msg) | |
puts "[#{Time.now}]: #{msg}" | |
end | |
log 'start' | |
big_str = 'a' * 500_000_000 | |
log 'prepared' | |
begin | |
big_str.a | |
rescue => ex |
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
iabbrev differentiatiations differentiations | |
iabbrev disproportionaltely disproportionately | |
iabbrev oversimplificiation oversimplification | |
iabbrev transcendentational transcendental | |
iabbrev anthromorphization anthropomorphization | |
iabbrev disporportionately disproportionately | |
iabbrev dispraportionately disproportionately | |
iabbrev disproportianately disproportionately | |
iabbrev disproportionatley disproportionately | |
iabbrev disproprotionately disproportionately |
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
$ ruby-2.5.1 test.rb | |
"local-variable" | |
"local-variable" |
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
require 'ripper' | |
class RipperEventViewer < Ripper::SexpBuilderPP | |
(Ripper::PARSER_EVENTS + Ripper::SCANNER_EVENTS).each do |ev| | |
eval <<~RUBY | |
def on_#{ev}(*args) | |
super.tap do | |
puts "#{'*'*50} on_#{ev}" | |
pp(*args) | |
end |
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
def is_nil?(value, _=(value&.__id__(true&&return) rescue return)) | |
return true | |
end | |
p is_nil?(nil) | |
p is_nil?(false) | |
p is_nil?(true) | |
class A | |
undef __id__ |
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
def is_nil?(value) | |
result = true | |
value&.__id__(result = false) | |
result | |
rescue | |
result | |
end | |
TracePoint.new(:line) do |tp| | |
p tp |
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
static VALUE | |
str_upto_each(VALUE beg, VALUE end, int excl, int (*each)(VALUE, VALUE), VALUE arg) | |
{ | |
/* (snip) */ | |
/* normal case */ | |
n = rb_str_cmp(beg, end); | |
if (n > 0 || (excl && n == 0)) return beg; | |
after_end = rb_funcallv(end, succ, 0, 0); |
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
status key command | |
Conversion Up ConvertPrev | |
Composition Tab PredictAndConvert | |
Conversion Tab PredictAndConvert | |
Composition Space Convert | |
Conversion Space ConvertNext | |
Precomposition Space InsertSpace | |
Conversion Shift Up ConvertPrevPage | |
Conversion Shift Tab ConvertPrev | |
Composition Shift Space Convert |