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
ncat -k -l 4000 -o /dev/stderr -c 'echo "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n"' |
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
fun <T,U> T?.map(mapping: (T) -> U) = when (this) { | |
null -> null | |
else -> mapping(this) | |
} |
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
if [ "$1" = "--reset" ]; then | |
if [ -n "$OLD_GOPATH" ]; then | |
export GOPATH="$OLD_GOPATH" | |
unset OLD_GOPATH | |
fi | |
return | |
fi | |
if [ -n "$BASH" ]; then | |
script_path=${BASH_SOURCE[0]} |
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
# convert every (binary) string value in the keyword list to a character list | |
args |> Enum.map(fn | |
v when is_binary(v) -> to_charlist(v) | |
{k, v} when is_binary(v) -> {k, to_charlist(v)} | |
any -> any | |
end) |
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
Stream.unfold({0, 1}, fn {x, y} -> {x, {y, x + y}} end) |
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
confirm() { | |
while true; do | |
read -p "$@" -n 1 answer | |
echo | |
case "$answer" in | |
[yY]) return 0 ;; | |
[nN]) return 1 ;; | |
esac | |
done | |
} |
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
--- | |
parser: babel-eslint | |
parserOptions: | |
ecmaVersion: 6 | |
sourceType: module | |
ecmaFeatures: | |
impliedStrict: true | |
environment: | |
node: true | |
rules: |
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
#!/bin/bash | |
print_error() { | |
1>&2 echo "$@" | |
} | |
fail() { | |
if [[ $# -gt 0 ]]; then | |
print_error "$@" | |
fi |
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
function directly(value) { | |
return Promise.resolve(value); | |
} | |
function later(value) { | |
return new Promise(resolve => { | |
setTimeout(() => resolve(value), 500); | |
}); | |
} |
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
GIT=git | |
GIT_SUBMODULES=$(shell sed -nE 's/path = +(.+)/\1\/.git/ p' .gitmodules | paste -s -) | |
.PHONY: all | |
all: $(GIT_SUBMODULES) | |
$(GIT_SUBMODULES): %/.git: .gitmodules | |
$(GIT) submodule init | |
$(GIT) submodule update $* | |
@touch $@ |