This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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!#" |
OlderNewer