Skip to content

Instantly share code, notes, and snippets.

@migrs
migrs / del
Created August 30, 2009 00:06 — forked from javascripter/del
#!/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
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
#!/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
##