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 | |
# vim: ft=ruby | |
def mk_uniq_name_by(filename, path) | |
uniq_name = filename | |
prefix = 0 | |
while FileTest.exist?(File.join(path, uniq_name)) | |
prefix += 1 | |
uniq_name = sprintf("%d.%s", prefix, filename) | |
end | |
uniq_name |
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
module Inline | |
include Haml::Filters::Base | |
def self.[](key) | |
@@data[key.to_s] rescue nil | |
end | |
def render(str) | |
@@data = Hash[*str.split(/^\s*@@\s*(\w+)\s*\n/m)[1..-1]] | |
return nil |
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
#!/bin/sh | |
# | |
# init.d script for single or multiple unicorn installations. Expects at least one .conf | |
# file in /etc/unicorn | |
# | |
# Modified by [email protected] http://github.com/jaygooby | |
# based on http://gist.github.com/308216 by http://github.com/mguterl | |
# | |
## A sample /etc/unicorn/my_app.conf | |
## |