Skip to content

Instantly share code, notes, and snippets.

# translate_srt_openai.py
import re, sys, time, tiktoken
from openai import OpenAI
client = OpenAI()
model = "gpt-4o" # Using GPT-4o which is officially supported
enc = tiktoken.encoding_for_model(model)
def clean_srt(path):
import re
@alrocar
alrocar / wrapped-tb-code.md
Created January 13, 2026 20:09
Tinybird Code prompt session for Tinybird Wrapped

User Prompts Timeline

December 12, 2025

10:34:23 - Create an endpoint (prefix with wrapped_) to sum all requests, add a parameter to filter by organization_id. Use a query like this:

SELECT * FROM ( SELECT

@alrocar
alrocar / wrapped_pipe_stats_summary.pipe
Created January 13, 2026 20:14
Tinybird Wrapped endpoint
DESCRIPTION >
Endpoint to get pipe statistics summary with wrapped_id filter, combining daily and historic monthly data.
Supports multiple wrapped_ids (comma-separated) for organizations split across regions.
NODE organization_lookup
SQL >
%
SELECT groupUniqArray(organization_id) as organization_ids
FROM wrapped_organizations
WHERE wrapped_id IN splitByChar(',', {{ String(wrapped_id) }})