I hereby claim:
- I am almostwhitehat on github.
- I am almostwhitehat (https://keybase.io/almostwhitehat) on keybase.
- I have a public key whose fingerprint is 82E7 6B8D 4751 19C0 C1E1 942F 85FA A1AF BC14 E33D
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# Drop this in as a rails initializer and resstart rails | |
# View the source of pages - you'll see which template and views are used when rendering pages | |
module ActionView | |
class TemplateRenderer | |
alias_method :original_render, :render | |
def render(context, options) | |
rendered_content = original_render(context, options) | |
# Random string makes it easier to jump between matching start / stop when viewing source of the page |
require 'benchmark/ips' | |
ARRAY = [*1..100] | |
def slow | |
ARRAY.select { |x| x.eql?(50) }.last | |
end | |
def fast | |
ARRAY.reverse.detect { |x| x.eql?(50) } |
require 'benchmark/ips' | |
ARRAY = [*1..100] | |
def slow | |
ARRAY.select { |x| x.eql?(80) }.last | |
end | |
def fast | |
ARRAY.reverse.detect { |x| x.eql?(80) } |
Before do |scenario| | |
tagged_as_a_bug = scenario.source_tag_names.any? { |tag| tag.start_with? '@Bug-' } | |
if tagged_as_a_bug | |
STDOUT.puts 'Skipped - Bug' | |
scenario.skip_invoke! | |
end | |
end |
Pry.editor = proc { |file, line| "rubymine #{file} --line #{line} #{file}" } | |
Pry::Commands.create_command "rm" do | |
description "Launches rubymine at the current point" | |
def process | |
run 'edit --current' | |
end | |
end |