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
.PHONY: all tags clean test build install generate image release | |
REGISTRY_REPO = <..redacted..> | |
OK_COLOR=\033[32;01m | |
NO_COLOR=\033[0m | |
ERROR_COLOR=\033[31;01m | |
WARN_COLOR=\033[33;01m | |
# Build Flags |
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 -eo pipefail | |
SNAKE="${1:-}" | |
[ -n "${SNAKE//}" ] || { | |
echo >&2 "provide snake case string" | |
exit 2 | |
} |
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 | |
# | |
# include_covers.sh test/unit/My/Path/To/TheTest.php | |
# | |
set -eo pipefail | |
WRITE="${WRITE:-}" | |
FILE="${1:-}" |
Creates an alias on the loopback interface (lo0) with the IP 127.0.0.2 on macOS.
- Install the plist to:
/Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
- Set mode:
sudo chmod 0644 /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
- Set owner:
sudo chown root:wheel /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
- Load:
sudo launchctl load /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
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 | |
# | |
# Author: @nikolaizujev | |
# | |
# Big respect to @mholt6 for making Caddy | |
# | |
# This script is based on: | |
# - https://www.calhoun.io/building-caddy-server-from-source/ | |
# - https://g.liams.io/liam/simple-build-caddy.git | |
# |
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
App configuration in environment variables: for and against | |
For (some of these as per the 12 factor principles) | |
1) they are are easy to change between deploys without changing any code | |
2) unlike config files, there is little chance of them being checked | |
into the code repo accidentally | |
3) unlike custom config files, or other config mechanisms such as Java |
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 -euo pipefail | |
if [[ $# -lt 1 ]]; then | |
echo "Usage: brew-go-get github.com/foo/bar ..." | |
exit 1 | |
fi | |
NAME=$(basename "${1}") |
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
<?php | |
$formatter = \NumberFormatter::create($locale, \NumberFormatter::CURRENCY); | |
if ('en' === $this->formatter->getLocale(\Locale::ACTUAL_LOCALE)) { | |
// use non-breakable space (U+00A0) as delimiter | |
$formatter->setPattern(str_replace('¤#', "¤\u{00A0}#", $formatter->getPattern())); | |
} | |
$formatter->setAttribute(\NumberFormatter::FRACTION_DIGITS, $fraction ?? 2); |
Run https://github.com/jpmens/jo to generate JSON structure:
$ jo -p ref=ref-123 title="my title" items=$(jo -a $(jo ref=item-1 title=item points=$(jo -a $(jo label=point-1 x=1.1 y=1.1) $(jo label=point-2 x=1.2 y=1.2))))
Output:
{