Skip to content

Instantly share code, notes, and snippets.

View mat813's full-sized avatar

Mathieu Arnold mat813

View GitHub Profile
@mat813
mat813 / dns-bind918-Makefile.local
Last active March 21, 2023 11:36
Add flavors to dns/bind918 to automate testing all options.
.if empty(FLAVOR)
FLAVOR= normal
.endif
CONFIGURE_ARGS+= --enable-full-report
.if defined(BIND_TOOLS_SLAVE)
FLAVORS= normal small huge ${OPTIONS_SINGLE_GSSAPI:NGSSAPI_NONE:tl}
. if ${FLAVOR} == small
const farey = (x: number, N: number): [number, number] => {
if (x > 1) {
const units = Math.floor(x);
const [a, d] = farey(x - units, N);
return [a + units * d, d];
}
let [a, b] = [0, 1];
let [c, d] = [1, 1];
@mat813
mat813 / direnv-gitlab-node.sh
Last active November 25, 2023 08:44
Get current node version from .gitlab-ci.yml
use_mynode() {
local file=${1:-.gitlab-ci.yml}
local node_version
watch_file "$file"
# NODE_VERSION: 18.2.0-alpine
node_version=$(sed -n '/NODE_VERSION:/s/NODE_VERSION:[[:space:]]*\([^-]*\)\(-.*\)\?/\1/p' $file)
if [ -z "$node_version" ]; then