Skip to content

Instantly share code, notes, and snippets.

View subzey's full-sized avatar

Anton Khlynovskiy subzey

View GitHub Profile
@subzey
subzey / frame.html
Created January 24, 2022 14:29
Firefox media
<!doctype html>
<html>
<head>
<style>
body {
background: green;
}
@media (min-width: 1280px) {
body {
background: blue;
@subzey
subzey / index.html
Created January 10, 2022 15:13
fillText bench
<!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() {
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);
@subzey
subzey / index.html
Created August 3, 2021 14:08
Media query test
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width">
<title>Media query test</title>
<style>
html {
font-size: 5vw;
}
@subzey
subzey / favicon.svg
Last active June 23, 2021 18:13
Chrome 91 SVG favicon test
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@subzey
subzey / favicon.svg
Created June 23, 2021 16:56
Favicon test
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@subzey
subzey / index.html
Created May 19, 2021 10:26
rAF fps
<!doctype html>
<html>
<head><title>rAF fps</title></head>
<body>
<output id="fps"></output>
<script>
const outputText= document.querySelector('#fps').appendChild(document.createTextNode(''));
let prev = -Infinity;
let count = 0;
requestAnimationFrame(function frame(now) {
@subzey
subzey / index.html
Last active March 30, 2023 17:59
BlinkStick WebHID
<!doctype html>
<html>
<head></head>
<body>
<script>
async function getBlinkStick() {
const vendorId = 0x20a0;
const productId = 0x41e5;
const devices = await navigator.hid.getDevices();
@subzey
subzey / linestat.js
Last active April 23, 2021 15:53
linestat
import { createReadStream } from 'fs';
async function * splitLines(inputStream) {
let carry = '';
for await (const chunk of inputStream) {
const lines = (carry + chunk).split('\n');
carry = lines.pop();
yield * lines;
}
@subzey
subzey / index.html
Last active March 30, 2023 18:00
Login 200 error
<!doctype html>
<html>
<head><title>Login status demo</title></head>
<body>
<fieldset>
<legend>Псевдо-логинка</legend>
<form id="loginform">
<p><label><input name="user" type="input"> Логин</label></p>
<p><label><input name="password" type="password"> Пароль</label></p>
<p><input type="submit"></p>