Skip to content

Instantly share code, notes, and snippets.

export default class Queue {
private static queue: {
promise: () => Promise<unknown>;
resolve: (value: unknown) => void;
reject: (err: unknown) => void;
}[] = [];
private static isWorkingOnItemInQueue = false;
static enqueue<T>(promise: () => Promise<T>) {
return new Promise((resolve, reject) => {
@tuxracer
tuxracer / extensions.json
Created May 12, 2022 03:16
vscode notepad - place in .vscode/ directory where notes are stored
{
"recommendations": [
"rioj7.command-variable",
"davidanson.vscode-markdownlint",
"esbenp.prettier-vscode",
"sleistner.vscode-fileutils",
"teabyii.ayu",
"yzhang.markdown-all-in-one",
"wk-j.save-and-run"
]
function fishvenv --on-variable PWD
if test -f $PWD/venv/bin/activate.fish
echo -e "\033[1mActivating venv\033[0m"
source $PWD/venv/bin/activate.fish
end
end
@tuxracer
tuxracer / crop.sh
Last active February 26, 2021 06:20
ffmpeg -ss 00:03:00 -i bunny.mp4 -t 00:00:30 -c copy -an bunny_clip_1.mp4
We couldn’t find that file to show.
{
"editor.fontFamily": "Operator Mono",
"editor.fontSize": 14,
"window.reopenFolders": "all",
"files.trimTrailingWhitespace": true,
"typescript.check.tscVersion": false,
"window.zoomLevel": 0,
"workbench.welcome.enabled": false,
"workbench.colorTheme": "Monokai",
"workbench.iconTheme": "vs-seti",
function fish_prompt
set -l last_command_status $status
set -l cwd
if test "$theme_short_path" = 'yes'
set cwd (basename (prompt_pwd))
else
set cwd (prompt_pwd)
end
@tuxracer
tuxracer / status.sh
Last active December 28, 2016 22:00
#!/bin/bash
export PATH=/usr/local/bin:$PATH
if control status | grep -q www2; then
color="green"
else
color="red"
fi
echo "Setting color to: $color"
echo -n $color | nc -4u -w0 localhost 1738
var version = 'app-v1';
var expectedCaches = [version];
self.oninstall = () => console.log('Installed version:', version);
self.onfetch = (event) => {
event.respondWith(
// Check cache for request
caches.match(event.request)
javascript:void(setTimeout(function(){Array.prototype.slice.call(document.querySelectorAll("p"),0).forEach(function(a){try{a.innerHTML=a.innerHTML.replace(/literally/gi,"")}catch(b){}})},0))