Skip to content

Instantly share code, notes, and snippets.

View dvogt23's full-sized avatar
✌️

dima dvogt23

✌️
View GitHub Profile
@dvogt23
dvogt23 / time_helper.rb
Created November 25, 2024 20:31
ruby quarter hour range method
module TimeHelper
def quarter_hour_range(timestamp)
array = timestamp.to_a
# 1-4th qurater of a hour
quarter = ((array[1] % 60) / 15.0).ceil - 1
# 0/15/30/45 start of a quarter
start_minute = (quarter * 15) % 60
end_minute = (start_minute + 15) % 60

Keybase proof

I hereby claim:

  • I am dvogt23 on github.
  • I am dima23 (https://keybase.io/dima23) on keybase.
  • I have a public key whose fingerprint is 2CEA B7DC C243 9E6A AADA 7090 C6F3 8FDE F59E C8C7

To claim this, I am signing this object: