Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/camsong/chatgpt-engineer-prompts
Awesome ChatGPT prompts for engineers😇
https://github.com/camsong/chatgpt-engineer-prompts
Last synced: 24 days ago
JSON representation
Awesome ChatGPT prompts for engineers😇
- Host: GitHub
- URL: https://github.com/camsong/chatgpt-engineer-prompts
- Owner: camsong
- License: mit
- Created: 2023-02-06T13:18:02.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-28T21:43:12.000Z (about 1 year ago)
- Last Synced: 2024-10-04T10:45:20.284Z (about 1 month ago)
- Size: 180 KB
- Stars: 167
- Watchers: 6
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README-en.md
- License: LICENSE
Awesome Lists containing this project
- awesome-llm-prompt-libraries - ChatGPT Prompts For Engineers
README
# chatgpt-engineer-prompts 👩💻🧑💻
Practical Prompts for Engineers
## ChatGPT Usage Tips:
1. The ability to record the context, when a question does not get the desired answer, you can continue to pursue the question
2. Support mixed Chinese and English, you can flexibly switch between Chinese and English expressions in a question## Table of Contents
1. [Code Generation](#code-generation)
1. [Code Explanation](#code-explanation)
1. [Code Optimization](#code-optimization)
1. [Code Conversion](#code-conversion-js-to-typescript)
1. [Specify the return format](#specify-the-return-format)
1. [Regular Expression](#regular-expressions)
1. [Generate SQL](#generate-sql)
1. [Communication](#communication)## Code Generation
```
Use HTML and CSS to achieve a left-center-right three-column layout, with a fixed width of 100px on the left and right, and the middle to fill the remaining space
```
```
Use React to generate a login form with a username, password, and confirmation password.
```## Code Explanation
```
Explain this code:
export const useDeepMemo = (memoFn: () => V, key: K): V => {
const ref = useRef<{ key: K; value: V }>().if (!ref.current || !isEqual(key, ref.current.key)) {
ref.current = { key, value: memoFn() }.
}return ref.current.value.
}.
```## Code Optimization
```
Optimize the following code:
function bottom(layout: Layout): number {
let max = 0.
let bottomY.
for (let i = 0, len = layout.length; i < len; i += 1) {
bottomY = layout[i].y + layout[i].h.
if (bottomY > max) {
max = bottomY.
}
}
return max.
}
```Support for follow-up questions:
```
Why is it so optimized?
```## Code conversion: JS to TypeScript
```
Converting this code to TypeScript:
const useWrapperCallback = (callback, wrapperFunction) => {
const wrapperRef = useRef({
currentCall: callback.
returnCall: wrapperFunction(function (.. .args) {
return wrapperRef.current?.currentCall(. .args).
}).
}).wrapperRef.current.currentCall = useMemo(() => callback, [callback]).
return wrapperRef.
}
```## Specify the return format
Return JSON
```
Generate 3 test users' information in json object array format, including name, phone, email
```Return XML
```
Generate 2 test users' information and return it in xml format, including name, phone, email
```## Regular expressions
```
Write a JS regular expression that checks the strength of the password must contain a combination of upper and lower case letters and numbers, no special characters, and be between 8 and 10 in length.
```Can also interpret regular expressions
```
What is the meaning of this regular expression?
^[A-Z]:\\{1,2}[^/:\*\? <>\|]+\. (jpg|gif|png|bmp)$
```## Generate SQL
```
There is a salary table emp_salary, containing employee number emp_id, department name dep_name, salary salary, query each employee's salary and the average salary of his department
```
The following results are generated and the window function is also proficient in use:
```
SELECT
emp_id.
dep_name.
salary.
AVG(salary) OVER (PARTITION BY dep_name) AS avg_salary
FROM
emp_salary.
```! [image](https://user-images.githubusercontent.com/948896/223762204-ef3296bf-bb72-4b5c-a908-fd7d5be2e0b4.png)
You can also follow up to generate test data and view the results of sample runs at
! [image](https://user-images.githubusercontent.com/948896/223762643-fb17106b-6c54-4f36-9a66-6ca1ecf11ca6.png)
## Communication
```
Explain to a 6 year old why it is important to focus on the quality of the code
``````
Explain to bosses who don't understand technology why they need to do code refactoring frequently
```## WIP
New prompts is coming, stay tuned.