This file contains hidden or 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
# Start a 1fps screen capture to `~/Movies/timelapse - <end-datetime>.webm`. | |
# Requires ffmpeg+libvpx installed: `brew install ffmpeg`. | |
# Press `q` to stop. | |
capture_timelapse() { | |
local output="$HOME/Movies/timelapse - $(date '+%y-%m-%d %H%M%S').webm" | |
local device=$(set +e +o pipefail; ffmpeg -f avfoundation -list_devices true -i '' 2>&1 | sed -En 's#^.*\[([a0-9]+)\] Capture screen 0#\1#p'; true) | |
if [ -n "$device" ] | |
then | |
printf 'Capturing timelapse to "%s"…\nPress Q to stop.\n' "$output" | |
ffmpeg \ |
This file contains hidden or 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
# $1: items power of 10 (e.g. 3=kilo, 6=mega) | |
# $2: entropy bits (80=2^80 values) | |
# Requires `brew install bc` (GNU bc) | |
birthday_probability() { | |
function bc() { | |
declare fmt="$1" | |
shift | |
printf 'scale=256\n'"$fmt"'\n' ${1+"$@"} | BC_LINE_LENGTH=0 /usr/local/opt/bc/bin/bc -l | |
} | |
declare exact="$(bc '1-e(-((10^%s)^2)/((2^%s)*2))' "$1" "$2")" |
This file contains hidden or 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
# $1: /path/to/woff.2 | |
trim-font() { | |
local OUTPUT_DIR="${1%/*}/trimmed" | |
mkdir -p "$OUTPUT_DIR" | |
pyftsubset "$1" \ | |
--unicodes=U+0000-036F \ | |
--ignore-missing-glyphs \ | |
--layout-features='*' \ | |
--output-file="${OUTPUT_DIR}/${1##*/}" --flavor=woff2 | |
} |
This file contains hidden or 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 { spawn } = require('child_process') | |
const { Transform } = require('stream') | |
const { createHash } = require('crypto') | |
const split2 = require('split2') | |
const report = require('vfile-reporter') | |
const { nextTick } = require('process') | |
const DELIMITER = '___PLANTUML_DIAGRAM_DELIMITER___' | |
const SPLITTER = split2(DELIMITER) | |
const OPTIONS = [ |
FROM oracle/graalvm-ce:20.0.0-java8
RUN gu install native-image
WORKDIR /opt/graalvm
ADD https://sourceforge.net/projects/plantuml/files/1.2020.8/plantuml.1.2020.8.jar/download /opt/graalvm/plantuml.jar
RUN native-image \
--verbose \
-J-Xmx16G -J-Xms16G -Djava.awt.headless=true \
--no-server \
--no-fallback \
- Jest is a delightful JavaScript Testing Framework with a focus on simplicity.
- Puppeteer Headless Chrome bindings
- Jest/Puppeteer Use Jest together with Puppeteer
- Chakram REST API test framework. BDD and exploits promises
- OpenAPI Test Templates Generate basic unit test scaffolding for your OpenAPI specification
This file contains hidden or 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
# Example | |
ffm -i video.mov -map_metadata 0 -map 0 -c:v copy -c:a copy -c:s copy -c:d copy -c:t copy -f mp4 video.mp4 | |
# Convert one file | |
# $1: video.mov | |
convert-mov-to-mp4() { | |
( | |
set -e -u -o pipefail | |
! [[ "$1" =~ ^(.+)\.[mM][oO][vV]$ ]] || { | |
local D="${BASH_REMATCH[1]}.mp4" T="${BASH_REMATCH[1]}.tmp.mp4" |
This file contains hidden or 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
load("@bazel_tools//tools/build_defs/repo:java.bzl", "java_import_external") | |
java_import_external( | |
name = "com_google_auto_common", | |
jar_sha256 = "eee75e0d1b1b8f31584dcbe25e7c30752545001b46673d007d468d75cf6b2c52", | |
jar_urls = [ | |
"http://domain-registry-maven.storage.googleapis.com/repo1.maven.org/maven2/com/google/auto/auto-common/0.7/auto-common-0.7.jar", | |
"http://repo1.maven.org/maven2/com/google/auto/auto-common/0.7/auto-common-0.7.jar", | |
], | |
licenses = ["notice"], # Apache 2.0 |