Skip to content

Instantly share code, notes, and snippets.

View theaigurux's full-sized avatar

theaigurux

  • Joined Apr 17, 2026
View GitHub Profile
@theaigurux
theaigurux / .py
Created April 17, 2026 18:25
Express needs 15 lines. Flask needs 12. FastAPI does it in 6. A fully typed, auto-documented REST API with validation. Copy this code. You'll never go back
# pip install fastapi uvicorn
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class Item(BaseModel):
name: str
price: float
in_stock: bool = True
@theaigurux
theaigurux / .py
Created April 17, 2026 17:02
Your AI chatbot confidently makes up answers. It hallucinates. It's wrong. Because it can't read YOUR documents. RAG fixes that in 20 lines of Python. 67% of production AI apps already use it.
# RAG Pipeline - Complete Working Example
# Install: pip install langchain langchain-openai langchain-community chromadb pypdf
import os
from langchain_community.document_loaders import PyPDFLoader, TextLoader, WebBaseLoader
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain_openai import OpenAIEmbeddings, ChatOpenAI
from langchain_community.vectorstores import Chroma
from langchain.chains import RetrievalQA
from langchain.prompts import PromptTemplate
@theaigurux
theaigurux / gist:8a73f92320af3a19ecd6a44865bdf1ab
Created April 17, 2026 16:42
Stop writing bad prompts. I have one prompt that you paste before any request and it turns your vague idea into a structured, expert-level instruction. Comment 'prompt gen' and I'll send it to you.
# Enhanced AI Prompt Generator
You are an AI-powered prompt generator, designed to improve and expand basic prompts into comprehensive, context-rich instructions. Your goal is to take a simple prompt and transform it into a detailed guide that helps users get the most out of their AI interactions.
## Your process:
1. **Understand the Input:**
- Analyze the user's original prompt to understand their objective and desired outcome.
- If the prompt is vague or ambiguous, infer the most useful interpretation AND note what clarifying questions you would ask.
- Consider: context, target audience, specific goals, constraints, and preferred depth level.
@theaigurux
theaigurux / gist:84dfe4df68fa0c129f6d96225cd03ee6
Created April 17, 2026 16:37
4 components. That's all you need to build AI apps that actually do something useful.
from langchain_openai import ChatOpenAI
from langchain.prompts import PromptTemplate
from langchain.agents import initialize_agent, AgentType
from langchain.tools import Tool
import requests
# 1. Prompt Template
prompt = PromptTemplate(
input_variables=["topic"],
template="Explain {topic} in 3 sentences for a developer audience."
@theaigurux
theaigurux / .js
Created April 17, 2026 16:31
"150,000 installs in 8 weeks. 6 million views on the demo. One prompt to Claude and it generates a full animated video in React. Remotion just changed everything."
import { useCurrentFrame, interpolate, AbsoluteFill } from 'remotion';
import { spring, useVideoConfig } from 'remotion';
// A simple fade-in text animation
export const MyVideo: React.FC = () => {
const frame = useCurrentFrame();
const { fps } = useVideoConfig();
// Fade in over 30 frames
const opacity = interpolate(frame, [0, 30], [0, 1], {
@theaigurux
theaigurux / .py
Created April 17, 2026 15:18
I type a message in Telegram. GPT reads it, thinks, and replies. In my chat. No app. No website. Just a bot I built in 25 lines of Python. Here's the full code.
# Telegram AI Assistant with GPT-4o
# Install: pip install python-telegram-bot openai
# Setup: Create bot via @BotFather on Telegram, get OpenAI API key
import os
from telegram import Update
from telegram.ext import (
Application,
CommandHandler,
MessageHandler,
@theaigurux
theaigurux / .py
Created April 17, 2026 15:07
Companies charge $50 a month for web scraping tools. Python does it in 8 lines. For free. Here's a scraper that pulls real data from any website. Copy it. Run it. Keep your money.
# pip install requests beautifulsoup4
import requests
import csv
from bs4 import BeautifulSoup
# Scrape Hacker News front page
url = 'https://news.ycombinator.com'
html = requests.get(url).text
soup = BeautifulSoup(html, 'html.parser')
titles = soup.select('.titleline > a')
@theaigurux
theaigurux / gist:092102fa3a770adda78319c3a19c010f
Created April 17, 2026 00:14
12,102 repos. 24,000+ plugins. I ranked the top ones so you don't have to scroll through GitHub for hours.
# Add a Claude Code plugin
# Method 1: From GitHub
claude plugin add github.com/user/plugin
# Method 2: From registry
claude plugin search "code review"
claude plugin install best-reviewer
# Method 3: Local development
@theaigurux
theaigurux / .py
Created April 17, 2026 00:01
Most Python developers write 10 lines of code where 1 would do. Here are 5 one-liners that will make your coworkers think you're a wizard. Number 3 replaced an entire function in my codebase.
from collections import Counter
# 1. Flatten a nested list
nested = [[1, 2], [3, 4], [5, 6]]
flat = [x for sub in nested for x in sub]
print(flat) # [1, 2, 3, 4, 5, 6]
# 2. Swap two variables
a, b = 10, 20
a, b = b, a