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
root = true | |
[*] | |
end_of_line = lf | |
trim_trailing_whitespace = true | |
insert_final_newline = true | |
indent_style = space | |
indent_size = 2 |
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
{ | |
"extends": ["tslint-react"], | |
"rules": { | |
"align": [ | |
true, | |
"parameters", | |
"statements" | |
], | |
"ban": false, | |
"class-name": true, |
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
{ | |
"printWidth": 100, | |
"tabWidth": 2, | |
"useTabs": false, | |
"semi": true, | |
"singleQuote": true, | |
"jsxSingleQuote": false, | |
"trailingComma": "none", | |
"bracketSpacing": true, | |
"jsxBracketSameLine": false, |
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
{ | |
"compilerOptions": { | |
"outDir": "build/dist", | |
"module": "esnext", | |
"baseUrl": "./src", | |
"resolveJsonModule": true, | |
"noEmit": true, | |
"target": "es5", | |
"lib": [ | |
"es6", |
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
var lengthOfLongestSubstring = function(s) { | |
let start = 0, maxLen = 0; | |
const map = new Map(); | |
for(let i = 0; i < s.length; i++) { | |
const ch = s[i]; | |
if(map.get(ch) >= start) start = map.get(ch) + 1; | |
map.set(ch, i); | |
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
/** | |
* Definition for singly-linked list. | |
* function ListNode(val) { | |
* this.val = val; | |
* this.next = null; | |
* } | |
*/ | |
/** | |
* @param {ListNode} l1 | |
* @param {ListNode} l2 |
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, { ChangeEvent } from 'react'; | |
import cx from 'classnames'; | |
import uuid from 'uuid'; | |
import photoIcon from 'Common/assets/photo.svg'; | |
import './index.css'; | |
export interface IProps { | |
setImgUrl(img: { | |
id: string; |
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
let brackets = { | |
"[": "]", | |
"{": "}", | |
"(": ")", | |
"<": ">" | |
} | |
function correctBrackets (str) { | |
const vals = Object.keys(brackets).map(key => brackets[key]); | |
const keys = Object.keys(brackets); |
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 Node(value) { | |
this.data = value; | |
this.previous = null; | |
this.next = null; | |
} | |
function DoublyList() { | |
this._length = 0; | |
this.head = null; | |
this.tail = null; | |
} |
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
export const checkChangesDidUpdate = (prevProps: any, prevState: any, curProps: any, curState: any) => { | |
(Object as any).entries(curProps).forEach(([key, val]) => | |
prevProps[key] !== val && console.log(`Prop '${key}' from ${prevProps[key]} to ${curProps[key]} changed`) | |
); | |
(Object as any).entries(curState).forEach(([key, val]) => | |
prevState[key] !== val && console.log(`State '${key}' from ${prevState} to ${curState} changed`) | |
); | |
}; |