Skip to content

Instantly share code, notes, and snippets.

Avatar
©️
 ​[object Object] :trollface:

Aaron Patterson tenderlove

©️
 ​[object Object] :trollface:
View GitHub Profile
View hahaha.txt
Started GET "/users" for 127.0.0.1 at 2014-05-21 15:29:48 -0700
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by UsersController#index as */*
User Load (0.1ms) SELECT "users".* FROM "users"
##########################################################################################
/Users/aaron/git/rails/actionview/lib/action_view/routing_url_for.rb:101:in `url_options'
/Users/aaron/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:175:in `call'
/Users/aaron/git/rails/actionpack/lib/action_dispatch/routing/route_set.rb:269:in `block (2 levels) in define_url_helper'
/Users/aaron/git/omglolwut/app/views/users/index.html.erb:25:in `_app_views_users_index_html_erb__2589710368981423133_70120446187800'
/Users/aaron/git/rails/actionview/lib/action_view/template.rb:145:in `block in render'
View nme.rb
class Foo
def method_missing name, *args
p args
end
end
class Bar < Foo
def omg
super # should raise a no method error
end
View before.txt
==================================
Mode: cpu(1000)
Samples: 8595 (0.00% miss rate)
GC: 1106 (12.87%)
==================================
TOTAL (pct) SAMPLES (pct) FRAME
813 (9.5%) 813 (9.5%) ActiveSupport::SafeBuffer#initialize
699 (8.1%) 350 (4.1%) block in ActiveRecord::AttributeMethods::Read#read_attribute
486 (5.7%) 298 (3.5%) ActionController::UrlFor#url_options
670 (7.8%) 274 (3.2%) ActionDispatch::Journey::Format#evaluate
View report.txt
1 Symbol::tostr.ing
1 TrueClass::tostring
2 ActiveSupport::Duration::tostring
2 Mime::Type::tostring
6 Array::tostring
17 Module::tostring
22 Float::tostring
24 FalseClass::tostring
203 ActiveSupport::SafeBuffer::tostring
627 Class::tostring
View crashy_lisp.swift
import Cocoa
func cons(x: Any, y: Any) -> (((Any, Any) -> Any) -> Any) {
return { (m: (Any, Any) -> Any) -> Any in
return m(x, y)
}
}
func car(z: (((Any, Any) -> Any) -> Any)) -> Any {
return z({ (p: Any, q:Any) -> Any in
View blah.rb
# Make sure to do detection so it will gracefully downgrade like:
# begin
require 'psych'
Psych.add_domain_type(nil, 'code') { |_,hash|
p hash['ruby']
}
# rescue
# do 1.8 stuff
# end
View fuuu.txt
[aaron@higgins rubygems (omg)]$ ruby -I lib -e"require 'rubygems'; require 'minitest'"
Invalid gemspec in [/Users/aaron/.rbenv/versions/ruby-trunk/lib/ruby/gems/2.2.0/specifications/allocation_tracer-0.4.0.gemspec]: deadlock; recursive locking
/Users/aaron/git/rubygems/lib/rubygems/stub_specification.rb:127:in `missing_extensions?': undefined method `missing_extensions?' for nil:NilClass (NoMethodError)
from /Users/aaron/git/rubygems/lib/rubygems/basic_specification.rb:64:in `contains_requirable_file?'
from /Users/aaron/git/rubygems/lib/rubygems/specification.rb:937:in `block in find_inactive_by_path'
from /Users/aaron/git/rubygems/lib/rubygems/specification.rb:936:in `each'
from /Users/aaron/git/rubygems/lib/rubygems/specification.rb:936:in `find'
from /Users/aaron/git/rubygems/lib/rubygems/specification.rb:936:in `find_inactive_by_path'
from /Users/aaron/git/rubygems/lib/rubygems.rb:185:in `try_activate'
from /Users/aaron/git/rubygems/lib/rubygems/core_ext/kernel_require.rb:124:in `rescue in require'
View gist:58d68187d40369dde395
##########################################################################################
/Users/aaron/git/rails/railties/lib/rails.rb:63:in `root'
test/railties/railtie_test.rb:77:in `block in <class:Foo>'
/Users/aaron/git/rails/activesupport/lib/active_support/lazy_load_hooks.rb:36:in `call'
/Users/aaron/git/rails/activesupport/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/Users/aaron/git/rails/activesupport/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
/Users/aaron/git/rails/activesupport/lib/active_support/lazy_load_hooks.rb:44:in `each'
/Users/aaron/git/rails/activesupport/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
/Users/aaron/git/rails/railties/lib/rails/application.rb:121:in `initialize'
/Users/aaron/git/rails/railties/lib/rails/railtie.rb:171:in `new'
View rawr.diff
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index 796c068..61639be 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -94,6 +94,10 @@ module Rails
super.run_load_hooks!
end
+ def create(initial_variable_values = {}, &block)
+ new(initial_variable_values, &block).run_load_hooks!
View ( ͡° ͜ʖ ͡°) .txt
Top 50 tests by objects allocated
224624: EagerLoadPolyAssocsTest#test_include_query
212146: SchemaDumperDefaultsTest#test_schema_dump_defaults_with_universally_supported_types
172186: EagerAssociationTest#test_eager_with_multiple_associations_with_same_table_has_many_and_habtm
154367: AttributeMethodsTest#test_time_zone_aware_attribute_saved
107256: MigrationTest#test_migrator_versions
105861: MigrationTest#test_filtering_migrations
104094: MigrationTest#test_migration_without_transaction
98828: MigrationTest#test_add_table_with_decimals