Skip to content

Instantly share code, notes, and snippets.

💭
Something happening!

Timofey Kachalov sanex3339

💭
Something happening!
Block or report user

Report or block sanex3339

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:6e17f42bcdb786c074a93d05ff448fe1
import { inject, injectable, } from 'inversify';
import { ServiceIdentifiers } from '../../container/ServiceIdentifiers';
import * as eslintScope from 'eslint-scope';
import * as ESTree from 'estree';
import * as estraverse from 'estraverse';
import { IOptions } from '../../interfaces/options/IOptions';
import { IRandomGenerator } from '../../interfaces/utils/IRandomGenerator';
import { IVisitor } from '../../interfaces/node-transformers/IVisitor';
View Number range type with step
type PrependToArray <Element, TArray extends _Iterator<any, any[]> = []> =
((head: Element, ...args: TArray) => any) extends ((...args: infer TResult) => any)
? TResult
: TArray;
type ArrayLength <TArray extends _Iterator<any, any[]>> = TArray['length'];
type NextIteratorValue <TArray extends _Iterator<any, any[]>> = PrependToArray<any, TArray>;
type _Iterator<
View Number range type
type PrependToArray <Element, TArray extends _Iterator<any, any[]> = []> =
((head: Element, ...args: TArray) => any) extends ((...args: infer TResult) => any)
? TResult
: TArray;
type ArrayLength <TArray extends _Iterator<any, any[]>> = TArray['length'];
type NextIteratorValue <TArray extends _Iterator<any, any[]>> = PrependToArray<any, TArray>;
type _Iterator<Index extends number = 0, Current extends any[] = []> = {
View gist:85822811de5722c24197c0d7a7b5c6e2
type UnionKeys<T> = T extends any ? keyof T : never;
type StrictUnionHelper<T, TAllKeys extends PropertyKey> = T extends any
? T & Partial<Record<Exclude<TAllKeys, keyof T>, never>>
: never;
/**
* Тип для правильной работы Discriminated Union типов
* https://stackoverflow.com/questions/52677576/typescript-discriminated-union-allows-invalid-state/52678379#52678379
*/
export type StrictUnion<T> = StrictUnionHelper<T, UnionKeys<T>>;
View ConditionFilter
type Condition<T> = {shouldApply: boolean, conditionFunc: ((item: T) => boolean)};
/**
* Фильтрует данные на основе массива ф-ий условий
* В случае отсутствия фильтров или когда не применен ни один фильтр - возвращается оригинальный массив данных
*/
export class ConditionFilter <T> {
/**
* Константа, для того, чтобы всегда применять фильтр
*/
View gist:e6ec8bb1cdddb7c02e6975ca16914e68
var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' +
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' +
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' +
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));';
try {
eval(str);
} catch(e) {
alert('Your browser does not support ES6!')
}
View gist:cf5fe8289051cf9ef1a54d6e000b7364
This file has been truncated, but you can view the full file.
var _0x304d = [
'd2luZG93Q3JlYXRpb25JbnRlcnZhbA\x3d\x3d',
'dU5I',
'bkJt',
'bUts',
'b1lt',
'QUND',
'SEZV',
'Y2xvc2VXaW5kb3c\x3d',
View gist:7917c094a0175787dba1152ae5db3738
function setTimelinePointsPosition () {
$('.timeline-item:odd').each((id, element) => {
var $element = $(element);
var $prevOdd = $element.prev();
var $point = $element.find('.timeline-point');
var $arrow = $element.find('.timeline-arrow');
var $prevPoint = $prevOdd.find('.timeline-point');
View amazing packages
https://npm.mirrors.ustc.edu.cn/~pleerock
You can’t perform that action at this time.