Skip to content

Instantly share code, notes, and snippets.

View b-mandelbrot's full-sized avatar

b-mandelbrot

View GitHub Profile
@b-mandelbrot
b-mandelbrot / resque_web.monit
Created November 16, 2011 21:13 — forked from guilherme/resque_web.monit
monit configuration for resque web
check process resque-web with pidfile /var/www/app/shared/resque_web/resque_web.pid
group resque
start program = "/bin/env RAILS_ENV=production /var/www/app/current/app/workers/run_resque_web.sh start" as uid deploy gid deploy
stop program = "/bin/env RAILS_ENV=production /var/www/app/current/app/workers/run_resque_web.sh stop" as uid deploy and gid deploy
if failed host localhost port 5678 with timeout 10 seconds then restart
if 3 restarts within 5 cycles then timeout
require 'usb'
require 'betabrite'
###
# Get a betabrite sign:
#
# http://www.betabrite.com/
# http://www.amazon.com/Brite-Prism-Moving-Message-Display/dp/B000MQAI72
#
# Install gems:
@b-mandelbrot
b-mandelbrot / redis_pubsub_demo.rb
Created July 7, 2011 19:38 — forked from tobym/redis_pubsub_demo.rb
Redis PubSub demo with EventMachine (chat service)
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
# - a browser with WebSocket support
#
# Usage:
# ruby redis_pubsub_demo.rb
#
@b-mandelbrot
b-mandelbrot / Folder Preferences
Created May 8, 2011 01:10 — forked from chrisyour/Folder Preferences
Show hidden files and hidden folders (except .git) in your TextMate project drawer
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences.
# Instructions:
# Go to TextMate > Preferences...
# Click Advanced
# Select Folder References
# Replace the following:
# File Pattern
@b-mandelbrot
b-mandelbrot / Folder Preferences
Created May 8, 2011 01:10 — forked from chrisyour/Folder Preferences
Show hidden files and hidden folders (except .git) in your TextMate project drawer
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences.
# Instructions:
# Go to TextMate > Preferences...
# Click Advanced
# Select Folder References
# Replace the following:
# File Pattern
#--
# Copyright (C)2008 Ilya Grigorik
# You can redistribute this under the terms of the Ruby license
#
# Modifications by Vinicius B. Fuentes
#++
require 'rubygems'
require 'optparse'
require 'ruport'
def self.setup_rails_for_action_cache_options
::ActionController::Caching::Actions::ActionCacheFilter.class_eval do
def initialize(*actions, &block)
if [].respond_to?(:extract_options!)
@options = actions.extract_options!
@actions = actions.inject(@options.except(:cache_path)) do |hsh, action|
action.is_a?(Hash) ? hsh.merge(action) : hsh.merge(action => { :ttl => nil })
end
@options.slice!(:cache_path)
else