Skip to content

Instantly share code, notes, and snippets.

View jasonmclaren's full-sized avatar

Jason McLaren jasonmclaren

View GitHub Profile
@igrigorik
igrigorik / webapp.rb
Created November 13, 2010 21:28
Inspired by @JEG2's talk at Rubyconf... Any ruby object, as a webapp! 'Cause we can. :-)
require 'rubygems'
require 'rack'
class Object
def webapp
class << self
define_method :call do |env|
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?)
[200, {}, send(func, *attrs)]
end
@hexatridecimal
hexatridecimal / internet_secure.rb
Created October 12, 2011 17:11
Internet Secure gateway code for active_merchant
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class InternetSecureGateway < AuthorizeNetGateway
self.live_url = self.test_url = 'https://anet.internetsecure.com/process.cgi'
self.homepage_url = 'http://www.internetsecure.com/'
self.display_name = 'InternetSecure'
def test?
Base.gateway_mode == :test