Skip to content

Instantly share code, notes, and snippets.

View roelven's full-sized avatar

Roel van der Ven roelven

View GitHub Profile
@roelven
roelven / ha_samsung_frame_instructions.md
Last active November 4, 2025 12:25
Set up your Samsung Frame TV with correct status tracking in Home Assistant

Set up your Samsung Frame TV with correct status tracking in Home Assistant

  1. Set up your TV + connect it to your LAN
  2. Install the HA Samsung Smartthings integration
    • Make sure to connect it to your Samsung account, so that the integration will automatically provide the auth token in the next step.
    • Read more here
  3. Install ha-samsungtv-smart using HACS
  4. Configure the integration, make sure to turn your TV on as you'll need to approve this on your Frame.
  5. Add the following snippet to your HA configuration.yaml:
@roelven
roelven / call-sora.sh
Created October 24, 2025 13:59
Generate Sora 2 videos by calling the API directly.
#!/usr/bin/env bash
# Simple CLI for OpenAI Sora 2 video generation.
# Requirements: bash, curl, jq
# Usage examples at bottom.
set -euo pipefail
API_BASE="${OPENAI_API_BASE:-https://api.openai.com}"
API_KEY="YOUR_API_KEY"
MODEL="${MODEL:-sora-2}" # or "sora-2-pro"
@roelven
roelven / improve_prompt.sh
Last active October 9, 2025 12:14
Prompt my prompt: a Raycast script to improve your prompts.
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Prompt my prompt
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🤖
# @raycast.packageName Prompt Tools
@roelven
roelven / bootstrap.sh
Created October 4, 2025 14:13
Agentic / CLI development in an isolated VM using Proxmox
# bootstrap_devbox.sh (Ubuntu 24.04 LTS)
# Run once as root: sudo bash /tmp/bootstrap_devbox.sh
set -euo pipefail
# ===== Config (edit as needed) =====
TZ="Europe/Berlin"
# Auto-detect first non-root login; override by exporting TARGET_USER before running
TARGET_USER="${TARGET_USER:-$(logname 2>/dev/null || getent passwd 1000 | cut -d: -f1)}"
TARGET_HOME="$(getent passwd "$TARGET_USER" | cut -d: -f6)"
DOCKER_REMOTE_HOST="${DOCKER_REMOTE_HOST:-docker-host.local}" # e.g., docker-host.lan
@roelven
roelven / .rules
Created August 25, 2025 09:43
My .rules file used in Zed, added to each project.
### Process Flow
- **ASK FIRST**: When missing information or context before starting implementation, always ask the user for clarification
- **TDD SEQUENCE**: Always follow this exact sequence: write test → create code → verify all tests pass → git commit
- **USE FULL PATHS**: When executing commands, always use full paths, never relative paths. Do not assume you're in the project directory
### Testing Constraints
- **10-SECOND TIMEOUT**: All unit tests must have timeouts. Test suites must not exceed 10 seconds total runtime
- **NO STUCK TESTS**: Implement timeouts to prevent AI agent from getting stuck on hanging tests
### Dev Rules

🚀 Claude Code Quick Start Guide

📋 What We're Building

A professional Claude Code environment using:

  • Docker for isolated development environments
  • Node.js 24 for running Claude Code
  • Git for version control, zsh for better UX
  • Claude Code Router for more cost-effective agentic coding
@roelven
roelven / convert_subtitle.py
Created June 25, 2025 15:08
Python script to convert Youtube subtitles to txt files
#!/usr/bin/env python3
import json
import re
#
# Convert Youtube subtitle to txt file
#
# Look for `https://www.youtube.com/api/timedtext` in your browser network tab
# on a youtube video. Copy the response into a subtitle.json file and save this
# script in the same folder.
@roelven
roelven / docker-compose.yml
Last active May 25, 2025 20:15
A Docker Compose file to self-host a CouchDB instance for Obsidian Livesync
services:
couchdb:
image: couchdb:latest
container_name: obsidian-livesync
# user: 1000:1000 # You may need to adjust this depending on your host system's user/group IDs for file permissions
environment:
- COUCHDB_USER=${COUCHDB_USER}
- COUCHDB_PASSWORD=${COUCHDB_PASSWORD}
volumes:
- /docker/volumes/obsidian-livesync/data:/opt/couchdb/data
@roelven
roelven / cursor_rules.md
Last active July 4, 2025 08:17
Cursor Rules

Core Rules (Always Active)

Context

You are assisting an experienced technical product manager at Spotify. Most questions require Spotify internal knowledge - use MCP servers to fetch internal documentation when needed. Provide Spotify internal links and references when applicable.

Core Behavior

  • You are an agent - keep going until the query is completely resolved
  • If unsure about file content or Spotify context, use tools to gather information - don't guess
  • Plan extensively before function calls and reflect on outcomes
  • Be concise and use Markdown for non-code responses
@roelven
roelven / raycast_openai_translate_instantly.md
Last active May 1, 2025 14:48
Instantly Translate or Correct Clipboard Text into German with Raycast + OpenAI

Instantly Translate or Correct Clipboard Text into German with Raycast + OpenAI

This Raycast Script Command lets you instantly translate and correct any text (poor German, English, Dutch, etc.) into grammatically correct German — triggered by a shortcut on macOS.

The script:

  • Reads the current clipboard text
  • Checks if the clipboard contents don't look like a password
  • Sends it to OpenAI's GPT-4 Turbo model
  • Receives corrected German