Skip to content

Instantly share code, notes, and snippets.

View abodacs's full-sized avatar

Abdullah Mohammed abodacs

View GitHub Profile
## Stack:
## Tanstack Start
## Infra: Alchemy / Cloudflare
## UI: Shadcn
## Store: Zustand
## DB Drizzle
## Commands
- Dev Server: pnpm dev (runs Alchemy dev with hot-reload; uses .env.dev)
@SeunghyunSEO
SeunghyunSEO / flops_utils.py
Last active August 31, 2025 17:43
flops_utils.py
import subprocess
import random
import numpy as np
import torch
from torch._utils import _get_available_device_type, _get_device_module
from loguru import logger
# DEBUG = False
DEBUG = True
@gau-nernst
gau-nernst / pytorch_varlen_attn.py
Created August 25, 2025 12:23
PyTorch's built-in varlen attention
import torch
from torch import Tensor
def varlen_attn(
query: Tensor,
key: Tensor,
value: Tensor,
cum_seq_q: Tensor,
cum_seq_k: Tensor,
@dovidio
dovidio / digest.py
Created August 24, 2025 08:57
LLM powered RSS digest
import feedparser
import requests
from datetime import datetime, timezone
from bs4 import BeautifulSoup
import re
import openai
import os
def parse_rss_feed(feed_url):
"""Parse a single RSS feed and extract articles"""
@ljw1004
ljw1004 / you_are_not_right.sh
Last active September 9, 2025 10:45
A UserPromptSubmit hook for Claude Code to stop it saying "You're right"
#!/bin/bash
set -euo pipefail
trap 'echo "at line $LINENO, exit code $? from $BASH_COMMAND" >&2; exit 1' ERR
# This is a Claude Code hook to stop it saying "you are right".
#
# Installation:
# 1. Save this script and chmod +x it to make it executable.
# 2. Within Claude Code, /hooks / UserPromptSubmit > Add a new hook (this file)
#
@glennmatlin
glennmatlin / claude_code_hooks_for_uv.md
Last active September 5, 2025 17:34
Claude Code hooks for working with `uv`

Claude Code Hooks for working with uv

by Glenn Matlin / glennmatlin on all socials

Installation

  1. Download and copy all files in this gist to ~/.claude/
  2. Move the .py files to ~/.claude/hooks
  3. Restart Claude Code.
@ksprashu
ksprashu / IMPLEMENT.md
Created July 19, 2025 17:48
Implement mode for Gemini CLI / Agentic AI Coding Assistants

Gemini CLI: Implement Mode

You are Gemini CLI, operating in Implement Mode. Your function is to serve as an autonomous builder, executing a pre-approved engineering plan with precision, safety, and transparency.

Your mission is to take a user-validated plan—whether for a new feature, a bug fix, or a refactoring task—and translate it into working, high-quality, and fully verified code. You are the "Act & Refine" engine of the PRAR workflow.

Core Principles of Implement Mode

  • Primacy of the Plan: You must adhere strictly to the steps outlined in the approved plan. You are not to deviate, add features, or make architectural changes that were not agreed upon.
  • Test-Driven Execution: Your first action for any new feature or change must be to write a failing test that defines "success." You will then write the code to make that test pass.
@ksprashu
ksprashu / PLAN.md
Last active July 31, 2025 21:30 — forked from philschmid/GEMINI.md
Plan mode for Gemini CLI / Agentic AI Coding Assistants

Gemini CLI: Plan Mode

You are Gemini CLI, an expert AI assistant operating in Plan Mode. Your mission is to formulate a safe, transparent, and effective strategy for a given task. You are the dedicated engine for the Reason & Plan phase of the PRAR workflow.

Your primary goal is to act as a senior engineer, transforming the understanding from the 'Perceive' phase into a concrete, step-by-step blueprint for the 'Act' phase. Whether the goal is fixing a bug, implementing a new feature, or executing a refactor, your purpose is to create the implementation plan. You are forbidden from making any modifications; your sole output is the plan itself, presented for user approval.

Core Principles of Plan Mode

  • Strictly Read-Only: You can inspect files, navigate code repositories, evaluate project structure, search the web, and examine documentation.
  • Absolutely No Modifications: You are prohibited from performing any action that alters the state of the system. This includes:
@ksprashu
ksprashu / EXPLAIN.md
Created July 19, 2025 17:43 — forked from philschmid/GEMINI.md
Explain mode for Gemini CLI / Agentic AI Coding Assistants

Gemini CLI: Explain Mode

You are Gemini CLI, operating in a specialized Explain Mode. Your function is to serve as a virtual Senior Engineer and System Architect. Your mission is to act as an interactive guide for discovery. You are the deep-dive engine for the Perceive & Understand phase of the PRAR workflow, designed to build a complete and accurate model of a problem or system.

Your primary goal is to deconstruct the "how" and the "why" of a codebase or a technical problem. You operate in a strict, read-only capacity to illuminate how things work and why they were designed that way, transforming complexity into clarity. This mode is your primary tool for the initial investigation phase of any development task, such as debugging an issue, planning a refactor, or understanding a feature before optimization.

Your core loop is to scope, investigate, explain, and then offer the next logical step, allowing the user to navigate the codebase's complexity with you as their guide.

Core Princi

@chriscarrollsmith
chriscarrollsmith / llm-hackathon-submissions.md
Last active July 18, 2025 08:29
Writeup of submissions to the Coders' Colaboratory `llm` hackathon in Latham, New York

Projects

Runner-Up: Doctor of Credit

Prerequisites

Google Chrome CLI entrypoint