Skip to content

Instantly share code, notes, and snippets.

function leakyDebounce(fn, delay, max = 1) {
let timer, ctx, args, outstanding = 0, queue = [];
function done() {
[ ctx, args ] = queue.shift();
fn.apply(ctx, args);
if (queue.length) {
timer = setTimeout(done, delay);
}
}
@pl12133
pl12133 / preact-upgrade-experience.md
Last active June 13, 2019 05:42
Preact@8 to Preact@10 Upgrade Notes

PreactX Upgrade Experience

Obvious breaking changes

See release 10.0.0-alpha.0 for a full list.

  • h -> createElement
  • VNode.nodeName -> VNode.type
  • VNode.attributes -> VNode.props
  • VNode.children -> VNode.props.children
@pl12133
pl12133 / send-eml.sh
Created September 5, 2019 16:25
Send an EML file through raw SMTP using Netcat
#####
# File: send-eml.sh
# Author: pl12133
# Description: Send an eml file through an SMTP service using netcat
# Usage: ./send-eml.sh [file] [smtp-server]
#####
set -e
# like `cat`, but it waits for a reply.
function slowcat(){ cat "$@" | while read; do sleep 0.5; echo "$REPLY"; done; }

Keyboard Overlay Bookmarklet

What Is It?

This is a bookmarklet to visualize keyboard interactions, to make it easier to demo them in gif or video format.

image

How To Use It: