$ docker run --rm php:7.2 php -m
[PHP Modules]
Core
ctype
curl
date
dom
fileinfo
filter
ftp
hash
iconv
json
libxml
mbstring
mysqlnd
openssl
pcre
PDO
pdo_sqlite
Phar
posix
readline
Reflection
session
SimpleXML
sodium
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zlib
[Zend Modules]
console.log(/https?:\/\/.*?/.exec('https://github.com'));
// ["https://", index: 0, input: "https://github.com", groups: undefined]
console.log(/https?:\/\/.*?/.exec('github.com'));
// null
let getData = (attempts) => {
if (attempts < 1) {
return Promise.reject('Max attempts reached.');
}
return new Promise((res, rej) => {
console.log('Attempt to fetch data: #' + attempts);
attempts == 1
? setTimeout(() => {res('This is my data')}, 3000)
: setTimeout(() => {rej('Shit happens')}, 3000);
}).catch(e => {
return getData(attempts - 1);
})
}
getData(3)
.then(r => console.info('=> ' + r))
.catch(e => console.error(e));
docker system prune -a
. Если не помогает, то чистим ручками.docker image ls
. И смотрим какие образы нужны, а какие не нужны.docker image rm ...
.Remove all unused containers, networks, images (both dangling and unreferenced), and optionally, volumes..
setlocale(LC_ALL,'en_US.UTF-8');
$s = 'K:/server/OSPanel/domains/kkk12.com/Kafedra/пример_книги_Посібник_експлуатації_1.1.pdf';
$parts = [
\str_replace('K:/server/OSPanel/domains/kkk12.com', '.', \pathinfo($s, PATHINFO_DIRNAME)),
\pathinfo($s, PATHINFO_FILENAME) . '.png', // fix by @zkelo
];
var_dump(\implode(DIRECTORY_SEPARATOR, $parts));
# forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
php_admin_value[error_log] = /proc/self/fd/2
<?php
$payload = \file_get_contents('https://api.deezer.com/search?q=LUCKY%20LUKE%20HYPNOTIZING');
$payload = \json_decode($payload, true, 512, JSON_THROW_ON_ERROR);
$media = $payload['data'][0]['album']['cover_medium'] ?? 'media_not_found.jpg';
const mazeCopy = JSON.parse(JSON.stringify(maze));
method adds a node to the end of the list of children of a specified parent node. If the given child is a reference to an existing node in the document, appendChild() moves it from its current position to the new position
const els = document.querySelectorAll('#mobilemenu li');
// Array.from().forEach() можно заменить на цикл for
// for (el of Array.prototype.slice.call(els) ) { ... }
Array
.from(els)
.forEach(el => { el.childElementCount === 0 ? el.remove() : 0; })
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML5 Herald</title>
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
... тут ваш контент ...
<script src="js/scripts.js"></script>
</body>
</html>