A simple Python Flask API for uploading files via curl or other HTTP clients.
- Simple API endpoint for file uploads
- Stores files locally in
uploads/directory - JSON responses
- Secure filename handling
| #!/usr/bin/env -S uv run | |
| # /// script | |
| # requires-python = ">=3.10" | |
| # dependencies = [] | |
| # [tool.uv] | |
| # exclude-newer = "2025-06-03T00:00:00Z" | |
| # /// | |
| """ | |
| Monitor TIME-WAIT connections and detect threshold violations. |
| #!/usr/bin/python3 | |
| # @lint-avoid-python-3-compatibility-imports | |
| # | |
| # tcpconnect Trace TCP connect()s. | |
| # For Linux, uses BCC, eBPF. Embedded C. | |
| # | |
| # USAGE: tcpconnect [-h] [-c] [-t] [-p PID] [-P PORT [PORT ...]] [-4 | -6] | |
| # | |
| # All connection attempts are traced, even if they ultimately fail. | |
| # |
| #!/usr/bin/python3 | |
| # @lint-avoid-python-3-compatibility-imports | |
| # | |
| # tcpconnect Trace TCP connect()s. | |
| # For Linux, uses BCC, eBPF. Embedded C. | |
| # | |
| # USAGE: tcpconnect [-h] [-c] [-t] [-p PID] [-P PORT [PORT ...]] [-4 | -6] | |
| # | |
| # All connection attempts are traced, even if they ultimately fail. | |
| # |
| #!/usr/bin/env -S uv run | |
| # /// script | |
| # requires-python = ">=3.10" | |
| # dependencies = [ | |
| # "pandas", | |
| # "matplotlib", | |
| # ] | |
| # /// | |
| import pandas as pd | |
| import matplotlib.pyplot as plt |
| #!/usr/bin/env -S uv run --script | |
| # /// script | |
| # requires-python = ">=3.10" | |
| # dependencies = [ | |
| # "bleak", | |
| # ] | |
| # [tool.uv] | |
| # exclude-newer = "2025-07-03T00:00:00Z" | |
| # /// |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Shoulder Mobility Assessment Calculator</title> | |
| <link rel="stylesheet" href="style.css"> | |
| <link rel="preconnect" href="https://fonts.googleapis.com"> | |
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
| <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet"> |
This repository contains a Python script, dspy_LabeledFewShot.py, that demonstrates how to use the dspy.teleprompt.LabeledFewShot optimizer for sentiment analysis.
The script defines a simple DSPy program to classify the sentiment of a sentence as "Positive", "Negative", or "Neutral". It then uses LabeledFewShot to "compile" this program by creating few-shot prompts from a small training set. Finally, it runs the compiled program on a new sentence and inspects the prompt sent to the Language Model (LLM) to show how the few-shot examples were included.
| #!/usr/bin/env -S uv run | |
| # /// script | |
| # requires-python = ">=3.13" | |
| # dependencies = [ | |
| # "mlflow", | |
| # "azureml-mlflow", | |
| # "azure-ai-ml", | |
| # "azure-identity", | |
| # ] | |
| # [tool.uv] |
| <!-- Taken from https://simonwillison.net/2025/Mar/28/incomplete-json-pretty-printer/ --> | |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>JSON Pretty Printer</title> | |
| <style> | |
| body { | |
| font-family: Arial, sans-serif; |