Skip to content

Instantly share code, notes, and snippets.

View aessam's full-sized avatar
:octocat:
Doing code pushups

Ahmed Essam aessam

:octocat:
Doing code pushups
View GitHub Profile
@aessam
aessam / Codebase diagram.md
Created June 24, 2025 03:08
Generate multiple Mermaid diagrams for large codebases.

I have a large codebase that I want to understand better through visual architecture diagrams. Please analyze the project structure and create comprehensive Mermaid diagrams that help me understand the codebase at different levels of detail.

📋 Required Analysis

First, explore the codebase to understand:

  1. Project structure - root directories, main modules, configuration files
  2. Dependencies - internal dependencies between modules/packages
  3. Architecture patterns - layered architecture, microservices, monolith, etc.
  4. Key systems - core functionality areas (UI, backend, database, API, etc.)
  5. Technology stack - frameworks, languages, tools used
@aessam
aessam / claude-code-dependency-graph-prompt.md
Created June 22, 2025 21:45
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
import requests
def lookup_podcasts(search_term):
base_url = "https://itunes.apple.com/search"
params = {
"term": search_term,
"media": "podcast",
"limit": 10 # Adjust the limit as needed
}
@aessam
aessam / WorkDiary.md
Created February 18, 2023 23:24
A Template for a work diary that I do weekly, sharing it, incase it is helpful.

This Week plan

  • What I Am planing to do this week
    • Complete Big Task 1123
    • Big Task 2123

What Happened Last Week

  • Last week plan
    • Big Task 1
    • Big Task 1123
@aessam
aessam / Circles.swift
Created February 17, 2021 00:34
Drawing segments of a circle in SwiftUI
import SwiftUI
extension Color {
static var random: Color {
return Color(
red: .random(in: 0...1),
green: .random(in: 0...1),
blue: .random(in: 0...1)
)
}
@aessam
aessam / Picture-n-Picture.js
Created November 29, 2020 15:17
Control browser's video Speed (booklet)
javascript:(function()%7Bvar%20video%20%3D%20document.getElementsByTagName('video')%5B0%5D%3Bvideo.play()%3Bvideo.webkitSetPresentationMode(video.webkitPresentationMode%20%3D%3D%3D%20%22picture-in-picture%22%20%3F%20%22inline%22%20%3A%20%22picture-in-picture%22)%7D)()
@aessam
aessam / TakeBGOut.py
Created August 9, 2020 17:34
This is a quick script to extract background from image, it is based on lowpass filter
from PIL import Image, ImageDraw
import random
from sys import argv
image_name = ""
if len(argv) != 4:
print("My have input, output and factor")
exit()
else:
@aessam
aessam / windowShot.py
Last active May 2, 2020 10:47
Take a screenshot for a window, query by window title (windowShot.py 'Mail') output to tmp directory.
import os
from sys import argv
from Quartz import CGWindowListCopyWindowInfo, kCGWindowListExcludeDesktopElements, kCGNullWindowID,kCGWindowListOptionOnScreenOnly
windowList = CGWindowListCopyWindowInfo(kCGWindowListOptionOnScreenOnly | kCGWindowListExcludeDesktopElements, kCGNullWindowID)
systemWindows = ['SystemUIServer', 'Window Server', 'Spotlight']
searchname = argv[1].lower()
for i in windowList:
if searchname in i['kCGWindowOwnerName'].lower() and i['kCGWindowOwnerName'] not in systemWindows:
print(i['kCGWindowNumber'], i['kCGWindowOwnerName'])
os.system('screencapture -l{0} "tmp/{0}{1}.png"'.format(i['kCGWindowNumber'], i['kCGWindowOwnerName']))
@aessam
aessam / fullColorASCII.py
Created March 8, 2020 23:35
Not ASCII art.
from PIL import Image, ImageDraw
import sys
def rgb_2_pixels(fr, fg, fb, br, bg, bb, text='\u2584'):
fgc = "{0};{1};{2}".format(fr, fg, fb)
bgc = "{0};{1};{2}".format(br, bg, bb)
return "\033[38;2;{0};48;2;{1}m{2}\033[0m".format(fgc, bgc, text)
def morph_color(c1, c2):
return int((c1 + c2) / 2)
@aessam
aessam / helpers.swift
Created August 18, 2019 02:40 — forked from kastiglione/helpers.swift
Swift helpers, and the lldb setup to use them. Presented @ SLUG https://speakerdeck.com/kastiglione/advanced-debugging-and-swift
extension UIView {
/// Example: call someView.nudge(0, 30)
func nudge(_ dx: CGFloat, _ dy: CGFloat) {
self.frame = self.frame.offsetBy(dx: dx, dy: dy)
CATransaction.flush()
}
}
extension UIView {
/// Example: po UIView.root