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
select c.name, count(u.name) as co from company c | |
join users u on c.id = u.company | |
where datediff(now(), u.join_date) >= 365 | |
and u.gender = 'male' group by c.name; |
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 | |
class Calculator | |
{ | |
/** | |
* Add multiple argument | |
* | |
* @return int | |
*/ |
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 | |
namespace App; | |
class Company extends Entity | |
{ | |
/** | |
* @var int | |
*/ |
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
import React from 'react' | |
import { render } from 'react-dom' | |
const App = () => <div className="somehting">App</div> | |
render( | |
<App />, | |
document.querySelector('#app') | |
) |
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
// 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 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 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 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 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 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; |
OlderNewer