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
| <div class="row" ng-if="game.data.state == 'waitingForPlayers'"> | |
| ... | |
| </div> | |
| <div class="row" ng-if="game.data.state == 'preQuestion'"> | |
| ... | |
| </div> | |
| <div class="row" ng-if="game.data.state == 'question'"> | |
| ... |
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
| $scope.$watch('game.data.state', function(newValue, oldValue) { | |
| switch(newValue) { | |
| case 'preQuestion': | |
| $scope.countdown = 5; | |
| $interval(function() { | |
| $scope.countdown--; | |
| },1000, $scope.countdown) | |
| .then(function() { |
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
| angular.module('kahootCloneApp') | |
| .service('Host', function (fbutil, Trivia) { | |
| var self = this, _so; | |
| self.init = function(PIN) { | |
| self.syncObject = fbutil.syncObject('games/' + PIN); | |
| _so = self.syncObject; | |
| return self.syncObject.$loaded(); | |
| }; |
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
| angular.module('kahootCloneApp') | |
| .service('Player', function (fbutil, _, $cookieStore) { | |
| // AngularJS will instantiate a singleton by calling "new" on this function | |
| var self = this, _so; | |
| self.getUniqId = function() { | |
| // generate a unique idenftifier for the player and save it in a cookie to allow refreshes | |
| if($cookieStore.get('playerId')) { | |
| return self._id = $cookieStore.get('playerId'); | |
| } else { |
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
| import boto3 | |
| client = boto3.client('route53') | |
| def add_cname_record(source, target): | |
| try: | |
| response = client.change_resource_record_sets( | |
| HostedZoneId='<hosted zone id>', | |
| ChangeBatch= { | |
| 'Comment': 'add %s -> %s' % (source, target), |
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
| 'use strict'; | |
| const expect = require('chai').expect | |
| , SomeLambda = require('./some-lambda-func') | |
| , MockContext = require('./mock-lambda-context'); | |
| describe('Some Lambda Func', function() { | |
| let ctx; | |
| before(function() { |
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
| 'use strict'; | |
| module.exports = function doSomething(e, ctx, cb) { | |
| if (e.someParam > 0) { | |
| ctx.succeed('Yay'); | |
| // we add the callback here to make it testable | |
| // we'll show in the next step how we make this DRY | |
| if (cb) cb(); | |
| } else { | |
| ctx.fail('Nay') |
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
| 'use strict'; | |
| const LambdaRunner = require('co-lambda-runner') | |
| , DB = require('./db'); | |
| function *main(e) { | |
| let id = e.params.id; | |
| return yield DB.get(id); | |
| } |
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
| 'use strict'; | |
| const co = require('co'); | |
| module.exports = function(lambda) { | |
| return function(e, ctx, cb) { | |
| co( | |
| function* () { | |
| let result = yield lambda(e, ctx); |
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
| ├── Dockerfile | |
| ├── infra | |
| │ └── webpack.config.js | |
| ├── package.json | |
| └── src | |
| ├── functions | |
| │ └── getRepositories | |
| │ ├── function.json | |
| │ ├── src | |
| │ │ └── index.js |