Skip to content

Instantly share code, notes, and snippets.

@tomelm
Created January 5, 2013 19:00
Show Gist options
  • Save tomelm/4463087 to your computer and use it in GitHub Desktop.
Save tomelm/4463087 to your computer and use it in GitHub Desktop.
(1..31).each_with_object({}) { |day,hash| hash[day] = nil }
=> {1=>nil,
2=>nil,
3=>nil,
4=>nil,
5=>nil,
6=>nil,
7=>nil,
8=>nil,
9=>nil,
10=>nil,
11=>nil,
12=>nil,
13=>nil,
14=>nil,
15=>nil,
16=>nil,
17=>nil,
18=>nil,
19=>nil,
20=>nil,
21=>nil,
22=>nil,
23=>nil,
24=>nil,
25=>nil,
26=>nil,
27=>nil,
28=>nil,
29=>nil,
30=>nil,
31=>nil}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment