This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const a = [], b = []; | |
pairs.split('\n').forEach(line => { | |
const x = line.split(' '); | |
const [left, right] = [+x[0], +x[1]]; | |
a.push(left); | |
b.push(right); | |
}) | |
a.sort((a,b) => a-b); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const audios = document.querySelectorAll('audio'); | |
const tracks = [...audios].map((audio, i) => { | |
const article = audio.parentNode; | |
const title = article.querySelector('h2 a'); | |
const img = article.querySelector('img'); | |
return { | |
pos: i, | |
audio: audio, | |
metadata: { |
date: 2020-04-27 title: 'TODO' language: ru hosts:
- Вадим Макеев
- Никита Дубко
- Ольга Алексашенко chapters:
- time: 00:00:00
- Essential Image Optimization — Addy Osmani
- Image Optimization — Ilya Grigorik
- The Contrast Swap Technique: Improved Image Performance with CSS Filters — Una Kravets
- Compressive Images Revisited — Tim Kadlec
- w descriptors and sizes: Under the hood — Eric Portis
- Lazy Loading Images and Video — Jeremy Wagner
- How WebP Increases Your Web Performance — Dieter Petereit
- [Lazy Loading Images for Performance Using Intersection
- play.csssecrets.io/inner-rounding — sqrt
- play.csssecrets.io/diamond-images — sqrt
- play.csssecrets.io/bevel-corners — sqrt
- play.csssecrets.io/folded-corner — sqrt
- play.csssecrets.io/folded-corner-realistic — sqrt, sin, cos
sqrt(2) == cos(45deg) * 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"parserOptions": { | |
"ecmaVersion": 2017, | |
"sourceType": "script", | |
"ecmaFeatures": { | |
"impliedStrict": true | |
} | |
}, | |
"env": { | |
"node": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Calculate the luminance for a color. | |
* See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests | |
*/ | |
@function luminance($color) { | |
$red: nth($linear-channel-values, red($color) + 1); | |
$green: nth($linear-channel-values, green($color) + 1); | |
$blue: nth($linear-channel-values, blue($color) + 1); | |
@return .2126 * $red + .7152 * $green + .0722 * $blue; |