Skip to content

Instantly share code, notes, and snippets.

View yting27's full-sized avatar
🀭
Meditating

Yen Ting yting27

🀭
Meditating
  • Virtual
  • 00:27 (UTC +08:00)
View GitHub Profile
@yting27
yting27 / auto_resolve_conflict.sh
Last active September 28, 2025 14:05
The `resolve_conflict.sh` automates resolving CSV merge conflicts in Git when two developers edit the same lines. It extracts the base, ours, and theirs versions of the conflicted file, converts them into JSON, runs `kdiff3` for automatic merging, converts the result back to CSV, creates a backup, and stages the resolved file for commit.
#!/usr/bin/env bash
# Usage: auto_resolve_conflict.sh <conflicted_file.csv>
set -euo pipefail
FILE="${1:?Usage: $0 <conflicted_file.csv>}"
# Get conflicted file relative path
GIT_ROOT="$(git rev-parse --show-toplevel)"
FILE="${FILE/$GIT_ROOT\//}"
@yting27
yting27 / protobuf-install.md
Last active December 22, 2024 15:08
Building protobuf with CMake on Linux

Building protobuf with CMake on Linux

  1. To build Protobuf, run from the source directory:
    cmake .
    cmake --build . --parallel 10

Tip

To inspect the content of protobuf messages during development, compile in debug mode:

@yting27
yting27 / install-abseil-cpp.md
Last active December 22, 2024 09:51
Installation of `abseil/abseil-cpp` from source

Installation of abseil/abseil-cpp from source

Steps:

  1. Clone the repository locally and change directory:

    git clone https://github.com/abseil/abseil-cpp.git
    cd abseil-cpp
  2. Build source code using CMake with the following options