Skip to content

Instantly share code, notes, and snippets.

@sukhbinder
sukhbinder / mtp-bench.py
Created May 22, 2026 19:26 — forked from am17an/mtp-bench.py
MTP benchmark
#!/usr/bin/env python3
import argparse, json, sys, time
from urllib import request
PROMPTS = [
{"name": "code_python", "prompt": "Write a Python function that returns the n-th Fibonacci number using memoization. Include a docstring."},
{"name": "code_cpp", "prompt": "Write a C++ template function `clamp(x, lo, hi)` that returns x clamped to [lo, hi]. No std::clamp."},
{"name": "explain_concept", "prompt": "Explain how speculative decoding works in large language model inference, in three short paragraphs."},
{"name": "summarize", "prompt": "Summarize in two sentences: The Industrial Revolution began in Britain in the late 18th century, transforming manufacturing through mechanization, steam power, and the factory system. It spread to continental Europe and North America during the 19th century."},
{"name": "qa_factual", "prompt": "Q: What are the four fundamental forces of physics?\nA:"},
@sukhbinder
sukhbinder / duckchat.py
Last active April 6, 2026 16:53
Chat with DuckDuckGo AI Chat CLI with Python
# /// script
# dependencies = [
# "requests",
# ]
# ///
import requests
import json
import sys
from threading import Thread
@sukhbinder
sukhbinder / move_files.md
Created November 1, 2024 09:17
Bash script to move files from a text file to a specified folder

For my video projects, i needed import few videos, they were already segreagated into folders with list of files

they look like this

IMG_7733.MOV
IMG_7734.MOV
IMG_7735.MOV
IMG_7736.MOV
IMG_7737.MOV
@sukhbinder
sukhbinder / comet plot with matplotlib.py
Created January 25, 2022 05:04
Comet Plot using matplotlib in python
import matplotlib.pyplot as plt
import numpy as np
def comet(x,y=None, time=0.05, fill=False):
"""
Displays a comet plot
by Sukhbinder
@sukhbinder
sukhbinder / Snowfall
Created January 10, 2022 12:18
Snowfall Animation using matplotlib
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.animation import FuncAnimation
"""
Snowfall with python matplotlib
Read more here https://sukhbinder.wordpress.com/?p=5193
by Sukhbinder
@sukhbinder
sukhbinder / drop_animation_with_message.py
Created November 2, 2021 08:02
Drops Animation for Creating a Quick Gif With a Message
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.animation import FuncAnimation
# Fixing random state for reproducibility
np.random.seed(9740320)
##
# Author : Sukhbinder
@sukhbinder
sukhbinder / python_chime.py
Created October 26, 2021 06:16
Make your computer chime
import sched
import time
import datetime
import subprocess
event_schedule = sched.scheduler(time.time, time.sleep)
def subprocess_say(msg):