Skip to content

Instantly share code, notes, and snippets.

starrhorne /
Created Jul 6, 2017
The `use errors::*` in mymodule causes an unused import warning
#![recursion_limit = "1024"]
extern crate error_chain;
mod errors {
use errors::*;
View gist:149bce4ae24548442334
" begin script to prevent pase over from replacing the default register
" contents
function! RestoreRegister()
let @" = s:restore_reg
return ''
function! s:Repl()
let s:restore_reg = @"
return "p@=RestoreRegister()\<cr>"
starrhorne / test.bash
Created Jun 21, 2013
This is how you generate a test exception from your local computer, when you're using the heroku addon. Be sure to replace the api key below with your real API key, as found on the project settings page :)
View test.bash
rake honeybadger:test HONEYBADGER_API_KEY=12345
starrhorne / honeybadger.rb
Created Jun 21, 2013
Sample honeybadger initializer for heroku
View honeybadger.rb
Honeybadger.configure do |config|
config.api_key = ENV['HONEYBADGER_API_KEY']
starrhorne / gist:5824347
Created Jun 20, 2013
How to send an error to HB manually
View gist:5824347
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
# This will only send the error if it doesn't match any of the exclusion rules
starrhorne / emails_controller.rb
Last active Dec 13, 2015
Example Incoming Email Receiver for a Rails Application
View emails_controller.rb
# app/controllers/emails_controller.rb
class EmailsController < ActionController::Base
def create
if EmailToSmsReceiver.receive(request)
render :json => { :status => 'ok' }
render :json => { :status => 'rejected' }, :status => 403
starrhorne / sample_email_receiver.rb
Last active Dec 13, 2015
Example of how to use the Incoming! gem.
View sample_email_receiver.rb
# First, you define an email receiver class
class EmailReceiver < Incoming::Strategies::CloudMailin
def receive(mail)
puts %(Got message from #{} with subject "#{mail.subject}")
# Then you feed it a Rack::Request object. And you're done.
req =
result = EmailReceiver.receive(req) # => Got message from with subject "hello world"
View gist:4520447
Honeybadger.configure do |config|
# Will send session["sensitive_key"] = "FILTERED" to Honeybadger
config.params_filters << "sensitive_key"
View gist:2520717
Received: by with SMTP id bq14csp20270vdc;
Sat, 28 Apr 2012 10:31:46 -0700 (PDT)
Received: by with SMTP id u75mr8769804wei.97.1335634305296;
Sat, 28 Apr 2012 10:31:45 -0700 (PDT)
Return-Path: <>
Received: from ( [])
by with SMTP id ei5si7755970wid.4.2012.;
Sat, 28 Apr 2012 10:31:45 -0700 (PDT)
Received-SPF: pass ( best guess record for domain of designates as permitted sender) client-ip=;