Skip to content

Instantly share code, notes, and snippets.

View roychri's full-sized avatar

Christian Roy roychri

View GitHub Profile
@roychri
roychri / tools.md
Last active May 7, 2025 14:15
My Useful Tools
@roychri
roychri / BUILD WITH CLAUDE - Tool use (function calling).txt
Created January 23, 2025 13:40
Google Cloud Big Query AI Agent for LLM (Claude)
BUILD WITH CLAUDE
Tool use (function calling)
Claude is capable of interacting with external client-side tools and functions, allowing you to equip Claude with your own custom tools to perform a wider variety of tasks.
Learn everything you need to master tool use with Claude via our new comprehensive tool use course! Please continue to share your ideas and suggestions using this form.
Here’s an example of how to provide tools to Claude using the Messages API:
Shell
@roychri
roychri / system_prompt.txt
Created January 23, 2025 13:35
Command Line Troubleshooter for LLM (Claude)
Act as an expert software developer.
Your goal is to help the user troubleshoot an issue on the command line.
The user will tell you what kind of help they need and you will help them by walking thru step by step until the solution/answer is found (or issue resolved).
You cannot run commands yourself but you can ask the user to run some commands and they will provide you with the output.
DO NOT provide a complete guide of all commands all at once.
@roychri
roychri / CDKGuide.txt
Created January 23, 2025 13:33
CDK Guide for LLM
Using local cdk
For the most part, this guide assumes you install the CDK Toolkit globally (npm install -g aws-cdk), and the provided command examples (such as cdk synth) follow this assumption. This approach makes it easy to keep the CDK Toolkit up to date, and since the CDK takes a strict approach to backward compatibility, there is generally little risk in always using the latest version.
Some teams prefer to specify all dependencies within each project, including tools like the CDK Toolkit. This practice lets you pin such components to specific versions and ensure that all developers on your team (and your CI/CD environment) use exactly those versions. This eliminates a possible source of change, helping to make builds and deployments more consistent and repeatable.
The CDK includes a dependency for the CDK Toolkit in the JavaScript project template's package.json, so if you want to use this approach, you don't need to make any changes to your project. All you need to do is use slightly different comma
@roychri
roychri / README.md
Created May 2, 2024 17:50
Stream Ollama (openai) chat completion API on CLI with HTTPie and jq

Stream Ollama (openai) chat completion API on CLI with HTTPie and jq

Explanation

This command sends a request to the Chat Completion API to generate high-level documentation for the file @src/arch.js. The API is configured to use the llama3-gradient model and to respond in Markdown format.

The messages array contains two elements:

  • The first element is a system message that provides the prompt for the API.
  • The second element is a user message that specifies the file for which to generate documentation.
@roychri
roychri / alpine_date_loop.sh
Created October 26, 2023 19:34
How to loop with unix timestamp modifier in busybox date (alpine)
#!/bin/sh
# Go back 1 hour for 1000 loops to add data to redis.
# Inspired by:
# * https://unix.stackexchange.com/questions/339938/busybox-date-command-set-time-with-unix-timestamp
# * https://unix.stackexchange.com/questions/22600/how-to-get-3-minutes-future-date
# * https://unix.stackexchange.com/questions/494581/date-command-in-busybox-not-accepting-formatted-input-date
for H in $(seq 1 1000); do
@roychri
roychri / package-lock.json
Created October 1, 2021 21:20
Sample Package for hello world
{
"name": "azure-hello-world",
"version": "1.0.0",
"lockfileVersion": 1
}
@roychri
roychri / async_test.js
Created August 21, 2020 14:20
How async function react to Throw
function otherFunctionResolve() {
return Promise.resolve();
}
function otherFunctionReject() {
return Promise.reject();
}
function otherFunctionThrow() {
throw new Error("oops");
@roychri
roychri / bull_arena_bulk_delete.sh
Created July 30, 2020 14:44
Script that delete large amount of bull jobs using arena's API
# Script that delete large amount of bull jobs using arena's API
#
# Requirements:
# * pup (https://github.com/ericchiang/pup)
# * sed
# * tr
# * curl
#
# This was tested with BASH
@roychri
roychri / 01-Dockerfile
Created April 7, 2018 12:17
Output of Dockerfile build and run
FROM node:9.9.0-alpine
ARG tag=latest
LABEL image=jaumard/test:${tag} \
maintainer="Jaumard" \
base=node:9.9.0-alpine
RUN set -ex