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
function parseRace(config){ | |
const {snippets, _, itemCount, rounds, wrap} = config; | |
console.table({ | |
_: _.toString(), | |
itemCount, | |
rounds, | |
wrap: wrap.toString() | |
}) | |
const results = {}; | |
for (const snippet of snippets) { |
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
Array.from(str='Hello world!') | |
.map(_=>_.codePointAt(0).toString(2).padStart(8,'0')) | |
.join('') | |
.match(/\d{1,6}/g) | |
.map(_=>_.padEnd(6,'0')) | |
.map(_=>parseInt(_,2)) | |
//.map(_=>{console.log(_);return _}) | |
.map(_=>Array.from('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/')[_]) | |
.join('') + ' ' + btoa(str) |
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>Firefox shell</title> | |
<script type="text/javascript"> | |
/* | |
howto: | |
# place this file somewhere on your disk | |
# open it in Firefox | |
# bookmark it, so it's address is like | |
# file:///c:/web-root/utils/firefox-shell.html | |
# edit new bookmark: append '?%s' to its URL, so it becomes | |
# file:///c:/web-root/utils/firefox-shell.html?%s |
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
data:text/html;charset=utf-8,<!doctype html>%0A<link rel=icon href='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="1,-15,19,19"><text transform-origin="10 -3">%F0%9F%A6%84</text><style>@keyframes x{to{transform:rotate(1turn)}}@keyframes y{to{opacity:0}}text{animation:2s x infinite alternate}@media(prefers-reduced-motion){text{animation-name:y}}</style></svg>'>%0A<title>Animated favicon affected by `prefers-reduced-motion` media query, embedded in datauri inside datauri document</title>%0A<style>:not(style,script){display:block; padding:0 .2em; background:darkslategray; color:snow; white-space:pre-wrap} title::after{content:' (in `' var(--prm) '` mode)'}html{--prm:'no-preference'}@media(prefers-reduced-motion:reduce){html{--prm:'reduce'}}</style>%0A<script>document.write('<plaintext>',decodeURIComponent(document.URL))</script> | |
(Works in Firefox) |
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
<!-- | |
https://www.google.com/search?q=test | |
logged in user, czech region | |
`copy($('#main').outerHTML)` | |
░ | /*░*/ = redacted | |
--> | |
<div class="main" | |
id="main"> | |
<div class="e9EfHf" |
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
// Alt text for https://twitter.com/_georgemoller/status/1411388009556099072 | |
By George Moller @_georgemoller | |
Part 2 | |
7 HTML forms best practices | |
01: Use the `enterkeyhint` attribute on form inputs to set the mobile keyboard enter key label: |
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
// ==UserScript== | |
// @name HN: style unread content | |
// @description Save hashes of displayed comments locally and mark new ones when displayed for the first time | |
// @namespace myfonj | |
// @match https://news.ycombinator.com/* | |
// @grant none | |
// @version 1.0 | |
// @author myfonj | |
// ==/UserScript== |
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
class FOJO { | |
constructor(o) { | |
this.object = Object.assign({}, o) | |
this.entries = Object.entries(this.object) | |
return new Proxy(this, this) | |
} | |
ownKeys() { | |
return Object.keys(this.object) | |
} | |
get(target, key) { |
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
console.log([].filter.call(document.all,(e,c)=>(e.getBoundingClientRect().right+parseFloat((c=getComputedStyle(e)).marginRight)*!(c.position=='absolute'))>document.documentElement.offsetWidth)) |
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
<!-- | |
Facebook generated code snippet of avatar image in timeline post | |
retrieved 2020-09-14T21Z | |
- class attributes deleted | |
- resulting DIVs without attributes omitted | |
--> | |
<a role="link" tabindex="-1" aria-hidden="true" href="[…]2CP-R"> | |
<object type="nested/pressable"> | |
<a role="link" tabindex="0" aria-label="[…]" href="[…]3C%2CP-R"> |