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
// one-liner version | |
('hello {name}') // input string | |
.split('{') // start of variable | |
.map(s => s.split('}')) // end of variable | |
.flat() | |
.map((s, i) => i & 1 ? ({ name: 'world' })[s] ?? `{${s}}` : s) // variable lookup with fallback | |
.join(''); //> "hello world" | |
// with variables | |
const inputString = 'hello {name}'; |
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
alias cinematic_prepare " | |
sv_cheats 1; | |
bot_kick; | |
mp_roundtime_defuse 60; | |
mp_roundtime_hostage 60; | |
mp_roundtime 60; | |
mp_restartgame 1; | |
"; | |
alias cinematic_on " |
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
:root { | |
--bg-0: #0000; /* Brightest */ | |
--bg-1: #0000; | |
--bg-2: #0000; | |
--bg-3: #0000; /* Darkest */ | |
--text-0: #23aeb5; /* Darkest */ | |
--text-1: #23aeb5; | |
--text-2: #23aeb5; | |
--text-3: #23aeb5; /* Brightest */ | |
--color-0: #23aeb5; /* "Ring" Color */ |
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
commit() { # commit <message> | |
git stage -A | |
git commit -m "$*" | |
git push | |
} | |
archive-branch() { # archive-branch <name> | |
git tag archive/$* $* | |
git push origin archive/$* | |
git branch -D $* |
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 fs = require('fs'); | |
const exec = require('child_process').execSync; | |
const files = fs.readdirSync('.').filter(f => f.endsWith('.wav')); | |
if (!fs.existsSync('./out')) fs.mkdirSync('./out'); | |
files.forEach(file => exec('ffmpeg -i ' + file + ' -c:a libopus -ac 2 ./out/' + file.replace('.wav', '.webm'), {stdio: 'inherit'})); | |
console.log('########'); |
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
prompt('Copy the the text below and paste it into the adress bar', URL.createObjectURL(new Blob([new TextEncoder().encode(document.documentElement.outerHTML).buffer], { type: 'text/plain' }))); |
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
window.location.href = URL.createObjectURL(new Blob([new TextEncoder().encode(document.documentElement.outerHTML).buffer], { type: 'text/html' })); |