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 PORTS = new Map(); | |
const CLIENTS = new Map(); | |
onconnect = (e) => { | |
const port = e.ports[0]; | |
PORTS.set(port, { port: port, uuid: this.uuid, username: null}); | |
port.start(); |
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 date = new Date(); | |
date.setDate(date.getDate() - 2); // Set date to 2 days ago | |
const now = new Date(); | |
const diffInMilliseconds = now - date; | |
const seconds = Math.floor(diffInMilliseconds / 1000); | |
const formatter = new Intl.RelativeTimeFormat('en', { numeric: 'auto' }); | |
const formattedDate = formatter.format( |
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/bash | |
hexToAnsiColors() { | |
local color_name="$1" | |
local hex="$2" | |
hex=${hex#"#"} | |
r=$(printf '0x%0.2s' "$hex") | |
g=$(printf '0x%0.2s' ${hex#??}) | |
b=$(printf '0x%0.2s' ${hex#????}) |
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
declare global { | |
interface Console { | |
save(data: any, filename?: string): void; | |
} | |
} | |
(function (console: Console) { | |
console.save = function (data: any, filename?: string): void { | |
if (!data) { | |
console.error('Console.save: No data'); |
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/sh | |
find ./ -type f \( -iname \*.b#\* -o -iname \*.s#\* \) -delete |
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 MAX_LOOP_DURATION = 100; // Maximum duration of the ResizeObserver loop in ms | |
let resizeTimeout; | |
let resizeStartTime; | |
const observer = new ResizeObserver(entries => { | |
if (resizeTimeout) { | |
clearTimeout(resizeTimeout); | |
} |
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
<canvas></canvas> | |
<section> | |
<h1>32teeth</h1> | |
<h2>this pen needs ❤</h2> | |
</section> | |
<div class='blur'></div> |
List
code --list-extensions | xargs -L 1 echo code --install-extension
Dump
code --install-extension amazonwebservices.aws-toolkit-vscode
code --install-extension arcticicestudio.nord-visual-studio-code
code --install-extension dbaeumer.vscode-eslint
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
#include <rom/crc.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <dirent.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/stat.h> | |
#include "gui.h" | |
#include "odroid_display.h" |