Skip to content

Instantly share code, notes, and snippets.

View hadleynet's full-sized avatar

Marc Hadley hadleynet

View GitHub Profile
@hadleynet
hadleynet / Rakefile
Created November 23, 2014 22:54
Rakefile to migrate Bloxsom weblog entries to Jekyll
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 = Pathname.new(path).relative_path_from(Pathname.new(args[:post_dir]))
tags = File.dirname(relative_path).split('/')
tags.delete('.')
content = File.readlines(path)
title = content[0].chomp
@hadleynet
hadleynet / gm2jekyll.rb
Created November 23, 2014 22:59
Ruby script to convert Greymatter blog entries to Jekyll post format
#!/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
Verifying that +hadleynet is my blockchain ID. https://onename.com/hadleynet