����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����403WebShell
403Webshell
Server IP : 74.208.127.88  /  Your IP : 216.73.216.186
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux ubuntu 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64
User : www-data ( 33)
PHP Version : 7.4.3-4ubuntu2.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/self/root/var/www/html/admin/assets/plugins/moment/tasks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/var/www/html/admin/assets/plugins/moment/tasks/history.js
var https = require("https"),
    zlib = require('zlib'),
    path = require('path'),
    fs = require('fs');

var count = 0;
var resolved = 0;

var outputs = [];

var done;

function check() {
    if (resolved === count) {
        normalize();
        display();
    }
}

function makeBar(length) {
    var i = '';
    while (i.length < length) {
        i += '=';
    }
    return i;
}

function normalize() {
    var i, 
        max = 0,
        max2 = 0;
    for (i = 0; i < count; i ++) {
        max = Math.max(max, outputs[i].gzip);
        max2 = Math.max(max2, outputs[i].original);
    }
    for (i = 0; i < count; i ++) {
        outputs[i].bargraph = makeBar((outputs[i].gzip / max) * 80);
        outputs[i].bargraph2 = makeBar((outputs[i].original / max2) * 80);
    }
}

function display() {
    var i;
    for (i = 0; i < count; i ++) {
        console.log(outputs[i].version + ' ' + outputs[i].gzip + ' ' + outputs[i].original);
        console.log('gzip ' + outputs[i].bargraph);
        console.log('orig ' + outputs[i].bargraph2);
    }
    done();
}

function getSizeAtVersion(version, path) {
    var data = '',
        op = {},

        req = https.request({
        host: 'raw.github.com',
        port: 443,
        path: '/timrwood/moment/' + version + path
    }, function (res) {
        res.setEncoding('utf8');
        res.on('data', function (chunk) {
            data += chunk;
        });
        res.on('end', function (e) {
            zlib.gzip(data, function (error, result) {
                op.version = version;
                op.gzip = result.length;
                op.original = data.length;
                resolved ++;
                check();
            });
        });
    });

    req.on('error', function (e) {
        console.log('problem with request: ' + e.message);
    });
    req.end();
    count++;
    outputs.push(op);
}

function getRemote() {
    var old_versions = '1.0.1 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.4.0'.split(' '),
        new_versions = '1.5.0 1.5.1 1.6.0 1.6.1 1.7.0 1.7.1'.split(' '),
        i;

    for (i = 0; i < old_versions.length; i++) {
        getSizeAtVersion(old_versions[i], '/moment.min.js');
    }
    for (i = 0; i < new_versions.length; i++) {
        getSizeAtVersion(new_versions[i], '/min/moment.min.js');
    }
}

function getLocal() {
    count ++;
    var op = {};
    outputs.push(op);
    fs.readFile(path.normalize(__dirname + '/../min/moment.min.js'), 'utf8', function (err, data) {
        if (err) {
            throw err;
        }
        zlib.gzip(data, function (error, result) {
            op.version = '.next';
            op.gzip = result.length;
            op.original = data.length;
            resolved ++;
            check();
        });
    });
}



module.exports = function (grunt) {
    grunt.registerTask('history', 'Check the codebase filesize over different releases.', function () {
        done = this.async();
        getRemote();
        getLocal();
    });
};

Youez - 2016 - github.com/yon3zu
LinuXploit