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
#!/usr/bin/env bash | |
alias gcn!='f() { | |
if git diff --cached --quiet && git diff --quiet; then | |
printf "No changes to commit\n" | |
else | |
if git diff --cached --quiet; then | |
printf "No files added to staging! Did you forget to run git add?\n" >&2 | |
else | |
git commit --verbose --no-edit --amend --no-verify |
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
{ | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"cz": "cz", | |
"release": "standard-version --no-verify" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC", | |
"devDependencies": { |
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
#!/usr/bin/env bash | |
set -e | |
set -o errexit | |
docker stop `docker ps -qa` > /dev/null 2>&1; ## Stop all running containers | |
docker buildx stop; ## Stop the buildx builder | |
docker system prune --all --force --volumes; ## Remove all volumes, images, and containers | |
docker buildx rm --all-inactive --force; ## Remove all buildx builders | |
docker buildx prune --all --force; ## Prune buildx builder caches |
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
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{ | |
default: Turndown | |
}, { | |
default: Readability | |
}]) => { | |
/* Optional vault name */ | |
const vault = ""; | |
/* Optional folder name such as "Clippings/" */ |
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
/** | |
* Calculates and returns a high-contrast color (either black or white) | |
* for optimal readability when displayed on top of the provided color. | |
* The function uses the luminance formula to determine the brightness | |
* of the input color and returns either black or white based on a | |
* luminance threshold. | |
* | |
* @param {string} hexColor - The hex code of the background color. | |
* Should be a valid hex color code starting with '#' | |
* and followed by six hexadecimal characters. |
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
name: "Install and Cache Playwright" | |
description: "Sets up a cache and/or installs Playwright and its browser binaries." | |
author: dgrebb | |
inputs: | |
WORKSPACE_ROOT: | |
description: "The workspace root." | |
required: true | |
runs: |
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 | |
# Filter known dynamic timestamped `test`, `testLog`, and `diffImage` properties | |
# Then compare results, and `exit 1` if newly generated report.json is different. | |
diff -q <(jq -S ". | del(.tests[].pair.test, .tests[].pair.testLog, .tests[].pair.diffImage)" test/__fixtures__/sanity-test.json) \ | |
<(jq -S ". | del(.tests[].pair.test, .tests[].pair.testLog, .tests[].pair.diffImage)" test/configs/backstop_data/bitmaps_test/**/report.json) | |
if [[ $? == "0" ]]; then | |
exit 0 |
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
/** | |
* Copies text inside the clicked DOM node | |
* | |
* @param {Event} e The event which triggered the copy. | |
* @returns {Clipboard.writeText} Text is written to the system clipboard. | |
* | |
* @async | |
* | |
* ## Example: | |
* ```javascript |
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
"scripts": { | |
"dev": "npx tsc-watch --onSuccess \"node build/app.js\"" | |
} |
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
/** | |
* @description: Handler entry point. | |
* - Note AWS CloudFront Functions use a modified ECMAScript 5.1 compatible runtime and NOT NodeJS. | |
* - Use var, not const or let | |
* - Use string concatenation and not template literals | |
* - Beware that the CloudFront Functions Console editor and test environment do NOT mimic CloudFront 100% | |
* @date 2022-01-26 | |
* @param {object} event: A CloudFront Function event (expecting a Viewer Request event) | |
* @return {object}: A CloudFront response or request object (depends whether conditions allow pass through or 301 redirect) | |
*/ |
NewerOlder