Skip to content

Instantly share code, notes, and snippets.

View darko-mesaros's full-sized avatar
🎯
Focusing

Darko Mesaros darko-mesaros

🎯
Focusing
View GitHub Profile
@darko-mesaros
darko-mesaros / process.py
Created December 4, 2024 23:08
Processing data with Pandas
# HOMEWORK:
# The data processed by this code cannot be consumed by my event sender application
# WHY? It should be pretty obvious - drop the comment.
# Here is how the data looks like:
# [
# {
# "minute": 1,
# "event_type": "Foul",
# "side": "Home",
# "event_team": "Thunder FC",
@darko-mesaros
darko-mesaros / claude37.py
Created February 26, 2025 04:32
Invoke Claude 3.7 on Amazon Bedrock
import boto3
def process_stream_response(stream) -> None:
"""Process and print the streaming response from Claude.
Args:
stream: The response stream from the Bedrock API
"""
if not stream:
return
@darko-mesaros
darko-mesaros / Makefile
Created March 25, 2025 06:13
Rust + Postgres + Redis makefile
# Project configuration
PROJECT_NAME = rusty_databases
# Docker configuration
DOCKER = docker
POSTGRES_CONTAINER = $(PROJECT_NAME)_postgres
REDIS_CONTAINER = $(PROJECT_NAME)_redis
# Generate a random password (16 characters)
PG_PASSWORD := $(shell openssl rand -base64 12 | tr -d '\n')
@darko-mesaros
darko-mesaros / Makefile
Created July 1, 2025 14:01
sqlx migration with Postgres and DSQL
# Database migration targets
.PHONY: migrate clean-migrations
# Default target
help:
@echo "Available targets:"
@echo " make migrate dsql - Run migrations for DSQL"
@echo " make migrate pgres - Run migrations for PostgreSQL"
@echo " make clean-migrations - Clean the migrations directory"
@darko-mesaros
darko-mesaros / justfile
Created July 1, 2025 14:03
sqlx migration with Postgres and DSQL - justfile
# Database migration targets
# Show available recipes
default:
@echo "Available recipes:"
@echo " just migrate dsql - Run migrations for DSQL"
@echo " just migrate pgres - Run migrations for PostgreSQL"
@echo " just clean-migrations - Clean the migrations directory"
# Clean migrations directory
@darko-mesaros
darko-mesaros / justfile
Created October 8, 2025 15:10
Justfile I used for some CDK development
# Extract values with fallbacks using `jq` and shell fallbacks
USER_POOL_ID := `jq -r '.RustyLocksStack.userPoolId // "NOT_DEPLOYED"' outputs.json 2>/dev/null || echo "NOT_DEPLOYED"`
CLIENT_ID := `jq -r '.RustyLocksStack.userPoolClientId // "NOT_DEPLOYED"' outputs.json 2>/dev/null || echo "NOT_DEPLOYED"`
API_URL := `jq -r '.RustyLocksStack.apiUrl // "NOT_DEPLOYED"' outputs.json 2>/dev/null || echo "NOT_DEPLOYED"`
DISTRIBUTION_ID := `jq -r '.RustyLocksStack.distributionId // "NOT_DEPLOYED"' outputs.json 2>/dev/null || echo "NOT_DEPLOYED"`
# User credentials
EMAIL := "[email protected]"
PASSWORD := "TestPass123!#"