Skip to content

Instantly share code, notes, and snippets.

View abodacs's full-sized avatar

Abdullah Mohammed abodacs

View GitHub Profile
@abodacs
abodacs / claude-code-dependency-graph-prompt.md
Created July 1, 2025 16:20 — forked from aessam/claude-code-dependency-graph-prompt.md
Universal prompt for Claude Code to generate interactive multi-level dependency graphs for any codebase. Creates beautiful D3.js visualizations with 3 zoom levels: system overview (40k ft), module view (10k ft), and full dependency graph. Works with Rust, JavaScript, Python, Go, Java, and more.

Analyze this codebase and create a multi-level interactive dependency graph visualization as a single HTML file.

Level 1 - System Overview (40,000ft view):

  • Show only top-level directories/subsystems
  • Group by: Frontend, Backend, Core, Database, Tests, Tools, External
  • Display as large nodes with # of files and primary language
  • Show only major connections between subsystems

Level 2 - Module View (10,000ft view):

  • Show ~30-50 most important modules/packages
@abodacs
abodacs / commit-message-guidelines.md
Created June 23, 2025 12:00 — forked from okineadev/commit-message-guidelines.md
🤖 Copilot commit messages instructions for VS Code

Paste it to settings.json:

"github.copilot.chat.commitMessageGeneration.instructions": [
  {
    "text": "Follow the Conventional Commits format strictly for commit messages. Use the structure below:\n\n```\n<type>[optional scope]: <gitmoji> <description>\n\n[optional body]\n```\n\nGuidelines:\n\n1. **Type and Scope**: Choose an appropriate type (e.g., `feat`, `fix`) and optional scope to describe the affected module or feature.\n\n2. **Gitmoji**: Include a relevant `gitmoji` that best represents the nature of the change.\n\n3. **Description**: Write a concise, informative description in the header; use backticks if referencing code or specific terms.\n\n4. **Body**: For additional details, use a well-structured body section:\n   - Use bullet points (`*`) for clarity.\n   - Clearly describe the motivation, context, or technical details behind the change, if applicable.\n\nCommit messages should be clear, informative, and professional, aiding readability and project tracking."
  }
]
@abodacs
abodacs / agent loop
Created March 10, 2025 11:02 — forked from jlia0/agent loop
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
@abodacs
abodacs / grpo_qwen-0-5b_single_t4.ipynb
Created February 9, 2025 17:00 — forked from qunash/grpo_qwen-0-5b_single_t4.ipynb
grpo_qwen-0-5b_single_t4.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abodacs
abodacs / grpo_demo.py
Created January 28, 2025 00:15 — forked from willccbb/grpo_demo.py
GRPO Llama-1B
# train_grpo.py
import re
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
# Load and prep dataset
SYSTEM_PROMPT = """
Classify user search queries as either "Good Google Search Query" or "Bad Google Search Query" based on their likelihood of yielding relevant and helpful results from Google Search.
Input: User search query (text string).
Output: Classification label:
* Good Google Search Query: The query is likely to be effectively answered by Google Search.
* Bad Google Search Query: The query is unlikely to be effectively answered by Google Search. Further categorize "Bad" queries into subtypes for better understanding and classifier training (optional but highly recommended):
* Chit-Chat/Conversational/Social
* Personal/Subjective/Opinion-Based (Un-searchable)
* Vague/Ambiguous/Lacking Specificity
@abodacs
abodacs / contemplative-llms.txt
Created January 6, 2025 17:15 — forked from Maharshi-Pandya/contemplative-llms.txt
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
import multiprocessing
manager = multiprocessing.Manager()
all_hashes_set = manager.dict()
def deduplicate(examples, all_hashes_set):
print(len(all_hashes_set))
input_ids = examples['input_ids']
hashes = [
hash(tuple(input_ids[i]))
for i in range(len(input_ids))
@abodacs
abodacs / wrapper.py
Created November 23, 2024 11:56 — forked from charlesfrye/wrapper.py
Train GPT-2 in five minutes -- for free!
# Train GPT-2 in five minutes -- for free
#
# ```bash
# pip install modal
# modal setup
# modal run wrapper.py
# ```
#
# Note that the end-to-end latency the first time is more like 25 minutes:
# - five minutes to install Torch (rip)
@abodacs
abodacs / flux_infer.py
Created November 20, 2024 23:33 — forked from gau-nernst/flux_infer.py
FLUX CPU offload
import torch
from diffusers import FluxPipeline
from torch import nn
class ModelOffloaderV2:
def __init__(self, model: nn.Module, record_stream: bool = False):
# move model to pinned memory. keep a model copy in CPU pinned memory.
for p in model.parameters():
p.data = p.data.cpu().pin_memory()