This file contains hidden or 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
<!doctype html> | |
<html> | |
<head> | |
<style> | |
body { | |
background: green; | |
} | |
@media (min-width: 1280px) { | |
body { | |
background: blue; |
This file contains hidden or 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
<!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() { |
This file contains hidden or 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 { 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); |
This file contains hidden or 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
<!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; | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
<!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) { |
This file contains hidden or 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
<!doctype html> | |
<html> | |
<head></head> | |
<body> | |
<script> | |
async function getBlinkStick() { | |
const vendorId = 0x20a0; | |
const productId = 0x41e5; | |
const devices = await navigator.hid.getDevices(); |
This file contains hidden or 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
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; | |
} |
This file contains hidden or 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
<!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> |