Skip to content

Instantly share code, notes, and snippets.

View scottatron's full-sized avatar

Scott Arthur scottatron

View GitHub Profile
@scottatron
scottatron / php_dalli_store.rb
Created October 11, 2012 03:14 — forked from watsonbox/php_dalli_store.rb
PHP Memcache Session Store Using Dalli
require 'action_dispatch/middleware/session/dalli_store'
# - PHP side is 5.3.6 configured with session.save_handler = memcache
# - Requires php-serialize gem for serialization: https://github.com/jqr/php-serialize
module ActionDispatch
module Session
class PhpDalliStore < ActionDispatch::Session::DalliStore
require 'php_serialize'
class PhpSerializingPoolDecorator < SimpleDelegator
@scottatron
scottatron / watchr script
Created July 14, 2011 11:29 — forked from markbates/watchr script
A Watchr script for rails, rspec, and cucumber
ENV["WATCHR"] = "1"
system 'clear'
def growl(message)
growlnotify = `which growlnotify`.chomp
title = "Watchr Test Results"
puts message
image = message.match(/\s0\s(errors|failures)/) ? "~/.watchr_images/passed.png" : "~/.watchr_images/failed.png"
options = "-w -n Watchr --image '#{File.expand_path(image)}' -m '#{strip_ansi(message)}' '#{title}'"
system %(#{growlnotify} #{options} &)