Skip to content

Instantly share code, notes, and snippets.

View deathweaselx86's full-sized avatar
🦕
🌚 🌑 🌔 🌕 🌝

Jessica Ross McKinnie deathweaselx86

🦕
🌚 🌑 🌔 🌕 🌝
View GitHub Profile
@deathweaselx86
deathweaselx86 / reprocess_hours.rake
Last active May 15, 2016 16:59 — forked from mltsy/reprocess_hours.rake
Takes a filename of an event log (plain text, not gz), finds all the verification events in that file and reprocesses the hours.
desc "open a given log file, and extract/save hours from all Business Verification records logged"
task :reprocess_hours, [:filename] => :environment do |t, args|
lines_read = lines_processed = lines_skipped = lines_failed = 0
filename = args[:filename]
puts "Reading lines from #{filename}..."
in_log = File.open(filename)
in_log.each do |line|
lines_read += 1
json = JSON.parse(line)