Skip to content

ChatGPT · Coding & Development

Code generation, debugging and documentation

83 prompts

Explain the Big O time and space complexity of this code step by step, as if teaching a junior developer. Point out the most expensive part and how input size affects it. Code: [paste code]

ChatGPT
Coding & Development

Explain Big O with my code

Understand time complexity using your own code.

0

Write a script in [language] that generates [number] realistic fake records for [entity, e.g. customers with orders] matching this schema: [schema]. Use a faker library, keep relationships consistent, and output as [SQL/JSON/CSV].

ChatGPT
Coding & Development

Generate realistic test data

Creates realistic fake data for development and tests.

0

Explain this stack trace in plain English. Identify where the error actually originates in my code (not library code), the likely cause, and how to fix it. Ask for the relevant code if needed. Stack trace: [paste]

ChatGPT
Coding & Development

Explain a stack trace

Reads a stack trace and points to the real problem.

0

Set up a monorepo for [apps and packages, e.g. web app, API and shared UI library] using [tool, e.g. pnpm workspaces / Turborepo / Nx]. Show the folder structure, config files, shared TypeScript config, build and test scripts, and CI caching.

ChatGPT
Coding & Development

Monorepo setup

Organises multiple apps and packages in one repository.

0

Set up error monitoring for a [stack] app in production. Explain what to capture (errors, context, releases), how to avoid logging sensitive data, alerting rules, and show the integration code for [tool or a generic logger].

ChatGPT
Coding & Development

Error monitoring setup

Catches and reports production errors before users complain.

0

Implement simple feature flags in [stack] without a paid service. Support on/off, percentage rollout and per-user overrides, store flags in [storage], and show how to use a flag in code and remove it cleanly later.

ChatGPT
Coding & Development

Feature flag implementation

Ships features safely with gradual rollouts.

0

Add a background job queue to my [framework] app for tasks like [tasks]. Recommend a queue library, show job definitions, retries with backoff, failure handling, scheduling, and how to run workers in production.

ChatGPT
Coding & Development

Background job queue

Moves slow tasks like emails and reports out of web requests.

0

Add internationalisation to my [framework] app for [languages]. Show the library setup, translation file structure, how to handle plurals, dates and currencies, language switching, SEO for localised pages, and right-to-left support if needed.

ChatGPT
Coding & Development

Internationalisation (i18n) setup

Adds multi-language support to your app.

0

This code is too clever and hard to read. Rewrite it for clarity: descriptive names, small functions, comments only where needed, and the same behaviour. Explain what the original was doing. Code: [paste code]

ChatGPT
Coding & Development

Code golf to clean code

Expands clever, cryptic code into readable code.

0

Write a Playwright script in [language] that [task, e.g. logs into a test site, fills a form and downloads a report]. Use robust selectors, waits instead of sleeps, screenshots on failure, and credentials from environment variables.

ChatGPT
Coding & Development

Browser automation script

Automates repetitive website tasks with Playwright.

0

Create a backup and restore plan for a [database] used by [app]. Include backup frequency, retention, off-site storage, encryption, an automated backup script, a restore test procedure, and monitoring for failed backups.

ChatGPT
Coding & Development

Database backup and restore plan

Protects your data with tested backups.

0

Write a React custom hook called [useSomething] that [purpose, e.g. fetches data with caching / debounces input / tracks window size]. Use TypeScript, handle cleanup and errors, and include usage examples and tests.

ChatGPT
Coding & Development

React custom hook

A reusable custom hook with clean state management.

0