Skip to content

Instantly share code, notes, and snippets.

Walter Smith wrs

Block or report user

Report or block wrs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:8c07f89649d928f4f45368eaed2d8d72
<Response>
<Dial>
<User>sip:12067079127@prod-pbx-pub.czops.net:5080</User>
</Dial>
</Response>
View phonemaintenance.xml
<?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/>
View sip-to-7101.xml
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial>
<Sip>sip:7101@sip-dev.czops.net</Sip>
</Dial>
</Response>
@wrs
wrs / capybara-firebug.rb
Created Feb 14, 2011
Install Firebug for Capybara
View capybara-firebug.rb
# 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 Dec 8, 2010
JSON-encoded error and redirect results for Devise controllers
View DeviseJsonAdapter.rb
# 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 / hamlcdata.rb
Created Jul 5, 2010
Haml+CDATA filter for Haml
View hamlcdata.rb
# 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'>
@wrs
wrs / app_config.rb
Created Jul 5, 2010
Simple Rails app configuration class
View app_config.rb
# 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:
#
You can’t perform that action at this time.