Skip to content

Instantly share code, notes, and snippets.

@smholloway
smholloway / generate-alias-for-jekyll-post
Created January 31, 2014 05:07
Generate alias entries for Jekyll posts. This is
# Seth Holloway - https://github.com/smholloway
#
# The Jekyll Alias Generator, https://github.com/tsmango/jekyll_alias_generator,
# is a handy way to create meta refresh redirects from an old URL pattern to the
# new. This is helpful when changing blog formats as it helps maintain search
# engine rankings. Unfortunately, you have to create your own alias entries.
# With over 400 posts, I had # to automate it! This script will find all
# Markdown files in your _posts directory then generate an alias entry under the
# title attribute.
#
# http://www.6blog.us/2013/02/is-polymorphism-faster-in-ruby/
#
# Testing the speed of polymorphism in Ruby. This program is based on the Wikipedia article:
# http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming
#
# To run: ruby main.rb <number of runs to time (optional)>
# Example: ruby main.rb 5
class Animal
def initialize(name)