apt-get install nginx php-fpm
server {
server_name www.site.com site.com;
listen 80;
port_in_redirect off;
root /var/www/site/public; <----ВНИМАНИЕ НА ЭТУ СТРОКУ, PUBLIC ОБЯЗАТЕЛЕН
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
# Cache static files for as long as possible
location ~*.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|cur)$ {
expires max;
log_not_found off;
access_log off;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Чем вас не устраивает обычная вёрстка?смысл в :
list[0]
. Math.max.apply(null, list)
Math.max(...list)
Работает все ок...
function max(data, key = n => n) {
const getVal = key instanceof Function ? key : n => n[key];
let result = void 0;
for (const n of data) {
const val = getVal(n);
result = result && result[1] > val ? result : [ n, val ];
}
return result && result[0];
}
max([ 12, 9, -47, 83, 22 ]) // 83
max('240815', Number) // '8'
max(document.images, 'width') // не знаю, что выдаст вам, сами посмотрите
max((function*() {
yield 'aaa';
yield 'b';
yield 'cccc';
yield 'ddd';
})(), n => n.length) // 'cccc'
К кому можно обратиться, кто выполняет эти роли ?!
var fs = require('fs')
, request = require('request');
request.get('http://fs.moviestape.net/video/1c4ed0ac8b7d5b4de6c5d58e2ea31a63/serials/Narcos/s01/Narcos.S01E01.mp4')
.on('error', function(err) {
console.error(err);
})
.on('response', function(res) {
console.log(res.statusCode);
console.log(res.headers['content-type']);
})
.pipe(fs.createWriteStream('Narcos.S01E01.mp4'))
.on('finish', function() {
console.log('OK');
});