Skip to content

Instantly share code, notes, and snippets.

View brianr's full-sized avatar

Brian Rue brianr

View GitHub Profile
function ignoreRemoteUncaught(isUncaught, args, payload) {
try {
var filename = payload.data.body.trace.frames[0].filename;
if (isUncaught && !filename.match(/^https?:\/\/www\.mycompany\.com/)) {
// Ignore uncaught errors that are not from www.mycompany.com.
return true;
}
} catch (e) {
// Most likely there was no filename or the frame doesn't exist.
}
@brianr
brianr / deploy.rb
Created December 4, 2012 15:57 — forked from mertonium/deploy.rb
Capistrano task to notify Ratchet.io about deployment
# I am trying out Ratchet.io and I want to add their deployment notification to my
# normal capistrano deployment process. Here is my first working attempt.
# Add this task to your deploy.rb
task :notify_ratchetio, :roles => :app do
set :revision, `git log -n 1 --pretty=format:"%H"`
set :local_user, `whoami`
set :ratchetio_token, YOUR_ACCESS_TOKEN
rails_env = fetch(:rails_env, "production")
run "curl https://submit.ratchet.io/api/1/deploy/ -F access_token=#{ratchetio_token} -F environment=#{rails_env} -F revision=#{revision} -F local_username=#{local_user}", :once => true