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 { text } from '@storybook/addon-knobs'; | |
| import { storiesOf } from '@storybook/react'; | |
| import HelloWorld from './HelloWorld'; | |
| const DECORATOR = renderStory => ( | |
| <React.Fragment>{renderStory()}</React.Fragment> | |
| ); |
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 LRUMap extends Map { | |
| constructor(maxSize = 1) { | |
| super(); | |
| this.maxSize = maxSize; | |
| this.insertionOrder = []; | |
| this.set = this.set.bind(this); | |
| } | |
| set(key, value) { |
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
| { | |
| "data": { | |
| "authStatus": "AUTHORIZED", | |
| "authMessage": null, | |
| "rescheduleDetail": { | |
| "rescheduleId": "35001186", | |
| "rescheduleType": "RESCHEDULE_FLIGHT_BASIC", | |
| "rescheduleStatus": "ACTIVE", | |
| "notReschedulableReason": null, | |
| "agentRescheduleStatusType": "INFO", |
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
| // Usage | |
| import React from 'react'; | |
| injectLogger(React.Component); | |
| // You can also make it specific to just a component | |
| class App extends React.Component {} | |
| injectLogger(App); | |
| // Injecting logger will add additional boolean param to setState. | |
| // Set this to true to perform setState logging |
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
| def occurrences(text1, text2): | |
| result = 0 | |
| unique_characters = [] | |
| # for every character in text1 | |
| for character in text1: | |
| # check whether or not the character has been encountered before | |
| if character not in unique_characters: | |
| # if not, add that character to the list | |
| unique_characters.append(character) | |
| # for every character in text2 |
NewerOlder