Skip to content

Instantly share code, notes, and snippets.

View amithmkini's full-sized avatar

Amith Kini amithmkini

View GitHub Profile
@amithmkini
amithmkini / statusline.py
Created January 31, 2026 21:16
Claude Code statusline
#!/usr/bin/env python3
"""
Move the file to ~/.claude/statusline.py and
add the following to ~/.claude/settings.json
{
"model": "sonnet",
"statusLine": {
"type": "command",
@amithmkini
amithmkini / function-calling.tsx
Created April 6, 2024 00:47
Next.js function calling with RSC responses. I hate it.
const functions: ChatCompletionCreateParams.Function[] = [
{
name: 'query_database',
description: 'Query the database with a SQL query.',
parameters: {
type: 'object',
properties: {
query: {
type: 'string',
description: 'The SQL query to run on the database.'
@amithmkini
amithmkini / f1-stats-gpt-prompt.txt
Created March 26, 2024 17:56
Prompt for F1 Stats GPT
Your role is to be a Formula 1 expert, primarily focusing on querying SQLite database to answer questions. When users ask for F1 stats, historical data, or any information related to Formula 1 racing, you should leverage the Python SQLite package to generate queries, access the provided database (file-J1FPVPNEr9byJh6ZYX3EMT5O), and use the data to provide insightful, accurate charts and visualizations, if the dataset can be represented by a chart (use MatPlotLib). Use functions with args whenever possible so that you can plug in different values like drivers and year. Use full names for drivers to ensure you don't mix up drivers.
If a question can't be answered with a chart, provide detailed explanations or direct answers based on your extensive Formula 1 knowledge and the data within the database. Unless mentioned, a stat is usually asked about the current season, 2024, or of the previous season, 2023. Don't close the DB connection since users will follow up with new questions. Unless the statistics is on t
@amithmkini
amithmkini / chatgpt-api.py
Created March 3, 2023 17:12
Using OpenAI ChatGPT API with Python
# Store the API key in your env as follows:
# In .bashrc/.zshrc/ any rc
# export OPENAI_API_KEY="sk-testkey123testkey123"
# Extended code from https://til.simonwillison.net/gpt3/chatgpt-api
from datetime import datetime
import openai
class ChatBot:
@amithmkini
amithmkini / picam_test.py
Created July 2, 2017 15:17
Raspberry Pi Camera test
# import the necessary packages
from picamera.array import PiRGBArray
from picamera import PiCamera
import time
import cv2
# initialize the camera and grab a reference to the raw camera capture
camera = PiCamera()
camera.resolution = (640, 480)
camera.framerate = 32