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
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 |
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 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]; |
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
.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 |
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
#!/bin/sh | |
set -e | |
set -u | |
send=$1 | |
receive=$2 | |
echo "from $send" | |
echo "to $receive" |
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 { Transform } = require('stream'); | |
const batchStream = (batchSize = 5) => { | |
let batch = []; | |
return new Transform({ | |
objectMode: true, | |
transform(data, _, done) { | |
batch.push(data); |
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
#!/usr/bin/env perl | |
# | |
use 5.008; | |
use utf8; | |
use strict; | |
use warnings; | |
use File::Spec; | |
use File::Path qw(make_path); |
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
for i in $(git branch|cut -b 3-|sed -e '/^trunk$/d;/^svnadmin$/d') | |
do | |
mkdir -p ../patch/$i | |
git format-patch -o ../patch/$i origin/trunk..$i | |
git show $(head -1 ../patch/$i/0001-*|awk '{print $2}')~1|grep git-svn-id > ../patch/$i/rev-svn | |
done | |
for i in $(find ../patch -name rev-svn|sed -e 's/^..\/patch\///;s/\/rev-svn$//') | |
do | |
rev=$(sed -e 's/.*@\([[:digit:]]*\) .*/\1/' ../patch/$i/rev-svn) |
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
Copyright (c) 2016 Mathieu Arnold. All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions | |
are met: | |
1. Redistributions of source code must retain the above copyright | |
notice, this list of conditions and the following disclaimer. | |
2. Redistributions in binary form must reproduce the above copyright | |
notice, this list of conditions and the following disclaimer in the | |
documentation and/or other materials provided with the distribution. |
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
#!/bin/sh | |
# Needs sysutils/watchman, textproc/jq | |
set -e | |
BUILD_OBJ=/usr/home/mat/work/freebsd/doc-obj | |
watchman watch ${PWD} > /dev/null | |
# Subscribe to changes in $PWD, don't care about anything it returns, |
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
#!/bin/sh | |
if [ `expr $# % 2` -ne 0 ] | |
then | |
echo "odd number of arguments" | |
exit 1 | |
fi | |
while [ $# -gt 0 ] | |
do |
NewerOlder