Skip to content

Instantly share code, notes, and snippets.

View 197291's full-sized avatar
:octocat:

Yuriy Provotorov 197291

:octocat:
  • Taganrog
View GitHub Profile
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);
@197291
197291 / tsconfig.ts
Created May 29, 2019 09:55
Typescript configuration file
{
"compilerOptions": {
"outDir": "build/dist",
"module": "esnext",
"baseUrl": "./src",
"resolveJsonModule": true,
"noEmit": true,
"target": "es5",
"lib": [
"es6",
@197291
197291 / .prettierrc
Created May 29, 2019 09:56
Prettier configuration file
{
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"jsxSingleQuote": false,
"trailingComma": "none",
"bracketSpacing": true,
"jsxBracketSameLine": false,
@197291
197291 / tslint
Created May 29, 2019 09:57
Tslint configuration file
{
"extends": ["tslint-react"],
"rules": {
"align": [
true,
"parameters",
"statements"
],
"ban": false,
"class-name": true,
@197291
197291 / .editorconfig
Created May 29, 2019 09:58
Editorconfig
root = true
[*]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
type RequireOnlyOne<T, Keys extends keyof T = keyof T> =
Pick<T, Exclude<keyof T, Keys>>
& { [K in Keys]-?:
Required<Pick<T, K>>
& Partial<Record<Exclude<Keys, K>, undefined>>
}[Keys]
type RequireAtLeastOne<T, Keys extends keyof T = keyof T> =
Pick<T, Exclude<keyof T, Keys>>
& {
function isCryptSolution(crypt, solution) {
const map = {};
for(let m of solution) {
map[m[0]] = m[1];
}
for(let i in crypt) {
const line = crypt[i];
import * as React from 'react';
import { KeyCodeMap } from 'constants/core/key-code-map';
import { getComponentDisplayName } from 'helpers/common/get-component-display-name';
interface State {
selectedRowIndex: number;
mouseIndex: number;
scrollElement: any;
rowsLength: number;
export function logClass(target: Function) {
// Save link for original constructor
const original = target;
// function generate instance of class
function construct(constructor, args) {
const c: any = function () {
return constructor.apply(this, args);
}
c.prototype = constructor.prototype;
@197291
197291 / TSLInt-Prettier-CreateReactApp-TypeScript-setup.md
Created June 21, 2019 19:53 — forked from rimatla/TSLInt-Prettier-CreateReactApp-TypeScript-setup.md
Create React App + TypeScript Linting with TSLint and Prettier setup for on VSCode

Ps: The current setup was done on 01-04-19

Project Dependency Versions at the time 👇

  "react": "^16.7.0",
  "react-dom": "^16.7.0",
  "react-scripts": "2.1.3",
  "typescript": "^3.2.2"
  "tslint": "^5.12.0",
  "tslint-config-prettier": "^1.17.0",