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
| {"status":402,"error":{"status":"Payment Required","category_code":"card-declined","status_code":"402","category_type":"banking","request_id":"OHMa0f08dee188711e2b2ae026ba7d31e6f","description":"Processor did not accept this card. Your request id is OHMa0f08dee188711e2b2ae026ba7d31e6f."}} |
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
| 1.9.2p290 :026 > @hold = Balanced::Hold.find :first | |
| => #<Balanced::Hold:0x000001030cf6f8 @attributes={"account"=>#<Balanced::Account:0x00000102f809c8 @attributes={"holds_uri"=>"/v1/marketplaces/TEST-MP4Z4RaRDF6TWqeupiVUSu8m/accounts/AC5xQY0AdN6Ex8i7QOIsbPZQ/holds", "name"=>"New Buyer", "roles"=>["buyer"], "created_at"=>"2012-07-06T19:28:06.379052Z", "uri"=>"/v1/marketplaces/TEST-MP4Z4RaRDF6TWqeupiVUSu8m/accounts/AC5xQY0AdN6Ex8i7QOIsbPZQ", "bank_accounts_uri"=>"/v1/marketplaces/TEST-MP4Z4RaRDF6TWqeupiVUSu8m/accounts/AC5xQY0AdN6Ex8i7QOIsbPZQ/bank_accounts", "refunds_uri"=>"/v1/marketplaces/TEST-MP4Z4RaRDF6TWqeupiVUSu8m/accounts/AC5xQY0AdN6Ex8i7QOIsbPZQ/refunds", "meta"=>{}, "debits_uri"=>"/v1/marketplaces/TEST-MP4Z4RaRDF6TWqeupiVUSu8m/accounts/AC5xQY0AdN6Ex8i7QOIsbPZQ/debits", "transactions_uri"=>"/v1/marketplaces/TEST-MP4Z4RaRDF6TWqeupiVUSu8m/accounts/AC5xQY0AdN6Ex8i7QOIsbPZQ/transactions", "email_address"=>"[email protected]", "id"=>"AC5xQY0AdN6Ex8i7QOIsbPZQ", "credits_uri"=>"/v1/marketpl |
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
| class Array | |
| def max_subarray_last_index | |
| max_sum = new_maxium = last_index = 0 | |
| each_with_index do |value, i| | |
| new_maxium = [new_maxium + value, 0].max | |
| # update everything if we found a truly new maximum =) | |
| max_sum, last_index = new_maxium, i if max_sum < new_maxium | |
| 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
| crickets: "hears crickets chirping" | |
| drama: "https://123.campfirenow.com/images/drama.jpg" | |
| greatjob: "https://123.campfirenow.com/images/greatjob.png" | |
| live: "is DOING IT LIVE" | |
| nyan: "https://123.campfirenow.com/images/nyan.gif" | |
| ohmy: "raises an eyebrow :smirk:" | |
| pushit: "https://123.campfirenow.com/images/pushit.gif" | |
| rimshot: "plays a rimshot" | |
| secret: "found a secret area :key:" | |
| tada: "plays a fanfare :flags:" |
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
| # a typical controller spec | |
| require 'spec_helper' | |
| describe PaymentsController do | |
| # A typical model mock object (with memoization ftw): | |
| def mock_customer_user(stubs={}) | |
| @mock_customer_user ||= mock_model(CustomerUser, stubs).as_null_object | |
| 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
| require 'spec_helper' | |
| describe YourClass do | |
| describe "some functionality that depends on YourClass::your_method" do | |
| # YourClass.stub(:your_method).and_return(true) is equivalent to: | |
| YourClass.stub(:your_method) { true } | |
| end | |
| 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
| var SQAPP = {}; | |
| SQAPP.Cat = function ( name ) { | |
| this.name = name; | |
| } | |
| SQAPP.Cat.prototype.meow = function () { | |
| alert(this.name + " says meow!"); | |
| } |
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
| # Allow RSpec assertions over the elements of a collection. For example: | |
| # | |
| # collection.should all_be > 0 | |
| # | |
| # will specify that each element of the collection should be greater | |
| # than zero. Each element of the collection that fails the test will | |
| # be reported in the error message. | |
| # | |
| # Examples: | |
| # [1,1,1].should all_be eq(1) |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Site</title> | |
| </head> | |
| <body class="app"> | |
| <%= render :partial => 'layouts/flashes' %> | |
| <%= yield %> | |
| </body> | |
| </html> |
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
| Then table "business_services" should look like: | |
| | field 1 | field 2 | field 3 | | |
| | x | y | z | | |
| | a | b | c | |