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
| // Install library before: | |
| // > npm install node-rest-client | |
| // | |
| // More information about rest client: https://www.npmjs.com/package/node-rest-client | |
| var Client = require('node-rest-client').Client; | |
| var client = new Client({ user: "YOUR SECRET API KEY GOES HERE" }); | |
| var args = { |
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
| ################################## | |
| config.php | |
| <?php | |
| $plans = array( | |
| 'basic' => array('cents' => 1000, 'price' => '10.00'), | |
| 'pro' => array('cents' => 2000, 'price' => '20.00'), | |
| ); |
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 gateway = new StripeGateway("test_sec_k_4c3323cae84d75924f366"); | |
| charge = gateway.CreateChargeObject() | |
| { | |
| Amount = 100, | |
| Currency = "USD", | |
| Description = "Test Charge", | |
| Card = "tok_4c3323cae84d75924f366s289943", // or CustomerId = "cus_xxxxx" | |
| Capture = true | |
| }; |
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
| white.createToken({ | |
| number: $('.card-number').val(), | |
| exp_month: $('.card-expiry-month').val(), | |
| exp_year: $('.card-expiry-year').val(), | |
| cvc: $('.card-cvc').val() | |
| }, whiteResponseHandler); |
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
| describe 'examples' do | |
| describe 'POST /customers/:customer_id/cards' do | |
| context 'when with card' do | |
| it 'adds card to customer' do | |
| post "/customers/#{customer[:id]}/cards", <<-JSON, headers | |
| { | |
| "card": { | |
| "number": "4242424242424242", | |
| "exp_year": 2020, | |
| "exp_month": 11, |
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
| include_recipe "apt" | |
| apt_repository 'precise-multiverse' do | |
| uri 'http://us.archive.ubuntu.com/ubuntu' | |
| distribution "precise" | |
| components ['multiverse'] | |
| deb_src true | |
| notifies :run, "execute[apt-get update]", :immediately | |
| 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
| class KoModel | |
| indexed_error_for: (property_name, index, nested_property = null) => | |
| ko.computed(=> | |
| if @errors() && @errors()[property_name] | |
| error = jQuery.grep @errors()[property_name], (item) -> item.index == index | |
| return '' unless error && error.length | |
| if nested_property | |
| @join_errors error[0].errors[nested_property] | |
| else | |
| @join_errors error[0].errors) |
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
| App.directive('tagIt', function ($timeout) { | |
| return { | |
| template: "<ul class='tagit'></ul>", | |
| replace: true, | |
| scope: { | |
| tags: "=", | |
| }, | |
| link: function(scope, element) { | |
| $(element).tagit({ | |
| afterTagAdded: function(event, ui) { |
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
| module CertoPay | |
| module ActiveRecord | |
| extend ActiveSupport::Concern | |
| module ClassMethods | |
| def validate_further(*args, &block) | |
| options = args.extract_options! | |
| options = options.dup | |
| options[:if] = Array.wrap(options[:if]) |
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
| describe "Чайник" do | |
| describe "Вода" do | |
| context "при температуре равной или выше 100 С" do | |
| before do | |
| kettle.water.stub(:temperature).and_return(100) | |
| end | |
| it "должна кипеть" do | |
| kettle.water.should be_boiling | |
| end | |
| end |