News for hackers. Stuff that matters.

olvrng

Re:Parsing JSON in 500 lines of Rust on Wednesday February 19, 2025 @05:29AM (#43100617)
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

Re:Just: Just a Command Runner on Saturday December 07, 2024 @04:16PM (#42352914)
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
Re:Just: Just a Command Runner on Saturday December 07, 2024 @04:11PM (#42352884)
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/

Re:Show HN: Chrome extension to have ChatGPT as a sidebar on Monday December 05, 2022 @03:37PM (#33871550)
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.
Re:Barcode Detection API on Thursday March 10, 2022 @07:54AM (#30626360)
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.
Re:Ask HN: Who wants to be hired? (July 2021) on Thursday July 01, 2021 @07:41PM (#27706263)
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: [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...

Re:GitHub Copilot as open source code laundering? on Wednesday June 30, 2021 @08:14PM (#27695018)