Skip to content

Instantly share code, notes, and snippets.

@compustar
compustar / ChatGPT (gpt-4o).txt
Last active May 14, 2024 17:14
Prompt collection of different chat agent
You are ChatGPT, a large language model trained by OpenAI, based on the GPT-4 architecture.
Knowledge cutoff: 2023-10
Current date: 2024-05-15
Image input capabilities: Enabled
Personality: v2
# Tools
You have the following tools:
Your role is to embody the persona of a typical user from LIHKG.com, a popular forum in Hong Kong. The forum is also known as 連登 locally. You're expected to express yourself in a way that's reflective of the community's culture, using specific phrases, Cantonese slang, and a certain level of humor or sarcasm common among its members, including being a bit rude and mean in a manner similar to these samples: "行咁慢 冇人識你呀, 阻撚住條路" ("Walking so slow, nobody knows you, blocking the way"), "大陸KOL求其一個都過百萬啦" ("Any random mainland KOL has over a million followers"), "明星出街都唔會咁啦" ("Even celebrities don't act like this when they go out"). This embodies the frank and direct tone often found in LIHKG discussions.
Make sure respond with direct and concise usually with no more than 2 sentences. Also, sentences are usually broken in lines. For example, instead of one complete sentence:
睇到右面碟肉就知靚野,一定濕潤彈牙有口感,餵狗都未必食。
Break it into three lines:
睇到右面碟肉就知靚野
一定濕潤彈牙有口感
餵狗都未必食
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 7 columns, instead of 4 in line 3.
Table Name,Column Name,Data Type,Description,Table Description,Column Description,Sample Value
DimAccount,AccountKey,int,Chart of accounts information. Defines the different financial accounts used in FactFinance. Primary key for the account dimension.,Chart of accounts information. Defines the different financial accounts used in FactFinance.,Primary key for the account dimension.,123
DimAccount,ParentAccountKey,int,"Chart of accounts information. Defines the different financial accounts used in FactFinance. Foreign key to DimAccount. Indicates a hierarchical relationship between accounts (e.g., a sub-account and its parent account).",Chart of accounts information. Defines the different financial accounts used in FactFinance.,"Foreign key to DimAccount. Indicates a hierarchical relationship between accounts (e.g., a sub-account and its parent account).",456
DimAccount,AccountCodeAlternateKey,int,Chart of accounts information. Defines the different financial accounts used in FactFinance. Alternate key for the
@compustar
compustar / QueueWorkerPool.py
Created November 18, 2024 12:36
A simple worker pool implementation using Python's threading and queue modules. This allows parallel execution of tasks by distributing them across a specified number of worker threads.
import threading
from queue import Queue
from typing import Callable, List
import logging
logger = logging.getLogger(__name__)
class QueueWorkerPool:
def __init__(self, num_worker_threads: int, fn: Callable[[int, List[int], Callable[[str, dict], None]], None]) -> None:
"""
@compustar
compustar / cap4.txt
Last active November 27, 2024 22:10
An Ordinance to consolidate and amend the law relating to financial products, the securities and futures market and the securities and futures industry, the regulation of activities and other matters connected with financial products, the securities and futures market and the securities and futures industry, the protection of investors, and othe…
To amend and consolidate the law relating to the constitution, jurisdiction, practice and powers of the High Court and the administration of justice therein and for matters ancillary thereto and connected therewith.
(Amended 25 of 1998 s. 2)
[20 February 1976] L.N. 50 of 1976
(Format changes—E.R. 1 of 2017)
Editorial Note:
The title of this Ordinance was amended from “Supreme Court Ordinance” to “High Court Ordinance” — see 25 of 1998 s. 2.
Part I
Preliminary
1.Short title
This Ordinance may be cited as the High Court Ordinance.

The "TokenTradingDApp" Investigation: A Journey Down the Malware Rabbit Hole

It started with a warning.

I was scrolling through my feed when I stumbled upon an article on dev.to by Anderson Contreira: Warning to developers: A new wave of technical test scams is targeting devs. The premise was chilling—attackers were posing as recruiters, sending developers "take-home assignments" that contained hidden malware.

Curiosity got the better of me. I wanted to see exactly how these scams worked. I didn't want to just read about it; I wanted to dissect it.

The Discovery