Skip to content

Instantly share code, notes, and snippets.

John Gerhardt jwg2s

Block or report user

Report or block jwg2s

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jwg2s
jwg2s / spec.rb
Last active Dec 27, 2015
No Focus Trues in Source
View spec.rb
it 'should ensure we have no extra focus true exist' do
files = Dir.glob(File.join(Rails.root, 'spec', '**', '*_spec.rb'))
count = 0
files.each do |file|
unless File.readlines(file).grep(/focus['"]?\s*[\:=][>]?\s*true/).empty?
puts "#{file} has focus true!"
count = count + 1
end
end
count.should == 0
View doors.rb
require 'benchmark'
def count_factors(number)
factors = (1..number).select { |n| (number % n).zero? }
factors.count
end
def print_doors(n)
i = 0
array = (1..n)
You can’t perform that action at this time.