Skip to content

Instantly share code, notes, and snippets.

View martasd's full-sized avatar

Martin Dluhos martasd

  • itlab
  • Czech Republic
View GitHub Profile

USER: Hi. Could you please retrieve a record from dynamodb table ccr_trend_stats_TEST table on dev, which has product_attribute equal to 50881000705_568201?

AGENT: I'll help you retrieve the record from the DynamoDB table. Let me use the AWS CLI to query the table.

Command Executed:

aws dynamodb get-item --table-name ccr_trend_stats_TEST --key '{"product_attribute":{"S":"50881000705_568201"}}' --region us-east-1
@martasd
martasd / ProcessBatchesInParallel_output.json
Created September 18, 2025 09:23
ProcessBatchesInParallel
{
"productBatches": [
{
"batch_id": 0,
"product_list": [
"00299593545",
"00187000625",
"00187209845",
"00299590645",
"16110024530"
{
"options": [
{
"name": "Hotel Amaryllis",
"description": "Hotel **Amaryllis** v **Thameli** ponúka **bezplatné parkovanie s obsluhou** a **nočný klub**. K dispozícii sú aj **reštaurácia**, **bary** a **obchod s kávou**, pričom hostia môžu využiť aj **bezplatné WiFi** a **wellness služby**.",
"search_term": "Hotel Amaryllis",
"price_range": {
"min": 23.32,
"max": 34.98,
"type": "range"
@martasd
martasd / sum_intervals.py
Created November 22, 2023 14:26
Sum intervals
def sum_intervals(interval_list):
interval_list.sort(key=lambda lst: lst[0])
# sum numbers in the interval with the lowest begin number
begin, end = interval_list[0]
max = end
result = sum(range(begin, end + 1))
# sum numbers from the remaining intervals
for begin, end in interval_list[1:]: