Skip to content

Instantly share code, notes, and snippets.

@liluo
Forked from SaitoWu/graph.rb
Last active December 17, 2015 12:29
Show Gist options
  • Save liluo/5609949 to your computer and use it in GitHub Desktop.
Save liluo/5609949 to your computer and use it in GitHub Desktop.
require 'date'
author = "fenbi"
email = "[email protected]"
date = Date.new(2012, 7, 30)
l = %w{
. . . . . . .
. . o . . . .
. . o . . . .
. . o . . . .
. . o . . . .
. . o o o . .
. . . . . . .
}
i = %w{
. . . . . . .
. . . o . . .
. . . o . . .
. . . o . . .
. . . o . . .
. . . o . . .
. . . . . . .
}
u = %w{
. . . . . . .
. o . . . o .
. o . . . o .
. o . . . o .
. o . . . o .
. o o o o o .
. . . . . . .
}
o = %w{
. . . . . . .
. o o o o o .
. o . . . o .
. o . . . o .
. o . . . o .
. o o o o o .
. . . . . . .
}
matrix = []
chars = [l, i, l, u, o]
chars.each{|c| matrix += c.each_slice(7).to_a.transpose.flatten}
%x[git init]
matrix.each do |day|
if day == "o"
%x[git commit --allow-empty --author="#{author} <#{email}>" --date="#{date.to_time}" -m"#{date.to_time} - by: #{author}"]
end
date = date.next
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment