Skip to content

Instantly share code, notes, and snippets.

View theshaun's full-sized avatar
:shipit:

Shaun Walker theshaun

:shipit:
View GitHub Profile
@theshaun
theshaun / hooks_controller.rb
Created March 31, 2016 12:03 — forked from ryansch/hooks_controller.rb
Rails Controller for Chargify Webhooks with support for HMAC-SHA-256 signatures and all current possible events
class Chargify::HooksController < ApplicationController
protect_from_forgery :except => :dispatch_handler
before_filter :verify, :only => :dispatch_handler
EVENTS = %w[ test signup_success signup_failure renewal_success renewal_failure payment_success payment_failure billing_date_change subscription_state_change subscription_product_change subscription_card_update expiring_card customer_update component_allocation_change metered_usage upcoming_renewal_notice end_of_trial_notice statement_closed statement_settled upgrade_downgrade_success upgrade_downgrade_failure refund_success refund_failure expiration_date_change ].freeze
SHARED_KEY = 'Chargify Shared Key Here'
def dispatch_handler
event = params[:event]
<?php
// Who you want to recieve the emails from the form.
$sendto = 'andrewrichardgale@gmail.com';
// The subject you'll see in your inbox
$subject = 'A message from Syndicate site';
// Message for the user when he/she doesn't fill in the form correctly.
$errormessage = 'Looks like you are missing some info. Try again.';
@theshaun
theshaun / 0_reuse_code.js
Created September 28, 2013 12:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console