Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
stupid import thing
#!/usr/bin/env ruby
require 'time'
$output = File.open("tstamp.csv",'w')
$input = File.open("dork.in",'r')
def gimmetime(str)
d1 = Time.parse(str)
rm1 = Random.new
rand_secs1 = rm1.rand(100) * 60
d2 = d1 + rand_secs1
rm2 = Random.new
rand_secs2 = rm2.rand(45) * 60
d3 = d2 + rand_secs2
rm3 = Random.new
rand_sec3 = rm3.rand(120) * 60
d4 = d3 + rand_sec3
$output.puts "\"#{d1}\",\t\"#{d2}\",\t\"#{d3}\",\t\"#{d4}\""
end
$input.read.each_line do |dork|
#dork = "23/May/13 12:11"
gimmetime(dork)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.