HNHacker News
TopNewBestAskShowJobs

olvrng

14 karma · joined December 27, 2020

olivernguyen.io
submissionscomments
olvrng··on Parsing JSON in 500 lines of Rust
I have implemented 2 packages in Go for parsing json:

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

olvrng··on Just: Just a Command Runner
Create a bash script `run`:

    #!/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
            ;;
    esac
olvrng··on Just: Just a Command Runner
My favorite command runner setup is just a simple bash script and .envrc

I 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/

olvrng··on Show HN: Chrome extension to have ChatGPT as a sidebar
When we are browsing internet, read some articles, or searching for information, it will be very helpful to have ChatGPT as an assistant. This extension opens ChatGPT as a sidebar, wherever you need.
olvrng··on Barcode Detection API
It's always included in Google Lens (and Nokia 3.4 uses Android One). You can open Google Lens and point to the QR code.
olvrng··on Ask HN: Who wants to be hired? (July 2021)
Location: UTC+7

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: olvr.ng@gmail.com

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...

olvrng··on GitHub Copilot as open source code laundering?
This already happened in academic:

https://slate.com/technology/2021/01/dead-professor-teaching...