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 | |
# Script to import tumblr posts into local markdown posts ready to be consumed by Jekyll. | |
# Inspired by New Bamboo's post http://blog.new-bamboo.co.uk/2009/2/20/migrating-from-mephisto-to-jekyll | |
require 'rubygems' | |
require 'open-uri' | |
require 'nokogiri' | |
# Configuration |
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 | |
require 'webrick' | |
require 'socket' | |
require 'timeout' | |
# code from http://stackoverflow.com/questions/517219/ruby-see-if-a-port-is-open/517638#517638 | |
def port_in_use?(port) | |
begin |
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
# Rackup file for serving up a static site from a "public" directory | |
# | |
# Useful for chucking a static site on Heroku | |
class IndexRewriter | |
def initialize(app) @app = app end | |
def call(env) | |
env["PATH_INFO"].gsub! /\/$/, '/index.html' | |
@app.call(env) | |
end |
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
# Import a posterous.com Blog into nanoc (http://nanoc.stoneship.org) | |
# Uses Nokogiri to parse the XML data from the posterous API | |
require 'rubygems' | |
require 'nanoc3' | |
require 'nokogiri' | |
require 'open-uri' | |
module Nanoc3::Extra | |
module Importers |