olvrng
1. https://github.com/ezpkg/iter.json: last year, using go iterator, the core parsing code [1a] is around 200 lines
1a. https://github.com/ezpkg/ezpkg/blob/main/iter.json/parser.go
2. https://github.com/iOliverNguyen/ujson: 4 years ago, using callback, around 400 lines
#!/bin/bash
set -eo pipefail
run-hello() {
echo "Hello, World!"
}
# -------- this is the magic ------- #
source "scripts/_cli.sh"
And source a simple script `_cli.sh`: #!/bin/bash
set -eo pipefail
show-help(){
items=()
while IFS='' read -r line; do items+=("$line"); done < \
<(compgen -A "function" | grep "run-" | sed "s/run-//")
printf -v items "\t%s\n" "${items[@]}"
usage="USAGE: $(basename "$0") CMD [ARGUMENTS]
CMD:\n$items"
printf "$usage"
}
name=$1
case "$name" in
"" | "-h" | "--help" | "help")
show-help
;;
*)
shift
if compgen -A "function" | grep "run-$name" >/dev/null ; then
run-"${name}" "$@"
else
echo "ERROR: run-$name not found."
exit 123
fi
;;
esacI can put my commands in a run file, which source a simple bash script, and use it like:
run do-foo
run build-bar
You can even `run help` to list all available commands.The setup is explained here: https://olivernguyen.io/w/direnv.run/
Show HN: Play ball drop game on my Twitter banner
Play ball drop game on my Twitter banner
Play ball-drop game on my Twitter banner
Show HN: OneSidebar – browser extension for navigating GitHub
Create an emoji ball-drop game with Matter.js
Show HN: I created an emoji ball-drop game and put it on my Twitter banner
Timeline of the Far Future
Validate zero enum value in Protobuf 3
Eventually Consistency and Cache
Front End development without node_modules using Snowpack
Remote: Yes
Willing to relocate: Yes
Techlogies: Golang, Javascript/Node.JS, React, Vue, Svelte, Postgres, Docker, k8s, Sketch
Résumé: https://olvrng.github.io/cv/olvrng.2021.pdf
Email: [email protected]
Blog: https://olvrng.github.io
I'm Oliver. A backend/full-stack developer and startup founder with 7 years in software development. A generalist with mixed of skills, including code, product design, technical writing.
I work mostly with Golang and JavaScript as a backend guy, built a system from ground up on k8s/GKE, released a few open source libraries, wrote some articles. My experience includes backend, web (also unity, game, java in the past).
Some of my recent pet projects are octox.io (a browser extension for navigating GitHub) [1] and ujson (a minimal json parser in Go) [2].
I'm looking for remote job, backend or full-stack.
[1] http://octox.io
[2] https://hackernoon.com/json-a-minimal-json-parser-and-transf...
https://slate.com/technology/2021/01/dead-professor-teaching...