Skip to content

Instantly share code, notes, and snippets.

@Prigin
Created October 17, 2019 19:34
Show Gist options
  • Save Prigin/c38194d446f632353bdd35aea52c7f28 to your computer and use it in GitHub Desktop.
Save Prigin/c38194d446f632353bdd35aea52c7f28 to your computer and use it in GitHub Desktop.
bit of code
months = mas.each_with_object(
[["jan", 0], ["feb", 0], ["mar", 0],
["apr", 0], ["may", 0], ["jun", 0],
["jul", 0], ["aug", 0], ["sep", 0],
["oct", 0], ["nov", 0], ["dec", 0]]) do |base, unit|
buff = base.date.split("-")[1]
unit[buff.to_i-1][1] += 1 if buff != nil
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment