Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
<!doctype html> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>do json</title> | |
<meta name="robots" content="noindex, nofollow" /> | |
<meta http-equiv="cache-control" content="max-age=0" /> | |
<meta http-equiv="cache-control" content="no-cache" /> |
// 1. Получить случайный элемент из списка | |
const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; | |
// Распространенный вариант | |
function getRandomItem(list){ | |
return list[Math.floor(Math.random() * (list.length))]; | |
} | |
getRandomItem(months); | |
// Underscore и Lodash | |
_.sample(months); |
<?php | |
//echo __FILE__; | |
try { | |
$phar = new PharData('/full/path/a.tar'); | |
$phar->extractTo('/full/path/to/dir'); // extract all files | |
} catch (Exception $e) { | |
echo $e->getMessage() . "\n"; | |
} |