Skip to content

Instantly share code, notes, and snippets.


Marc Hadley hadleynet

View GitHub Profile
View gist:29163d57cc75f7300bf5
Verifying that +hadleynet is my blockchain ID.
hadleynet / gm2jekyll.rb
Created November 23, 2014 22:59
Ruby script to convert Greymatter blog entries to Jekyll post format
View gm2jekyll.rb
#!/usr/bin/env ruby
source_dir = ARGV[0]
dest_dir = ARGV[1]
def get_timestamp(components)
month = components[0].to_i
day = components[1].to_i
year = components[2].to_i
hour = components[3].to_i
minute = components[4].to_i
hadleynet / Rakefile
Created November 23, 2014 22:54
Rakefile to migrate Bloxsom weblog entries to Jekyll
View Rakefile
require 'pathname'
task :bloxsom, [:post_dir, :dest_dir] do |t, args|
Dir.glob(File.join(args[:post_dir], "**/*.txt")).each do |path|
time_stamp = File.stat(path).mtime
relative_path =[:post_dir]))
tags = File.dirname(relative_path).split('/')
content = File.readlines(path)
title = content[0].chomp