This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def paypal_ipn | |
notify = Paypal::Notification.new(request.raw_post) | |
donations = Donation.find_all_from_paypal(notify.params) | |
user = donations.first.user | |
purchase = Purchase.new(:donations => donations, :user => user) | |
purchase.paypal_transaction_id = notify.transaction_id | |
if notify.acknowledge | |
if notify.complete? and purchase.total_amount == BigDecimal.new(notify.amount.to_s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> require 'vlad' | |
=> true | |
>> Vlad.load({ :app => :mongrel, | |
?> :config => 'config/deploy.rb', | |
?> :core => :core, | |
?> :scm => :git, | |
?> :web => :nginx }) | |
MissingSourceFile: no such file to load -- vlad/mongrel | |
from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# price | |
# quantity | |
class LineItem < ActiveRecord::Base | |
belongs_to :product | |
belongs_to :order | |
def calculate_cost | |
price * quantity * discount_multiplier | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# bash completion support for core Git. | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]> | |
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# The contained completion routines provide support for completing: | |
# | |
# *) local and remote branch names |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# bash completion support for core Git. | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]> | |
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# The contained completion routines provide support for completing: | |
# | |
# *) local and remote branch names |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pp' | |
# add color with wirble. See http://pablotron.org/software/wirble/ | |
begin | |
require 'wirble' | |
Wirble.init | |
Wirble.colorize | |
rescue LoadError => err | |
warn "Couldn't load Wirble: #{err}" | |
end |
OlderNewer