Warning: Trying to access array offset on value of type null in /var/www/randygirard.com/html/wp-content/themes/gist/candidthemes/functions/custom-functions.php on line 143
Randy Girard

Ruby random number by day

This is a cool little snippet of code that will return a random number, that changes by day:

def random_by_day(max_value)
  srand Time.now.strftime("%m%d%Y").to_f
  rand(max_value)
end