Skip to content

Instantly share code, notes, and snippets.

View fujin's full-sized avatar

AJ Christensen fujin

  • Rotorua, New Zealand
View GitHub Profile
@fujin
fujin / gist:15165
Created October 6, 2008 22:48 — forked from loe/gist:15164
define monit_file($ensure = 'absent') {
include monit
case $ensure {
'present': {
file {
"/etc/monit.d/${name}.run":
owner => "root", group => "root", mode => "0644",
replace => true,
source => "puppet:///monit/${name}.run",
notify => Service["monit"];
@fujin
fujin / router.rb
Created September 22, 2008 04:01 — forked from carllerche/router.rb
Merb.logger.info("Compiling routes...")
Merb::Router.prepare do |r|
# This deferred route allows permalinks to be handled, without a separate rack handler
match("/:permalink").defer_to do |request, params|
unless (article = Article.find_by_permalink(params[:permalink)).nil?
{:controller => "articles", :action => "show", :id => article.id}
end
end
# Admin namespace