Skip to content

Instantly share code, notes, and snippets.

@kunxin-chor
kunxin-chor / n8n-agent.json
Last active September 24, 2026 07:10
Starter n8n Agent
{
"nodes": [
{
"parameters": {
"options": {
"systemMessage": "You are helpful assistant. Use the available tools to answer the user's queries. ",
"returnIntermediateSteps": false,
"enableStreaming": true
}
},
You are the Human in the Loop Approval Agent for a class-booking workflow.
ROLE
You manage human approval requirements for business-tool calls.
You are a control agent, not a conversational assistant.
The Main Agent interacts with the user, selects business tools, prepares their arguments, and presents approval requests.
@kunxin-chor
kunxin-chor / nodes.json
Last active September 13, 2026 13:59
Gym Booking Data Table Tool Nodes
{
"nodes": [
{
"parameters": {
"dataTableId": {
"__rl": true,
"value": "xFMcB8ef1Si7Q7h9",
"mode": "list",
"cachedResultName": "bookings",
"cachedResultUrl": "/projects/Qj0a9yaxbvygPGXA/datatables/xFMcB8ef1Si7Q7h9"
@kunxin-chor
kunxin-chor / outline.txt
Created April 23, 2025 06:46
Outline for Lecture
Title: Engaging Students with Technology
1. Problem: There are too many distractions in class. Students are often distracted
2. Engagement is key. Make the lesson interactive
3. Another problem: However engagement can be difficult because
- students can be shy
- engagement takes up lesson time
4. We can use technology to boost engagement
5. Padlet: group discussion and sharing
6. Slido: Polls and Q&A
@kunxin-chor
kunxin-chor / gist:00305c0bf16e682e0bc5cbd3966653bf
Created September 13, 2024 01:30
Thymeleaf template inheritance
<html lang="en" xmlns:th="http://www.thymeleaf.org"
th:replace="~{base :: html(
~{::title},
~{::content},
~{},
~{}
)}">
@kunxin-chor
kunxin-chor / Main.java
Created September 5, 2024 11:29
Main.java template
public class Main {
public static void main() {
while (true) {
displayMenu();
int choice = getMenuChoice();
boolean keepRunning = processChoice(choice);
if (keepRunning == false) {
break;
}
@kunxin-chor
kunxin-chor / script.js
Created August 17, 2024 04:36
Create a leaflet map
// DOMContentLoaded event is executed when the DOM is ready
// (i.e all the HTML elements have been created), so it's
// a good starting point to run any code
document.addEventListener("DOMContentLoaded", async function(){
// the first argument of L.map is the ID
// where the map will be rendered (i.e drawn)
const map = L.map('map');
// two parameters for setView
// 1st: lat lng of the center of the map
// Tradable interface
interface Tradable {
double getCurrentMarketPrice();
void executeTransaction(boolean isBuy, int quantity);
}
// Insurable interface
interface Insurable {
double calculatePremium();
void fileClaim(String claimDescription);
@kunxin-chor
kunxin-chor / index.js
Created March 11, 2024 02:33
RESTFul API Template
// 1. REQUIRE DEPENDENCIES
const express = require('express');
const mongodb = require('mongodb');
const cors = require('cors');
const app = express();
// enable the use of JSON
app.use(express.json());
@kunxin-chor
kunxin-chor / pet_hospital.mysql
Created September 24, 2023 08:14
MySQL Database for Pet Hospital
-- Check if the database exists, if not, create it
CREATE DATABASE IF NOT EXISTS pet_hospital;
USE pet_hospital;
-- Create the `pets` table
CREATE TABLE IF NOT EXISTS pets (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
species VARCHAR(255) NOT NULL,
breed VARCHAR(255) DEFAULT NULL,