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
| mkdir foo && cd $_ | |
| swift package init | |
| # 1) Add iOS target to Package.swift | |
| # 2) Add flags for XCode in Package.xcconfig, e.g. | |
| # | |
| # DEVELOPMENT_TEAM = ...; | |
| # CODE_SIGN_STYLE = Automatic; | |
| # INFOPLIST_FILE = ...; | |
| swift package generate-xcodeproj --xcconfig-overrides Package.xcconfig | |
| xcodebuild build -sdk iphoneos -scheme 'foo-Package' -clonedSourcePackagesDirPath SourcePackages \ |
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
| data class RenderSize(val width: Int, val height: Int) { | |
| companion object { | |
| // 0x0 is an alias for "any" | |
| val ANY = RenderSize(0, 0) | |
| } | |
| } | |
| /** | |
| * Scores an image resource based on the set of sizes it supports and on the | |
| * size the caller wants to render it inside of. |
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
| import kotlin.coroutines.* | |
| /** | |
| * Minimal, probably-borked implementation of `launch()`, just good enough | |
| * for running in a IDEA scratch. | |
| * | |
| * ### Usage | |
| * | |
| * ```kt | |
| * suspend fun main() { |
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