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
# (c) 2012 Luca Guidi (lucaguidi.com) – Released under MIT License | |
# | |
# It prompts: | |
# *[master][~/Developer/epts]% rb:1.9.3-p0 | |
# | |
# Meaning: | |
# - The asterisk is for mark uncommitted git changes | |
# - In the square brackets are respectively: for the current git branch | |
# and for the current directory | |
# - The percent is the prompt |
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/env ruby | |
unless ARGV[0] | |
puts 'Usage: newpost "the post title"' | |
exit(-1) | |
end | |
date_prefix = Time.now.strftime("%Y-%m-%d") | |
postname = ARGV[0].strip.downcase.gsub(/ /, '-') | |
post = "/Users/al3x/src/al3x.github.com/_posts/#{date_prefix}-#{postname}.textile" |