Donate to support Ukraine's independence.

14 Jun'13

mkpost for Jekyll

In order to speedup post creation, I found and improved a simple Ruby script:

#!/usr/bin/ruby
require 'date'
require 'time'

puts 'What would you like to write about?'
article_title = gets
slug = article_title.downcase.strip.gsub(' ', '-')

current_date = Date.today.to_s
current_time = Time.now

filename = current_date + '-' + slug + '.md'

File.open("_posts/"+filename, "w") do |post|
 post.write("---\n")
 post.write("layout: post\n")
 post.write("title: #{article_title}")
 post.write("date: #{current_time}\n")
 post.write("---")
end

puts 'Created new file here: _/posts/'+filename

# fire up sublime text
system("subl '_posts/#{filename}' &")

Continue reading

Category: 

27 Jun'11

Installing Ruby & Ruby on Rails on Ubuntu box

Start by: http://itshouldbeuseful.wordpress.com/2011/05/04/setting-up-ubuntu-11-04-for-rails-development/

Dig deeper with: http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/

If you install rvm as root and fall in bunch of problems, visit: http://stackoverflow.com/questions/5253643/cannot-install-rvm-permission-denied-in-usr-local-rvm

Continue reading