Skip to content

Instantly share code, notes, and snippets.

View chsh's full-sized avatar
👍
Love your code.

CHIKURA Shinsaku chsh

👍
Love your code.
View GitHub Profile
@chsh
chsh / convert-seconds-into-hh-mm-ss-in-ruby.rb
Created October 20, 2019 11:14 — forked from shunchu/convert-seconds-into-hh-mm-ss-in-ruby.rb
Convert seconds into HH:MM:SS in Ruby
t = 236 # seconds
Time.at(t).utc.strftime("%H:%M:%S")
=> "00:03:56"
# Reference
# http://stackoverflow.com/questions/3963930/ruby-rails-how-to-convert-seconds-to-time
@chsh
chsh / link.rb
Last active December 16, 2015 23:59 — forked from rmoriz/Gemfile
1. Use SecureRandom.uuid instead of UUIDTools. 2. Belonging models should specify string type refering Site. 3. Apply Ruby 1.9 or higher syntax. ;-)