Skip to content

Instantly share code, notes, and snippets.

Avatar

Anton Khlynovskiy subzey

View GitHub Profile
@subzey
subzey / index.html
Created Apr 13, 2022
"<symbol> in Promise" leak
View index.html
<!doctype html>
<script>
let singletonPromise;
function makeSomeRequest() {
if (!singletonPromise) {
singletonPromise = Promise.resolve('(Response from some request that only should be made once)')
}
return singletonPromise;
}
@subzey
subzey / index.html
Created Mar 25, 2022
Japanese character test
View index.html
<!doctype html>
<html>
<head></head>
<body>
<canvas width="1080" height="1920"></canvas>
<script>
const blocks = [
[0x2e80, 0x2eff],
[0x2f00, 0x2fdf],
[0x3000, 0x303f],
View index.html
<!doctype html>
<html lang="ru">
<head>
<link href="https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@1,600&family=Lobster&family=Roboto&display=swap" rel="stylesheet">
<style>
body {
font-size: 28px;
line-height: 36px;
font-family: sans-serif;
View index.html
<!doctype html>
<canvas id="a" width="500" height="500"></canvas>
<script>
const ctx = document.querySelector('canvas').getContext('2d');
const font = new FontFace('Charting', 'local("SF Pro Display")', {featureSettings: '"tnum" on, "lnum" on'});
document.fonts.add(font);
ctx.font = '42px Charting, sans-serif';
ctx.fillText('11111|', 0, 50);
View index.html
<!doctype html>
<html>
<head>
<link rel="dns-prefetch" href="https://s3.tradingview.com/">
</head>
<body>
<script>
setTimeout(() => {
const s = document.createElement('script');
s.src = 'https://s3.tradingview.com/tv.js';
View compositor-only.html
<!doctype html>
<html>
<head>
<style>
body {
font: 5vw sans-serif;
margin: 0;
}
section {
padding: 1em 0;
@subzey
subzey / index.html
Created Jan 24, 2022
Translate injections
View index.html
<!doctype html>
<html>
<head>
<style>
p > :last-child {
color: red;
}
</style>
</head>
<body>
View frame.html
<!doctype html>
<html>
<head>
<style>
body {
background: green;
}
@media (min-width: 1280px) {
body {
background: blue;
@subzey
subzey / index.html
Created Jan 10, 2022
fillText bench
View index.html
<!doctype html>
<html>
<head></head>
<body>
<p><output></output></p>
<canvas width="1920" height="1080"></canvas>
<script>
const c = document.querySelector('canvas').getContext('2d');
const out = document.querySelector('output');
requestAnimationFrame(function frame() {
View estimate-collisions.js
const { createHash } = require('crypto');
const hashFunction = 'sha256';
const hashDigest = 'base64';
const hashDigestLength = 5;
function currentImplementation(content, hashSalt) {
const hash = createHash(hashFunction);
if (hashSalt) {
hash.update(hashSalt);