Skip to content

Instantly share code, notes, and snippets.

View wrs's full-sized avatar

Walter Smith wrs

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say></Say>
<Pause length="2"/>
<Say>
Thank you for calling care zone. If this is a medical emergency, hang up and call 9 1 1.
Our phone system is down temporarily for maintenance. Please try again in a few minutes.
We are sorry for the inconvenience.
</Say>
<Hangup/>
<Response>
<Dial>
<User>sip:[email protected]:5080</User>
</Dial>
</Response>
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial>
<Sip>sip:[email protected]</Sip>
</Dial>
</Response>
@wrs
wrs / capybara-firebug.rb
Created February 14, 2011 01:00
Install Firebug for Capybara
# UPDATE: You are probably better off using jfirebaugh's gem.
# See https://github.com/jfirebaugh/capybara-firebug
# Set up Capybara to install Firebug in the default session.
#
# Download firebug.xpi from http://getfirebug.com/downloads and check it in.
# Set FirebugFix::ORIGINAL_XPI_PATH to its location.
require 'selenium/webdriver'
@wrs
wrs / DeviseJsonAdapter.rb
Created December 8, 2010 18:02
JSON-encoded error and redirect results for Devise controllers
# JSON-encoded error and redirect results for Devise controllers.
# This overrides an internal method of Devise, so be careful when updating Devise!
#
# Usage:
#
# class Users::RegistrationsController < Devise::RegistrationsController
# include DeviseJsonAdapter
# end
#
# devise_for :users, :controllers => { :registrations => "users/registrations" }
@wrs
wrs / app_config.rb
Created July 5, 2010 21:54
Simple Rails app configuration class
# Simple configuration system
#
# The configuration is represented as a tree of keys. Examples:
#
# AppConfig['key']
# AppConfig['key','subkey']
# AppConfig['key.subkey']
#
# An optional default value can be specified:
#
@wrs
wrs / hamlcdata.rb
Created July 5, 2010 21:32
Haml+CDATA filter for Haml
# Generates HAML surrounded by CDATA tags.
# Useful for JavaScript templates (e.g., jquery.mustache or jQote).
#
# Example:
# %script#foo_tmpl(type="text/x-mustache")
# :hamlcdata
# %p This is HAML enclosed in CDATA.
# %p You can use it for templating {{stuff}}.
# =>
# <script id='foo_tmpl' type='text/x-mustache'>