Gist数据嵌入博客
下面嵌入的Ruby代码,来自 gist.github.com
访问 http://gotgit.github.com/gotgithub/ 阅读电子书《GotGitHub》。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Calculate the countdown for the meeting of the party. | |
require 'Date' | |
days=(DateTime.new(2012,10,15)-DateTime.now).ceil | |
if days >= 0 | |
puts "Maybe #{days} days left." | |
else | |
puts "Passed for #{days.abs} days." | |
end |