Skip to content

Instantly share code, notes, and snippets.

View pingkunga's full-sized avatar
🎯
Focusing

Chatri Ngambenchawong pingkunga

🎯
Focusing
View GitHub Profile
@pingkunga
pingkunga / YahooFinanceAPIWithSemanticKernel.cs
Created November 3, 2025 21:54
YahooFinanceAPIWithSemanticKernel
[KernelFunction]
[Description("Get basic market outlook from Yahoo Finance")]
public async Task<string> GetMarketOutlookAsync()
{
try
{
var url = "https://query1.finance.yahoo.com/v8/finance/chart/^GSPC?range=1d&interval=1d";
var response = await _httpClient.GetAsync(url);
response.EnsureSuccessStatusCode();
var data = await response.Content.ReadAsStringAsync();
@pingkunga
pingkunga / index.js
Created November 1, 2025 09:43
new-curator call Gemini to summary new in Thai Past 24 hr
import express from "express";
import dotenv from "dotenv";
import { GoogleGenAI } from "@google/genai";
const app = express();
app.use(express.json());
dotenv.config();
const port = process.env.PORT || 3000;
const apiKey = process.env.GEMINI_API_KEY;
const geminiAI = new GoogleGenAI({apiKey});
@pingkunga
pingkunga / LottoPlugin.cs
Created August 18, 2025 04:36
GetPrize2DigitHistoryAsync
#region> LottoAPI Integration
/// <summary>
/// Gets the prize 2 digit history from the LottoAPI with optional month and day
/// filters
/// </summary>
/// <param name="month">Optional month filter (1-12)</param>
/// <param name="day">Optional day filter (1-31)</param>
/// <returns>Prize 2 digit history as a JSON string</returns>
[KernelFunction]
@pingkunga
pingkunga / n8n_line_ai
Created August 13, 2025 13:37
สำหรับท่านใดที่ส่งข้อความหา line เพื่อตอบกลับจาก Ai agent แล้วบางกรณีติด * หรือ \ กวนใจ แนะนำ อันนี้เลยครับ เครียร์สะอาดมาก
let text = items[0].json.output;
// ลบโค้ดหลายบรรทัด
text = text.replace(/```[\s\S]*?```/g, "");
// ลบโค้ดบรรทัดเดียว
text = text.replace(/`([^`]+)`/g, "$1");
// ลบลิงก์ Markdown [text](url) ให้เหลือ text
services:
gitea-db:
image: postgres:17
container_name: Gitea-DB
security_opt:
- no-new-privileges:true
healthcheck:
test: ["CMD", "pg_isready", "-q", "-d", "gitea", "-U", "giteauser"]
timeout: 45s
interval: 10s
version: "3.8"
services:
ollama:
image: ollama/ollama
container_name: ollama
volumes:
- ollama_data:/root/.ollama
ports:
- "11434:11434"
@pingkunga
pingkunga / CreateRunnerNoteGitLab.md
Last active July 1, 2025 05:04
CreateRunnerNoteGitLab (Container Agent)
@pingkunga
pingkunga / .gitattributes
Created May 3, 2025 10:06
dotnet .gitattributes sample
# Normalize line endings for text files
# Set default behavior to automatically normalize line endings
* text=auto
# Explicitly declare text files we want to always be normalized and converted
# to native line endings on checkout.
*.cs text diff=csharp
*.csproj text
*.sln text
*.config text
@pingkunga
pingkunga / docker-compose.yaml
Last active April 12, 2025 23:46
jellyfin_hw_tran
services:
jellyfin:
image: jellyfin/jellyfin:latest
container_name: Jellyfin-HW-TRAN
# 1026:100 check on host > ls -n /volume1/docker/jellyfin_hw_tran
# user: 1026:100
environment:
TZ: Asia/Bangkok
volumes:
- /volume1/docker/jellyfin_hw_tran/config:/config:rw
class ATM:
def __init__(self, balance=0):
self.balance = balance
def deposit(self, amount):
if amount > 0:
self.balance += amount
return f"Deposit successful! New balance: ${self.balance:.2f}"
else:
return "Invalid deposit amount."