Skip to content

Instantly share code, notes, and snippets.

View CJHwong's full-sized avatar
🧠

Hoss CJHwong

🧠
View GitHub Profile
@CJHwong
CJHwong / oss.py
Last active August 8, 2025 08:06
Operating System Support, is an AI agent help interacting with your OS.
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "ollama",
# ]
# ///
import argparse
import contextlib
import datetime
@CJHwong
CJHwong / en.md
Created August 4, 2025 15:19
Scoratic Mode

You are an AI Collaborative Partner. Your core purpose is to establish a unique collaborative relationship with the user: to be both a supportive partner and an intellectual catalyst. Through a blend of collaboration and inquiry, you will guide the user to think deeply, challenge their assumptions, and help them refine and bring forth their own most exceptional ideas and outcomes.

1. Clarify the Objective Together

First, let's define the destination together. To ensure we have a clear and shared understanding of the goal, I will guide you to answer: What is our exact objective? Why is it important? What does a truly successful result look like to you? This process will ensure we are aligned from the very beginning.

2. Examine and Strengthen the Strategy

Propose your initial strategy or method. I will then act as your intellectual sounding board to examine it with you. I will challenge its foundations by asking: **Why choose this path? What are the alternatives? What are its fundamental assumpt

@CJHwong
CJHwong / CLAUDE.md
Last active July 19, 2025 09:26
Claude Code

Claude Code Agent: Core Operating Protocol

This document defines your core operating protocol. You will adhere to these directives at all times. It is your single source of truth.

1. Guiding Principles

These are your non-negotiable principles.

  • User Partnership is Primary: Your goal is to be a collaborative partner. Understand user intent, create clear plans for approval, and explain your reasoning. Never act without explicit user confirmation.
  • Quality is Mandatory: All produced code must be clean, efficient, and verified by tests and linters. "Done" means verified.
@CJHwong
CJHwong / README.md
Last active July 22, 2025 12:42
Access to GPT-4.1 through CLI with opencode

gpt-4.1.sh

Overview

demo

Usage

@CJHwong
CJHwong / .env.example
Created June 24, 2025 05:54
A Simple Demonstration of building agent with Google ADK
# Absolute or relative path to the local Git repository used by the agent
GIT_AGENT_REPO_PATH=
# AWS credentials for accessing Bedrock services.
# Not required if you're using other providers like Google, Anthropic, or OpenAI.
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION_NAME=
@CJHwong
CJHwong / find-old-remote-branch.sh
Created February 6, 2025 15:52
Git: Find Old Remote Branches
git fetch --all --prune && git for-each-ref --format=$'%(committerdate:unix)\t%(refname:lstrip=2)\t%(committername)' refs/remotes/ | awk -F'\t' -v cutoff=$(date -v-3m +%s) '
$1 < cutoff {
committer = $3;
branches[committer] = branches[committer] "\n - " $2;
}
END {
for (c in branches) {
print c ":" branches[c];
print "==========================";
}
@CJHwong
CJHwong / README.md
Last active March 27, 2024 17:22
MySQL Schema Diagram Generator
@CJHwong
CJHwong / README.md
Last active July 21, 2025 10:05
Gems - A Gemini Gem Manager in your MacBook powered by Gemma

The latest updates are available in this repository: https://github.com/CJHwong/gems.sh

gems.sh - A Gemini Gem Manager in your MacBook powered by Gemma

gems.sh is a Zsh script that simplifies interacting with local Large Language Models using Ollama. It provides a rich set of pre-configured prompt templates with advanced features like language detection, JSON schema processing, and flexible output handling.

Inspired by the workflow described in this Hacker News post by eliya_confiant: https://news.ycombinator.com/item?id=39592297.


ALL_FILES=$(git ls-files)
echo "filename,commit_ct,last_updated_at"
while IFS= read -r FILENAME
do
COMMIT_CT=$(git --no-pager log --pretty=tformat:"%h" ${FILENAME} | wc -l | sed 's/ //g')
LATEST_UPDATED_AT=$(git --no-pager log -1 --pretty="format:%ci" $FILENAME)
echo "${FILENAME},${COMMIT_CT},${LATEST_UPDATED_AT}"
done < <(printf '%s\n' "$ALL_FILES")
@CJHwong
CJHwong / mysql_table_ext.py
Created November 2, 2020 03:44
Extract partial info from a table of mysqldump backup SQL file.
import argparse
import codecs
import csv
def extract_table_sql(table_name, source_dir, target_dir):
TABLE_STRUCTURE_START = '-- Table structure for table'
TARGET_TABLE_STRUCTURE_START = f'{TABLE_STRUCTURE_START} `{table_name}'
backup_sql = codecs.open(f'{source_dir}/backup.sql', 'r', encoding='utf-8', errors='replace')