Generated using ChatGPT with reference image from https://www.youtube.com/watch?v=cjPVlxmf_Vk
- MUA – Mail User Agent (e.g., Outlook, Apple Mail)
- MSA – Mail Submission Agent
- MTA – Mail Transfer Agent
Generated using ChatGPT with reference image from https://www.youtube.com/watch?v=cjPVlxmf_Vk
// Clean html - remove css, script, keep html tags, json and json schema only. | |
function cleanHtml(html) { | |
// First remove HTML comments | |
let cleaned = html.replace(/<!--[\s\S]*?-->/g, ''); | |
// Remove unwanted tags, but preserve script tags with type="application/json" or type="application/ld+json" | |
cleaned = cleaned.replace( | |
/<script(?![^>]*type="application\/(json|ld\+json)")[^>]*>[\s\S]*?<\/script>|<style[^>]*>[\s\S]*?<\/style>|<(link|svg|img|image)[^>]*?>[\s\S]*?<\/\1>|<(link|svg|img|image)([^>]*?)\/?>|<\/(link|svg|img|image)>/gi, | |
'' | |
); |
import React, { useState } from "react"; | |
import { Machine, assign } from "xstate"; | |
import { useMachine } from "@xstate/react"; | |
const signupUser = email => | |
new Promise((resolve, reject) => { | |
setTimeout(() => { | |
// resolve("You are signed up!"); | |
reject("Unable to sign you up :("); | |
}, 1000); |
/* globals importScripts, workbox */ | |
// https://developers.google.com/web/fundamentals/primers/service-workers/ | |
// https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading | |
// https://developers.google.com/web/tools/workbox/modules/workbox-sw#using_workbox_sw_via_cdn | |
importScripts('https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js'); | |
if (workbox) { | |
console.log(`Yay! Workbox is loaded 🎉`); | |
} else { |
# generate a new pgp key: (better to use gpg2 instead of gpg) | |
gpg --gen-key | |
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null` | |
# check current keys: | |
gpg --list-secret-keys --keyid-format LONG | |
# export private key in gpg: | |
gpg --export-secret-key -a "your_username" |
function logger(strings,...values) { | |
var str = ""; | |
for (let i = 0; i < strings.length; i++) { | |
if (i > 0) { | |
if (values[i-1] && typeof values[i-1] == "object") { | |
if (values[i-1] instanceof Error) { | |
if (values[i-1].stack) { | |
str += values[i-1].stack; | |
continue; | |
} |
Time Travel refers to the ability to record a tab and later replay it ([WebReplay][wrr]). The technology is useful for local development, where you might want to:
Preferences | Appearance | Tabs | Theme > Dark
dstr > ttf
, install all font files by double clicking)Preferences | Profiles | Text
Font
to 14pt Fira code regular
and Check Use Ligatures
checkboxNon ASCII Font
to 14pt Fira mono
and Check Use Ligatures
checkboxPreferences | Profiles | Color Presets > Snazzy
git clone https://github.com/tj/n.git n --depth=1 | |
cd n | |
make install | |
cd .. | |
rm -rf n | |
n latest | |
npm install --global yarn |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
elem.clientLeft
, elem.clientTop
, elem.clientWidth
, elem.clientHeight
elem.getClientRects()
, elem.getBoundingClientRect()