Skip to content

Instantly share code, notes, and snippets.

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>
);
class LRUMap extends Map {
constructor(maxSize = 1) {
super();
this.maxSize = maxSize;
this.insertionOrder = [];
this.set = this.set.bind(this);
}
set(key, value) {
{
"data": {
"authStatus": "AUTHORIZED",
"authMessage": null,
"rescheduleDetail": {
"rescheduleId": "35001186",
"rescheduleType": "RESCHEDULE_FLIGHT_BASIC",
"rescheduleStatus": "ACTIVE",
"notReschedulableReason": null,
"agentRescheduleStatusType": "INFO",
@raibima
raibima / injectLogger.js
Last active July 12, 2018 00:58
Simple component setState logger
// 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
@raibima
raibima / tut.py
Last active August 29, 2015 14:17
Tutorial Eva
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