View main.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![recursion_limit = "1024"] | |
#[macro_use] | |
extern crate error_chain; | |
mod errors { | |
error_chain!{} | |
} | |
use errors::*; |
View gist:149bce4ae24548442334
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" begin script to prevent pase over from replacing the default register | |
" contents | |
function! RestoreRegister() | |
let @" = s:restore_reg | |
return '' | |
endfunction | |
function! s:Repl() | |
let s:restore_reg = @" | |
return "p@=RestoreRegister()\<cr>" |
View a.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a=1 |
View test.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rake honeybadger:test HONEYBADGER_API_KEY=12345 |
View honeybadger.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Honeybadger.configure do |config| | |
config.api_key = ENV['HONEYBADGER_API_KEY'] | |
end |
View gist:5824347
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
raise "some error" | |
rescue => e | |
# Use one of the two methods below. Not both :) | |
# Use this to ALWAYS send the error to honeybadger regardless of error class | |
Hoenybadger.notify(e) | |
# This will only send the error if it doesn't match any of the exclusion rules |
View emails_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/controllers/emails_controller.rb | |
class EmailsController < ActionController::Base | |
def create | |
if EmailToSmsReceiver.receive(request) | |
render :json => { :status => 'ok' } | |
else | |
render :json => { :status => 'rejected' }, :status => 403 | |
end | |
end | |
end |
View sample_email_receiver.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First, you define an email receiver class | |
class EmailReceiver < Incoming::Strategies::CloudMailin | |
def receive(mail) | |
puts %(Got message from #{mail.to.first} with subject "#{mail.subject}") | |
end | |
end | |
# Then you feed it a Rack::Request object. And you're done. | |
req = Rack::Request.new(env) | |
result = EmailReceiver.receive(req) # => Got message from whoever@wherever.com with subject "hello world" |
View gist:4520447
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Honeybadger.configure do |config| | |
# Will send session["sensitive_key"] = "FILTERED" to Honeybadger | |
config.params_filters << "sensitive_key" | |
end |
View gist:2520717
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Delivered-To: starr@chromahq.com | |
Received: by 10.52.174.78 with SMTP id bq14csp20270vdc; | |
Sat, 28 Apr 2012 10:31:46 -0700 (PDT) | |
Received: by 10.216.135.225 with SMTP id u75mr8769804wei.97.1335634305296; | |
Sat, 28 Apr 2012 10:31:45 -0700 (PDT) | |
Return-Path: <mandujano.david@yahoo.com> | |
Received: from nm7-vm0.bullet.mail.ird.yahoo.com (nm7-vm0.bullet.mail.ird.yahoo.com. [77.238.189.222]) | |
by mx.google.com with SMTP id ei5si7755970wid.4.2012.04.28.10.31.44; | |
Sat, 28 Apr 2012 10:31:45 -0700 (PDT) | |
Received-SPF: pass (google.com: best guess record for domain of mandujano.david@yahoo.com designates 77.238.189.222 as permitted sender) client-ip=77.238.189.222; |
NewerOlder