https://i.ytimg.com/vi/<video-id>/<size>.jpg
https://i.ytimg.com/vi_webp/<video-id>/<size>.webp
default
- 120x90, 88x88mqdefault
- 320x180, 240x240hqdefault
- 480x360, 800x800
/* | |
conf: Falsy Values 2015 | |
author: Kornel Lesinski | |
theme: And .then() what? Promise programming patterns | |
link: https://www.youtube.com/watch?v=KrhQE8K2I7Q | |
*/ | |
// 1 waterfall. Использование результатов предыдущих промисов | |
doFirst() | |
.then(firstResult => { |
const crypto = require('crypto'); | |
const fs = require('fs'); | |
/** | |
* @typedef {object} HashFileOptions | |
* @prop {string} [algorithm = 'md5'] алгоритм хеширования | |
* @prop {crypto.HexBase64Latin1Encoding} [encoding = 'hex'] предствалние конечного хеша | |
*/ | |
/** |
Headers from backend app:
Content-Type: text/event-stream;
Connection: keep-alive;
Cache-Control: no-cache;
X-Accel-Buffering: no;
node.js line number stream.
https://2ality.com/2019/11/nodejs-streams-async-iteration.html, https://github.com/deanhume/streams
# https://stackoverflow.com/questions/32893773/how-to-git-log-with-date-time-and-file-names-in-one-line | |
git log --pretty=%x0a%ci --name-only \ | |
| awk ' | |
/^$/ { dateline=!dateline; next } | |
dateline { date=$0; next } | |
!seen[$0]++ { print date,$0 } | |
' |
// https://jakearchibald.com/2021/encoding-data-for-post-requests/ | |
function formToObject(formData) { | |
return Object.fromEntries( | |
[...new Set(formData.keys())] | |
.map((key) => [key, formData.getAll(key)]), | |
); | |
} | |
Сritical Path CSS style в head
Разделяйте свои медиавыражения по типам
<link rel="stylesheet" href="all.css" media="all" />
<link rel="stylesheet" href="small.css" media="(min-width: 20em)" />
<link rel="stylesheet" href="medium.css" media="(min-width: 64em)" />