Skip to content

Instantly share code, notes, and snippets.

View SantonyChoi's full-sized avatar
🎯
Focusing

Hoon Choi SantonyChoi

🎯
Focusing
View GitHub Profile
@SantonyChoi
SantonyChoi / cursor-agent-system-prompt.txt
Created March 23, 2025 12:56 — forked from sshh12/cursor-agent-system-prompt.txt
Cursor Agent System Prompt (March 2025)
You are a powerful agentic AI coding assistant, powered by Claude 3.5 Sonnet. You operate exclusively in Cursor, the world's best IDE.
You are pair programming with a USER to solve their coding task.
The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.
Each time the USER sends a message, we may automatically attach some information about their current state, such as what files they have open, where their cursor is, recently viewed files, edit history in their session so far, linter errors, and more.
This information may or may not be relevant to the coding task, it is up for you to decide.
Your main goal is to follow the USER's instructions at each message, denoted by the <user_query> tag.
<communication>
1. Be conversational but professional.
@SantonyChoi
SantonyChoi / orderbook.py
Created November 15, 2023 03:46
ETH/BTC orderbook
import pandas as pd
btc_usd_buy = pd.DataFrame({"price": [59800, 59700], "volume": [1, 2]})
btc_usd_sell = pd.DataFrame({"price": [60000, 60100], "volume": [1, 2]})
eth_usd_buy = pd.DataFrame({"price": [3980, 3970], "volume": [10, 20]})
eth_usd_sell = pd.DataFrame({"price": [4000, 4010], "volume": [10, 20]})
eth_btc_buy_order_book = pd.DataFrame(columns=["price", "volume"])
eth_btc_sell_order_book = pd.DataFrame(columns=["price", "volume"])

Tool used

  • Postgresql

How I solved

  • Created a database and a table named "moloco_test".
  • Inserted all the data from the spreadsheet into the table.
  • Used Queries below for getting the answers

Queries

Q1.

import json
def getPopularProducts():
f = open("./sample_data.tsv")
summary = {}
for raw in f:
data = json.loads(raw)
pid = data["product_id"]
def equalsWhenOneCharRemoved(x, y):
if abs(len(x) - len(y)) != 1:
return False
has_removed = False
ix, iy = 0, 0
while ix < len(x) and iy < len(y):
if x[ix] != y[iy]:
if has_removed:
def equalsWhenOneCharRemoved(x, y):
if abs(len(x) - len(y)) != 1:
return False
has_removed = False
ix, iy = 0, 0
while ix < len(x) and iy < len(y):
if x[ix] != y[iy]:
if has_removed:
@SantonyChoi
SantonyChoi / SimpleHTTPServerWithUpload.py
Created September 8, 2017 16:25 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""