Wondering if we should enable sloMo
The slowMo option slows down Puppeteer operations by the specified amount of milliseconds. It's another way to help see what's going on.
This
const config = {
:root { | |
--scale-0: 1rem; | |
--scale-1: 1.125rem; | |
--scale-2: 1.25rem; | |
--scale-3: 1.5rem; | |
--scale-4: 1.875rem; | |
--scale-5: 2.25rem; | |
--scale-6: 3rem; | |
--scale-7: 3.75rem; | |
--scale-8: 4.5rem; |
# Update your EV2 Amazon Linux box to whatever version you want | |
sudo apt purge nodejs npm | |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash | |
nvm install node | |
source ~/.bashrc | |
nvm install latest | |
# LIVE THE DREAM |
class Queue { | |
constructor() { | |
this.elements = []; | |
} | |
enqueue = (e) => this.elements.push(e); | |
dequeue = (e) => this.elements.shift(); | |
isEmpty = () => this.elements.length === 0; | |
peek = () => !this.isEmpty() ? this.elements[0] : undefined; | |
length = () => this.elements.length; | |
dump = () => this.elements; |
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(); |
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( |
#!/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#????}) |
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'); |
#!/bin/sh | |
find ./ -type f \( -iname \*.b#\* -o -iname \*.s#\* \) -delete |