Skip to content

Instantly share code, notes, and snippets.

View cx-recruiting's full-sized avatar

cx-recruiting

View GitHub Profile
@cx-recruiting
cx-recruiting / S3EventHandler.ts
Created March 24, 2025 17:41
Sample S3 Event Handler
/*
* Event:
* {
* "token": "ey...",
* "type": "request",
* "source": "api",
* "body": {
* "client": "ABC Partners",
* "uuid": "26acd459-e430-4ccc-a464-ca61b2a44c19",
* "path": "/holding/123",
# Assume transaction table has the following records:
# - 80 with status = 'approved'
# - 60 with amount > 1000
# - 30 with both status = 'approved' and amount > 1000
SELECT COUNT(*)
FROM transactions
WHERE status = 'approved' OR amount > 1000;
@cx-recruiting
cx-recruiting / products.sql
Last active April 3, 2025 15:45
Sample PostgreSQL Query
SELECT
p.product_name,
COUNT(o.order_id) as total_orders
FROM products p
JOIN orders o ON p.product_id = o.product_id
GROUP BY p.product_name
HAVING COUNT(o.order_id) >= 50
ORDER BY total_orders DESC;
import React, { useEffect, useState } from 'react';
interface Event {
id: number;
name: string;
date: string;
}
const EventTracker: React.FC = () => {
const [events, setEvents] = useState<Event[]>([]);