This file contains 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 TodoApp = React.createClass({ | |
getInitialState: function () { | |
return { | |
nowShowing: app.ALL_TODOS, | |
editing: null, | |
newTodo: '' | |
}; | |
}, | |
handleChange: function (event) { | |
this.setState({ |
This file contains 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
angular.module('todomvc') | |
// Angular injects four dependencies in the TodoCtrl function – $scope, $routeParams, $filter, and store; | |
.controller('TodoCtrl', function TodoCtrl($scope, $routeParams, $filter, store) { | |
'use strict'; | |
var todos = $scope.todos = store.todos; | |
$scope.newTodo = ''; | |
$scope.editedTodo = null; | |
// missing function code is omitted for brevity | |
}); |
This file contains 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
// an example from GitHub | |
angular.module('todomvc') | |
.controller('TodoCtrl', TodoCtrl); | |
function TodoCtrl(s, r, f, a) { | |
'use strict'; | |
var todos = s.todos = a.todos; | |
s.newTodo = ''; | |
s.editedTodo = null; | |
// missing function code is omitted for brevity |
This file contains 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
[“$scope”, “$routeParams”, “$filter”, “store”, function TodoCtrl(s, r, f, a) { //your code goes here }]; |
This file contains 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
<?php | |
// tests/AppBundle/Util/CalculatorTest.php | |
namespace Tests\AppBundle\Util; | |
use AppBundle\Util\Calculator; | |
class CalculatorTest extends \PHPUnit_Framework_TestCase | |
{ | |
public function testAdd() | |
{ |
This file contains 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
Rspec.describe Subscription do | |
describe ".create_and_request_confirmation(params)" do | |
it "creates an unconfirmed subscription with the given params" do | |
params = { email: "subscriber@somedomain.tld", start_on: "2015-01-31" } | |
Subscription.create_and_request_confirmation(params) | |
subscription = Subscription.first | |
expect(subscription.confirmed?).to eq(false) | |
expect(subscription.email).to eq(params[:email]) | |
expect(subscription.start_on).to eq(Date.new(2015, 1, 31)) |
This file contains 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 PaypalExpressCheckout < Spree::PaymentMethod | |
def auto_capture? | |
false | |
end | |
end |
This file contains 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
$ bundle exec rails g spree_paypal_express:install |
This file contains 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
$ bundle install |
This file contains 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
gem 'spree_paypal_express', github: 'spree-contrib/better_spree_paypal_express', branch: '3-0-stable' |
OlderNewer