Skip to content

Instantly share code, notes, and snippets.

View trusche's full-sized avatar

Thilo Rusche trusche

View GitHub Profile
namespace :postmark do
desc "Sync bounces from postmark to users"
task :sync_bounces => [:environment] do
client = Postmark::ApiClient.new("your api key here")
suppressions = client.dump_suppressions("outbound", type: "bounces")
suppressions.each do |suppression|
if user = User.find_by(email: suppression[:email_address])
user.update(
def create
self.resource = resource_class.send_confirmation_instructions(resource_params)
# ...
rescue Postmark::Error
flash[:error] = "We're sorry, there was an issue sending the confirmation email. Please contact our support team at [email protected] for help."
redirect_to users_welcome_path
end
class PostmarkController < ApplicationController
skip_before_action :verify_authenticity_token
http_basic_authenticate_with name: "foo", password: "not our real password, doh."
def create
payload = JSON.parse(request.body.read)
case payload["RecordType"]
when "Bounce"
if user = User.find_by(email: payload["Email"])
class AccountsAddFeatures < ActiveRecord::Migration[6.0]
def change
add_column :accounts, :features, :citext, array: true, null: false, default: []
add_column :users, :features, :citext, array: true, null: false, default: []
end
end
@trusche
trusche / statsd.md
Last active May 2, 2019 13:05
Installing graphite and statsd on OS X Yosemite

Prerequisites

  • Homebrew
  • Python 2.7
  • Git

Graphite

Install Cairo

There's an issue with cairo 14.x that results in the axis fonts on the graphs being HUUUUUGE. Downgrading to 12.6 helps:

### Keybase proof
I hereby claim:
* I am trusche on github.
* I am thilo (https://keybase.io/thilo) on keybase.
* I have a public key whose fingerprint is 3228 2B2F D4B7 4B16 A808 510E 67E8 34A6 0455 3698
To claim this, I am signing this object:
@trusche
trusche / css
Last active August 29, 2015 14:01
Corps Albertina - Berliner Wingolf
#events .nested-fields {
margin-bottom: 1em;
}
#events h5 {
margin-top: 0;
margin-bottom: 0;
font-weight: normal;
}
#events h5 i {
color: #CCC;