Skip to content

Instantly share code, notes, and snippets.

@reimaruyama
reimaruyama / stop_watch.py
Last active June 28, 2020 10:59
Python stop watch
from time import time
class StopWatch:
def __init__(self):
self.start_time = 0
self.stop_time = 0
self.total_time = 0
def __enter__(self) -> "StopWatch":
@reimaruyama
reimaruyama / time_zone_index_in_rails.md
Created September 20, 2019 04:10
Railsで扱えるタイムゾーンの一覧を確認
$ rails console
ActiveSupport::TimeZone.all.map {|tz| tz.to_s}

# => ["(GMT-12:00) International Date Line West",
# "(GMT-11:00) American Samoa",
# "(GMT-11:00) Midway Island",
# "(GMT-10:00) Hawaii",