Skip to content

Instantly share code, notes, and snippets.

View sanex3339's full-sized avatar
💭
Something happening!

Timofey Kachalov sanex3339

💭
Something happening!
View GitHub Profile
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>>;
*{
box-shadow:0 0 0 2in#b5e0ba, 0 0 0 5in#5d3a3a;
}
type Condition<T> = {shouldApply: boolean, conditionFunc: ((item: T) => boolean)};
/**
* Фильтрует данные на основе массива ф-ий условий
* В случае отсутствия фильтров или когда не применен ни один фильтр - возвращается оригинальный массив данных
*/
export class ConditionFilter <T> {
/**
* Константа, для того, чтобы всегда применять фильтр
*/
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!')
}
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',
'NHw1fDN8MXwwfDZ8N3wy',
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');
https://npm.mirrors.ustc.edu.cn/~pleerock
This file has been truncated, but you can view the full file.
var _0x5a81 = ['\x5a\x78\x55\x64\x56\x73\x4f\x7a\x77\x37\x73\x2b\x42\x56\x50\x44\x6b\x32\x34\x45', '\x77\x35\x70\x4a\x77\x37\x6a\x44\x76\x63\x4f\x41\x5a\x56\x58\x43\x70\x38\x4f\x4a\x54\x67\x3d\x3d', '\x47\x33\x4a\x41\x77\x72\x31\x45', '\x77\x6f\x6e\x44\x67\x56\x4e\x68\x77\x34\x6b\x3d', '\x5a\x63\x4b\x6b\x77\x6f\x4a\x64\x45\x51\x3d\x3d', '\x4e\x4d\x4f\x77\x77\x71\x66\x43\x6a\x7a\x45\x6e\x42\x43\x66\x43\x6c\x56\x45\x4b\x77\x72\x64\x69\x54\x51\x3d\x3d', '\x77\x72\x50\x43\x70\x73\x4f\x65\x54\x73\x4f\x55\x58\x4d\x4b\x49\x77\x6f\x72\x44\x6b\x69\x44\x44\x70\x68\x6b\x3d', '\x55\x38\x4b\x5a\x77\x72\x42\x35\x49\x4d\x4b\x58\x77\x70\x50\x44\x68\x30\x73\x57\x77\x36\x6c\x34\x77\x6f\x44\x44\x69\x78\x59\x47\x57\x67\x3d\x3d', '\x77\x70\x7a\x43\x6c\x38\x4b\x36\x65\x63\x4b\x41\x77\x35\x7a\x44\x72\x48\x58\x44\x6d\x73\x4b\x4f\x77\x6f\x73\x36\x54\x4d\x4b\x32\x4b\x46\x7a\x44\x6c\x41\x3d\x3d', '\x5a\x63\x4b\x36\x77\x70\x5a\x44\x48\x4d\x4b\x4b\x77\x71\x44\x44\x73\x57\x41\x73', '\x77\x70\x78\x69\x77\x71\x35\x79\x77\x35\x6f\x3d', '\x53
@sanex3339
sanex3339 / jscrush-compress-pseudo.js
Created April 23, 2016 10:42 — forked from nikhilm/jscrush-compress-pseudo.js
JSCrush 'reverse engineering'
segmentLengthBound = ... // B, originally set to s.length/2
counter = {} // o
bestSavings = 0 // M
maxRepetitions = 0 // N
bestSegment = 0 // e
longestSegmentLength = 0 // Z
segmentLength = 0 // t
while (segmentLength <= segmentLengthBound) {
start = 1;
/**
* @param destination
* @param sources
* @returns {any}
* @constructor
*/
export function DeepExtend (destination: any, ...sources: any[]): any {
let isObject: Function = (object: any) => {
return typeof object === 'object' && object !== null;
};