# h1 Heading 8-)
## h2 Heading
### h3 Heading
#### h4 Heading
##### h5 Heading
###### h6 Heading
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
export function cleanClipboardText(e: ClipboardEvent){ | |
const pastedText = e.clipboardData?.getData('text/plain'); | |
return pastedText ? stripBom(pastedText) : '' | |
} | |
export function onPaste(e: ClipboardEvent){ | |
e.preventDefault() | |
const sel = window.getSelection() | |
if(!sel) return; | |
if (!sel.rangeCount) return; |
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
#!/bin/zsh | |
startTime=$(date) | |
url="$1" | |
if [ "$url" = "" ]; then | |
echo "url can't be empty" | |
echo "usage: download url" | |
exit 1 | |
fi |
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
#!/bin/zsh | |
url="$1" | |
if [ "$url" -eq "" ]; then | |
echo "url can't be empty" | |
echo "usage: download url" | |
exit 1 | |
fi |
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
/* | |
Dark mode by UltimaDark, on firefox | |
https://addons.mozilla.org/en-US/firefox/addon/ultimadark/ | |
*/ | |
/* selection color */ |
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
((w,d) => { | |
w && d && | |
w.matchMedia('(prefers-color-scheme:dark)')?.matches && | |
d.getElementsByTagName('html')[0]?.classList.add('dark') | |
})(window,document) |
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
fpsMeter() { | |
let prevTime = Date.now(), | |
frames = 0; | |
requestAnimationFrame(function loop() { | |
const time = Date.now(); | |
frames++; | |
if (time > prevTime + 1000) { | |
let fps = Math.round( ( frames * 1000 ) / ( time - prevTime ) ); | |
prevTime = time; |
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 fs = require('fs/promises') | |
const sharp = require('sharp') | |
// this will create 2 images | |
// one with 1200 width and one with 600 width | |
// it will place them in the current directory | |
// note that the original image(s) will be expected to be png |
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
function easeOutElastic(x) { | |
const c4 = (2 * Math.PI) / 3; | |
return x === 0 | |
? 0 | |
: x === 1 | |
? 1 | |
: Math.pow(2, -10 * x) * Math.sin((x * 10 - 0.75) * c4) + 1; | |
} |
NewerOlder