Skip to content

Instantly share code, notes, and snippets.

View oNddleo's full-sized avatar
🎯
Focusing

Nguyễn Đức Long oNddleo

🎯
Focusing
View GitHub Profile
@oNddleo
oNddleo / query-billion.sql
Created July 1, 2025 03:34
Query Billion
SELECT symbol, close, date
FROM public.historical_data
WHERE symbol IN ({placeholders})
AND date BETWEEN %s::date AND %s::date
AND close IS NOT NULL
ORDER BY symbol, date
@oNddleo
oNddleo / config.yaml
Created June 24, 2025 04:12 — forked from taroj1205/config.yaml
Komorebi and Yasb Bar Configuration
watch_stylesheet: true
watch_config: true
debug: false # Enable debug mode to see more logs
# This komorebi setting will be used for tray context menu.
# If you don't use komorebi, you can remove this section.
komorebi:
start_command: "komorebic start --whkd"
stop_command: "komorebic stop --whkd"
reload_command: "komorebic reload-configuration"
@oNddleo
oNddleo / go-pprof.md
Created June 2, 2025 02:24 — forked from andrewhodel/go-pprof.md
Go profiling with pprof

Importing net/http/pprof adds HTTP endpoints to serve profile files that can be viewed or charted with a command line tool when the runtime.Set* functions are executed.

1. import pprof into the go program

import _ "net/http/pprof"

If your application is not already running an http or https server, add net/http to the program imports and the following code to the start of the main function:

go http.ListenAndServe(":8550", nil)
# Kaarma Question
- The maximum number of people (default) when unchecking unlimited guest? Which event for that? All of event type or which one?
- Does visible only to group of friends in only private event?
- Send invitations, polls is feature for private event?
- In public template event and schedule event -> all user can see that?
@oNddleo
oNddleo / design-system-oms.md
Created March 14, 2025 10:03
Design system OMS

Technical summary Ultra Scale Kafka system

Core

  1. Apache Kafka

    • Usage: Message broker infrastructure, topic management, partition replication
    • Key Components: Kafka Streams API for processing, AdminClient for topic management
  2. Apache Avro

  • Usage: Schema definition, binary serialization/deserialization
@oNddleo
oNddleo / processing.md
Created March 10, 2025 09:48
Compare java and go processing

Thread and Worker Models for Kafka Event Processing

I'll implement worker/thread models for processing the Kafka order events in Java and compare with another language (Go), including pros and cons of each approach.

Java Implementation: Thread Pool Worker Model

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
@oNddleo
oNddleo / kafka-event.md
Created March 10, 2025 09:45
Kafka event

Kafka Event Definition for Order Management in Trading

Here's a comprehensive definition for Kafka events in an order management trading system with hash verification for message producers:

{
  "eventType": "ORDER_CREATED",
  "version": "1.0",
  "timestamp": "2025-03-10T08:45:32.215Z",
 "orderId": "ORD-12345678",
@oNddleo
oNddleo / spdjindex.md
Last active March 10, 2025 09:44
SpdjIndex

I'll provide you with an example of using the sane_finances library to export S&P Dow Jones Indices (SPDJI) data in Python.

from decimal import Decimal
from datetime import date, datetime
import pandas as pd
from sane_finances.sources.spdji.v2021.exporters import SpdjIndicesExporter
from sane_finances.sources.spdji.v2021.parsers import SpdjIndicesParser

def export_spdji_index(index_code, start_date, end_date, output_file=None):
@oNddleo
oNddleo / detail.md
Created March 10, 2025 03:44
Trading system

Detailed Trading System Design

Let's delve deeper into the architecture, data models, and flows for your trading system:

Data Layer: Detailed Design

Database Schema

Market Data (TimescaleDB/InfluxDB)

@oNddleo
oNddleo / docker-maven.md
Created March 7, 2025 08:45
Docker Maven jdk23

Here's a Dockerfile that uses Maven 4 and JDK 23:

FROM eclipse-temurin:23-jdk-jammy

# Set Maven version
ENV MAVEN_VERSION 4.0.0
ENV MAVEN_HOME /usr/share/maven
ENV MAVEN_CONFIG "/root/.m2"