Skip to content

Instantly share code, notes, and snippets.

// Be sure to first include the Google AJAX libraries script in your HTML.
// <script src="http://www.google.com/jsapi" type="text/javascript"></script>
// Wrap your plugin in a function to execute after jQuery has downloaded and
// loaded to your client.
function load_jquery_form_plugin() {
/*
* jQuery Form Plugin
* version: 2.24 (10-MAR-2009)
* @requires jQuery v1.2.2 or later
class Test::Unit::TestCase
def assert_did_not_send_email
if block_given?
msg = "One or more sent emails matched your criteria.\n"
emails = ::ActionMailer::Base.deliveries
matching_emails = emails.select {|email| yield email }
assert matching_emails.empty?, msg
else
msg = "Sent #{::ActionMailer::Base.deliveries.size} emails.\n"
@nbibler
nbibler / ClientController.rb
Created January 14, 2009 15:56
Using Remit with AmazonFPS
##
# This would be visited by the person ultimately paying for the service or
# product, sometimes referred to as your "end customer".
#
class ClientController < ApplicationController
##
# Generate and redirect the client to the single use payment pipeline, using
# the recipient token collected earlier.
#
module GUI
class Button
# bar.
end
end
def valid_request?
query = params.except('action', 'controller')
supplied_signature = query.delete('signature')
return false unless supplied_signature
query = query.sort_by { |k,v| k.downcase }
digest = OpenSSL::Digest::Digest.new('sha1')
hmac = OpenSSL::HMAC.digest(digest, AMAZON_SECRET_KEY, query.to_s)