View rspec_cache.txt
[aaron@TC Bath (master)]$ rspec rspec_test.rb
{:global_method_state=>142, :global_constant_state=>1332, :class_serial=>14849}
.{:global_method_state=>142, :global_constant_state=>1332, :class_serial=>14850}
.{:global_method_state=>142, :global_constant_state=>1332, :class_serial=>14851}
.
Finished in 0.00076 seconds (files took 0.13633 seconds to load)
3 examples, 0 failures
[aaron@TC Bath (master)]$ lldb `rbenv which ruby` -- -S `rbenv which rspec` rspec_test.rb
View ruby_23_stat.txt
$ sudo dtrace -q -n 'syscall::stat*:entry { printf("%s\n", copyinstr(arg0)); }' -c`rbenv which ruby`" -e'\ '"
/Users/aaron/.rbenv/versions/2.3.0/lib/ruby/2.3.0/x86_64-darwin15/enc/encdb.bundle
dtrace: error on enabled probe ID 3 (ID 826: syscall::stat64:entry): invalid user access in action #1 at DIF offset 24
/Users/aaron/.rbenv/versions/2.3.0/lib/ruby/2.3.0/x86_64-darwin15/enc/trans/transdb.bundle
dtrace: error on enabled probe ID 3 (ID 826: syscall::stat64:entry): invalid user access in action #1 at DIF offset 24
/Users/aaron/.rbenv/versions/2.3.0/lib/ruby/2.3.0/x86_64-darwin15/stringio.bundle
dtrace: error on enabled probe ID 3 (ID 826: syscall::stat64:entry): invalid user access in action #1 at DIF offset 24
/Users/aaron/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/specifications/default/bigdecimal-1.2.8.gemspec
/Users/aaron/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/specifications/default/io-console-0.4.5.gemspec
View hash_speed.rb
require 'benchmark/ips'
class Foo
alias :object_hash :hash
attr_reader :hash
def initialize
@hash = object_hash
end
end
View changing_logo.md

Install pillow

$ pip3 install pillow

Generate code from bmp

$ python3 Scan/STLcd/bitmap2Struct.py ~/Desktop/dz.bmp
View a_terrible_thing.txt
[aaron@TC omglolwut (master)]$ cat lib/tasks/disable_autoload_during_migrations.rake
task :disable_autoload do
ActiveSupport::Dependencies.class_eval do
extend Module.new {
def load_file(path, const_paths = loadable_constants_for_path(path))
return if path.starts_with? File.join(Rails.application.root, 'app', 'models')
super
end
}
end
View ruby.patch
diff --git a/compile.c b/compile.c
index 995ff89..f0528af 100644
--- a/compile.c
+++ b/compile.c
@@ -1697,6 +1697,7 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
case TS_CALLCACHE:
{
struct rb_call_cache *cc = &iseq->body->cc_entries[ISEQ_COMPILE_DATA(iseq)->ci_index + ISEQ_COMPILE_DATA(iseq)->ci_kw_index - 1];
+ cc->serial = rb_next_ic_serial();
generated_iseq[code_index + 1 + j] = (VALUE)cc;
View omg.rb
class A
def foo; end
end
class B
def foo; end
end
def omg obj
obj.foo # `obj` is only ever two types: A and B
View n2callsite.csv
site and types calls at site
Set - Array @ 17900 313640
Array - NilClass @ 17747 195583
Symbol - String @ 241594 130207
Fixnum - NilClass @ 163777 62628
Array - NilClass @ 214446 53352
Symbol - String @ 210564 38614
Float - Fixnum @ 259287 25202
ActiveSupport::SafeBuffer - ActionView::OutputBuffer @ 162148 21423
ActiveSupport::SafeBuffer - ActionView::OutputBuffer @ 162150 21423
View boom.rb
# Run this with rspec 2 or 3, it will randomly fail in ruby 2.3.0-preview2 when the ".new" example runs last.
# It fails with
# 1) SmallCircle .new
# Failure/Error:
# def area
# super(2)
#
# ArgumentError:
# wrong number of arguments (given 1, expected 0)
# inline_spec.rb:23:in `area'
View callsite_data.csv
number of types number of calls
1 23309344
2 10341277
3 439291
4 378137
5 120699
6 100403
7 288376
8 222454
9 37247