Skip to content

Instantly share code, notes, and snippets.

@omansour
omansour / KernelTerminateEvent.php
Last active December 22, 2015 03:48
exemple for collecting specific datas for the StatsdBundle
<?php
namespace M6\Bundle\DistributionBundle\EventDispatcher;
use Symfony\Component\EventDispatcher\Event;
/**
* Evènement surchargeant le kernel.terminate
*/
class KernelTerminateEvent extends Event
{
@omansour
omansour / test_strict_json.py
Created March 24, 2024 16:30
categorize user search
# usage echo 'soirée entre copines'| python test_strict_json.py'
# install strictjson
import os, sys
os.environ['OPENAI_API_KEY'] = 'fill'
from strictjson import *
input = sys.stdin.read().strip()
@omansour
omansour / ask-amazon-bedrock.py
Created April 3, 2025 13:30
python script, raycast ready, to ask question to claude 3.7
#!/Users/omsr/Documents/InternalWorkspace/raycast-ask-bedrock/venv/bin/python
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title ask claude 3.7
# @raycast.mode fullOutput
# Optional parameters:
# @raycast.icon 🤖
# @raycast.argument1 { "type": "text", "placeholder": "what do you want ?" }
@omansour
omansour / ask-amazon-bedrock-with-openAIsdk.py
Created August 13, 2025 08:27
calling bedrock with openAI SDK
import os, re
from openai import OpenAI
client = OpenAI(
base_url="https://bedrock-runtime.us-west-2.amazonaws.com/openai/v1",
api_key=os.getenv("AWS_BEARER_TOKEN_BEDROCK")
)
completion = client.chat.completions.create(
model="openai.gpt-oss-20b-1:0",
@omansour
omansour / 0_prompt_TwelveLabs_Pegasus.txt
Last active October 4, 2025 16:58
TwelveLabs Pegasus video analysis
"Analyze this video comprehensively and provide a detailed markdown report with the following sections:
# Quick Summary
Provide a one-line summary of the video content.
# Object Detections
List all objects you can detect with precise timestamps when they appear and disappear. Include logos, text, equipment, and any visual elements. Exclude peoples and animals. Format: Object Name (appears at MM:SS, disappears at MM:SS).
# Scene Detection
Break down the video into distinct scenes with timestamps and descriptions. Format: MM:SS-MM:SS: Scene description.