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
| // Load modules. | |
| var passport = require('passport-strategy') | |
| , url = require('url') | |
| , util = require('util') | |
| , utils = require('./utils') | |
| , OAuth2 = require('oauth').OAuth2 | |
| , NullStateStore = require('./state/null') | |
| , SessionStateStore = require('./state/session') | |
| , AuthorizationError = require('./errors/authorizationerror') | |
| , TokenError = require('./errors/tokenerror') |
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
| body { | |
| margin: 0 auto 2rem; | |
| width: 600px; | |
| padding: 0; | |
| font-family: sans-serif; | |
| font-size: 16px; | |
| } | |
| .contact { | |
| border: 1px solid #ccc; |
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
| body { | |
| width: 600px; | |
| margin: 0 auto; | |
| padding: 0 2rem; | |
| font-family: sans-serif; | |
| font-size: 16px; | |
| } | |
| .todo { | |
| overflow: hidden; |
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
| self.addEventListener('sync', function(event) { | |
| if (event.tag == 'outbox') { | |
| // sendEverythingInTheOutbox should return Promise | |
| event.waitUntil(sendEverythingInTheOutbox()); | |
| } | |
| }); |
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
| function offerBgSync(err) { | |
| if (!window.navigator.onLine) { | |
| showBgSyncOffer(); | |
| listen.approveBgSync((event) => { | |
| askNotificationPermission() | |
| .then(queueRecipeLoad) | |
| .then(getServiceWorkerRegistration) | |
| .then(registerBgSync) | |
| .then(showBgSyncApproval); |
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
| const pluck = key => list => list[key]; | |
| const pluckX = pluck('x'); | |
| const pluckY = pluck('y'); | |
| const groupXAndY = list => { | |
| return { | |
| listX: list.map(pluckX), | |
| listY: list.map(pluckY), | |
| }; |
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 React from 'react'; | |
| import { shallow } from 'enzyme'; | |
| import TodoForm from './TodoForm'; | |
| it('should not call onSubmit callback when the input less than 5 characters', () => { | |
| const onSubmitSpy = jest.fn(); | |
| const preventDefaultSpy = jest.fn(); | |
| const resetSpy = jest.fn(); | |
| const subject = shallow( |
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
| // src/components/TodoList.spec.js | |
| import React from 'react'; | |
| import { shallow } from 'enzyme'; | |
| import TodoList from './TodoList'; | |
| // 1. Menampilkan header / judul yang benar. yaitu: My Todo List | |
| it('shows correct header', () => { | |
| const subject = shallow(<TodoList entries={[]} />); | |
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 React from 'react' | |
| import { render } from 'react-dom' | |
| const App = () => <div className="somehting">App</div> | |
| render( | |
| <App />, | |
| document.querySelector('#app') | |
| ) |
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
| <?php | |
| namespace App; | |
| class Company extends Entity | |
| { | |
| /** | |
| * @var int | |
| */ |