joho / absurd-time-extensions
- Source
- Commits
- Network (2)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Tree:
fde05d9
commit fde05d981bef64ba70df7b01b7234f298f510326
tree 75547db9c7d0d6ac7c810363e6b7b337f7e7be0f
parent 7efedc6a7dcc85b97d2c848a55ec535dbc8f728a parent 3029267cae50df863ffc273bfe3e44c3e297ec29
tree 75547db9c7d0d6ac7c810363e6b7b337f7e7be0f
parent 7efedc6a7dcc85b97d2c848a55ec535dbc8f728a parent 3029267cae50df863ffc273bfe3e44c3e297ec29
absurd-time-extensions / time_ext.rb
| 9bf5db19 » | joho | 2008-06-30 | 1 | class Time | |
| 2 | # stupid swatch and their dotcom boom digital wristwatches | ||||
| 3 | def to_beats | ||||
| d2ca0a4a » | joho | 2008-06-30 | 4 | seconds, minutes, hours = getutc.to_a | |
| 9bf5db19 » | joho | 2008-06-30 | 5 | (((hours + 1) * 3600 + (minutes * 60) + seconds) / 86.4).to_i | |
| 6 | end | ||||
| 961fdfea » | joho | 2008-06-30 | 7 | alias to_internet_time to_beats | |
| 9bf5db19 » | joho | 2008-06-30 | 8 | ||
| 9 | def is_beer_oclock? | ||||
| 10 | true | ||||
| 11 | end | ||||
| 12 | |||||
| 13 | # handling the vanilla ice/mc hammer event | ||||
| 14 | attr_accessor :white_rapper | ||||
| 15 | def stop! | ||||
| 16 | if white_rapper | ||||
| 17 | "collaborate and listen" | ||||
| 18 | else | ||||
| 19 | "Hammertime!" | ||||
| 20 | end | ||||
| 21 | end | ||||
| 569dae21 » | joho | 2008-06-30 | 22 | ||
| 23 | def is_skynet_self_aware? | ||||
| 24 | # i am assuming as skynet is pretty clever, it's on UTC | ||||
| 25 | self > Time.utc(1997, 8, 29, 2, 14) | ||||
| 26 | end | ||||
| 474ff932 » | clinton | 2008-06-30 | 27 | ||
| 28 | def eighty_eight_miles_per_hour | ||||
| 29 | Time.utc(1955, 11, 5) | ||||
| 30 | end | ||||
| 2ade1831 » | Gareth Townsend | 2008-06-30 | 31 | ||
| 32 | def is_it_christmas? | ||||
| 33 | (self.month == 12) && (self.day == 25) | ||||
| 34 | end | ||||
| 7efedc6a » | joho | 2008-06-30 | 35 | ||
| 36 | def sleeps_until_christmas | ||||
| 37 | Time.local(self.year, 12, 25).yday - self.yday | ||||
| 38 | end | ||||
| 3029267c » | justinfrench | 2008-06-30 | 39 | ||
| 40 | # 3pm is my coffee cut-off point every day | ||||
| 41 | def coffee?(cutoff_hour = 15) | ||||
| 42 | self.hour < cutoff_hour | ||||
| 43 | end | ||||
| 44 | |||||
| 7efedc6a » | joho | 2008-06-30 | 45 | end | |
| fde05d98 » | joho | 2008-06-30 | 46 | ||

