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
var StringExpressionParser = function () {
this.operators = [
'+', '-', '*', '/', '^'
];
this.priorities = [
['*', '/'],
['+', '-']
];
};
https://maxfarseer.gitbooks.io/redux-course-ru/content/
@sanex3339
sanex3339 / gist:78fba42ee9597e605c93a744048741e8
Created April 1, 2016 14:30
Deep Extend underscore typescrpit
import * as _ from "underscore";
/**
* @param destination
* @param sources
* @returns {any}
* @constructor
*/
export function DeepExtend (destination: any, ...sources: any[]): any {
var parentRE: RegExp = new RegExp('#{\s*?_\s*?}');
/**
* @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;
};
export function ArraySortBy <T> (array: T[], getProperty: (value: T) => any): T[] {
return array.sort((a, b) => {
let aValue: any = getProperty(a),
bValue: any = getProperty(b);
if (aValue === undefined || bValue === undefined) {
return 0;
}
return (aValue > bValue ) ? 1 : ((bValue > aValue) ? -1 : 0);
@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;
https://npm.mirrors.ustc.edu.cn/~pleerock
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');
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',
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!')
}