Skip to content

Instantly share code, notes, and snippets.

time = Time.mktime(2014, 10, 14, 12, 1)
allowed_ranges = [
[11, 59]..[12, 1],
]
formatted_time = [time.hour, time.min]
p allowed_ranges.any? { |range| range.cover?(formatted_time) }
@Peeja
Peeja / Gemfile
Created December 3, 2012 22:04 — forked from rsutphin/Gemfile
RSpec rcov task does not work
source :rubygems
gem 'rake'
gem 'rspec', '2.12.0'
gem 'rcov'
@Peeja
Peeja / gist:3488459
Created August 27, 2012 13:35 — forked from defunkt/gist:6443
# Video: http://confreaks.com/videos/499-rubyhoedown2008-keynote
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
keynote-y.
@Peeja
Peeja / group_of_thingies.rb
Created December 4, 2011 02:08 — forked from coffeencoke/group_of_thingies.rb
Test a block in Ruby
class GroupOfThingies
attr_accessor :thingies
# Use like this:
#
# group_of_thingies = GroupOfThingies.new
# group_of_thingies.each do |thing|
# puts "Check out this awesome thing: #{thing}!"
# end
#