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
# Find all tables and when they were last vacuumed/analyzed, either manually or automatically | |
SELECT relname, | |
last_vacuum, | |
last_autovacuum, | |
last_analyze, | |
last_autoanalyze | |
FROM pg_stat_all_tables | |
WHERE schemaname = 'public' | |
ORDER BY last_vacuum DESC; |
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
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 |
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 '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) |