Skip to content

Instantly share code, notes, and snippets.

View melikhov-dev's full-sized avatar

Andrey Melikhov melikhov-dev

View GitHub Profile
const http2 = require('http2');
const fs = require('fs');
const url = require('url');
const path = require('path');
const options = {
key: fs.readFileSync('key.pem'),
cert: fs.readFileSync('cert.pem')
};
const mimeType = {
'.ico': 'image/x-icon',
// ES6 9.2.3.2 Function.prototype.bind(thisArg , ...args)
function FunctionBind(this_arg) { // Length is 1.
if (!IS_CALLABLE(this)) throw MakeTypeError(kFunctionBind);
var boundFunction = function () {
// Poison .arguments and .caller, but is otherwise not detectable.
"use strict";
// This function must not use any object literals (Object, Array, RegExp),
// since the literals-array is being used to store the bound data.
if (!IS_UNDEFINED(new.target)) {
return %NewObjectFromBound(boundFunction);
@melikhov-dev
melikhov-dev / utils.js
Created November 17, 2016 11:30
пример
createCommand: function(name, runner) {
var commandTimeout = ref(settings, 'config.indexer.' + name + '.timeout');
return new Command({
name: name,
runner: runner,
url: baseAddress,
prepare: prepares.indexer,
ssl: sslOptions,
timeout: commandTimeout || backendTimeout,
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Admin controller:
*
* @author
* @package
* @version
*/
class Controller_Admin_Statistic extends Controller_Admin_Abstract