Chat GPT
Chat GPT
Spring 2023
Presentation based on the advanced ChatGPT course for Programmers from Programmer X
T. Yevenes
Master your productivity: ChatGPT
Content
1 Basic commands
Learn with ChatGPT
Learning routes and syllabus
Creative tasks
Professional emails
Advanced documents
Resumes
Interview preparation
2 Introduction to programming
Bug fixes
Algorithms
Code improvement
Language translation
Code testing
Computer's science
T. Yevenes
Master your productivity: ChatGPT
Content
3 Programation advance
Html
css
JavaScript
Tailwind
APIs
bash scripting
GIT
react
Dummy data
Typescript
SQL
NodeJS/Express
Python/Django
MongoDB/PostgreSQL
T. Yevenes
Master your productivity: ChatGPT
Prompt 1
What are the best resources to learn to program?
Online platforms
Books
Online tutorials
Interactive programming platforms
Online communities
Online courses
YouTube channels
Podcasts
Local communities
Online university courses
T. Yevenes
Master your productivity: ChatGPT
Prompt 1.1
Can you give me more details about the resources mentioned in
point 2?
T. Yevenes
Master your productivity: ChatGPT
Prompt 1.2
I was referring to books in Spanish.
T. Yevenes
Master your productivity: ChatGPT
prompt 2
What is the route to become a Frontend developer?
Programming Fundamentals
HTML and CSS
JavaScript
Frameworks and libraries
Development tools
Responsive Design
Testing and debugging
Task automation
Web accessibility
Additional knowledge
Personal projects
Learn from the community
Job search
T. Yevenes
Master your productivity: ChatGPT
Prompt 2.1
Can you give me the syllabus to learn HTML.
T. Yevenes
Master your productivity: ChatGPT
Creative tasks
prompt 3
Give me name ideas for an app for my startup that focuses on
selling furniture online.
FurnitureClick
FurnitureExpress
HouseComfort
FurnitureEasy
FurnitureWeb
FurnitureMarket
StoreFurnitureOnline
SofaShop
FurnitureDirect
ChairBuy
FurnitureWorld
T. Yevenes
Master your productivity: ChatGPT
Professional emails
Prompt 4
Write an email asking my boss for a raise as a Frontend
developer, I have worked in this company for 2 years and have
contributed as a mentor, team leader, and creating all our
documentation that did not exist using Swagger.
T. Yevenes
Master your productivity: ChatGPT
Advanced documents
Prompt 5
I want to hire a designer to design my website, we have agreed
that he will deliver the draft in a week and offer 2 iterations free
of charge, each iteration then charge 20 dollars an hour, write a
contract for us
T. Yevenes
Master your productivity: ChatGPT
CV
Prompt 6
I have 4 years of experience programming in HTML, CSS and
JavaScript, write a resume for me
Professional information
…
Work experience
I collaborated on user interface design and development
projects…
Interests
Stay up to date with the latest trends and advances in web
development…
T. Yevenes
Master your productivity: ChatGPT
CV
Prompt 6.1
I am applying for the Frontend programmer role at [company],
write a cover letter
[Your name]
[Your e-mail]
[Recruiter name]
[Recruiter email]
Technical skills
…
T. Yevenes
Master your productivity: ChatGPT
Interview preparation
Prompt 7
As a technical interviewee ask me 3 questions about CSS.
What are selectors in CSS and how do they work? Can you
mention examples of advanced selectors that are used to target
specific elements on a web page?
T. Yevenes
Master your productivity: ChatGPT
Interview preparation
Prompt 7.1
What is the answer to the first question?
T. Yevenes
Master your productivity: ChatGPT
Interview preparation
Prompt 7.2
Can you give me the official documentation on this topic?
Books on CSS - You can also check out books on CSS, such
as "CSS: The Definitive Guide" by Eric Meyer or "CSS Secrets"
by Lea Verou,
T. Yevenes
Master your productivity: ChatGPT
Html
Prompt 8
Create only the HTML code to render an accordion (do not
include CSS or JavaScript)
<!DOCTYPE html>
<html>
<head>
<title>Simple Accordion</title>
</head>
<body>
<div class="accordion">
<div class="item">
<button class="title">Section 1</button>
<div class="content">
…
T. Yevenes
Master your productivity: ChatGPT
css
Prompt 9
Create the styles with modern colors for this HTML code. (attach
HTML code)
<!DOCTYPE html>
<html>
<head>
<title>Modern Accordion</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
}
…
T. Yevenes
Master your productivity: ChatGPT
JavaScript
Prompt 10
Replaces the logic of opening my accordion elements from
HTML and CSS, using JavaScript. (attach HTML code)
<!DOCTYPE html>
…
<script>
const titles = document.querySelectorAll('.title');
titles.forEach(title => {
title.addEventListener('click', () => {
const item = title.parentElement;
const content = item.querySelector('.content');
…
T. Yevenes
Master your productivity: ChatGPT
JavaScript
Prompt 11
Give me the code to create an accordion element using HTML,
CSS and JavaScript, use modern styles and colors.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-
scale=1.0">
<title>Modern Accordion</title>
<style>
body {
font-family: Arial, sans-serif;
}
…
T. Yevenes
Master your productivity: ChatGPT
JavaScript
Prompt 11.1
The content is not displayed when clicking, it seems that the
code has errors. You can fix it?
<!DOCTYPE html>
…
<script>
const accordions = document.querySelectorAll('.accordion');
accordions.forEach(accordion => {
const header = accordion.querySelector('.accordion-header');
const content = accordion.querySelector('.accordion-content');
…
T. Yevenes
Master your productivity: ChatGPT
Bug fixes
Prompt 12
UncaughtTypeError; Cannot read property 'prop' of undefined.
T. Yevenes
Master your productivity: ChatGPT
Bug fixes
Prompt 12.1
Can you give me the answer in Spanish?
T. Yevenes
Master your productivity: ChatGPT
Tailwind
Prompt 13
Can you replace this CSS code and use Tailwind?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-
scale=1.0">
<title>Modern Accordion</title>
<link href="https://cdn.jsdelivr.net/npm/ tailwindcss@2.2.7
/dist/tailwind.min.css" rel="stylesheet">
</head>
<body>
…
T. Yevenes
Master your productivity: ChatGPT
APIs
Prompt 14
Write JavaScript code to place a request at /api/metas/
fetch('/api/goals/')
.then(response => {
if (!response.ok) {
throw new Error('Request error');
}
return response.json();
})
.then(data => {
// Do something with the received data, for example:
console.log('Data received:', data);
})
…
T. Yevenes
Master your productivity: ChatGPT
APIs
Prompt 14.1
Can you use Axios instead of Fetch?
T. Yevenes
Master your productivity: ChatGPT
bash scripting
Prompt 15
Write a Bash command to read all the Markdown files in a folder
and merge the contents of each into a new Markdown file
T. Yevenes
Master your productivity: ChatGPT
GIT
Prompt 16
How to create a new GIT branch and include an old commit?
Make sure you are on the branch from which you want to
create the new branch and to which you want to add the old
commit.
git Branch
Switch to the new branch you just created using git checkout or
git switch
git checkout new-branch
# Or in Git 2.23 and later:
git switch new-branch
T. Yevenes
Master your productivity: ChatGPT
GIT
Once in the new branch, you can add the old commit. To do
this, you must first find the hash (unique identifier) of the old
commit. You can do this using git log to see the commit history
gitlog
Finally, verify that the old commit was added correctly using git
log on the new branch
gitlog
T. Yevenes
Master your productivity: ChatGPT
Algorithms
Prompt 17
Give me the code for a sorting algorithm in JavaScript.
function bubbleSort(arr) {
var len = arr.length;
var swapped;
do {
swapped = false;
for (var i = 0; i < len - 1; i++) {
if (arr[i] > arr[i + 1]) {
var temp = arr[i];
arr[i] = arr[i + 1];
arr[i + 1] = temp;
swapped = true;
}
}
…
T. Yevenes
Master your productivity: ChatGPT
Code improvement
Prompt 18
Can you improve this code? (attach code)
function bubbleSort(arr) {
const len = arr.length;
let swapped;
do {
swapped = false;
Language translation
Prompt 19
Translate this algorithm and use Python.
def bubble_sort(arr):
n = len(arr)
swapped = True
while swapped:
swapped = False
T. Yevenes
Master your productivity: ChatGPT
Language translation
Prompt 19.1
What does this line do? (attach line)
The line `for i in range(n - 1):` is a `for` loop that loops through a
sequence of `i` values from 0 to `n - 2`.
For example, if `n` is equal to 5, the `for` loop will iterate from `i =
0` to `i = 3`, allowing you to compare and, if necessary, swap the
elements in the array positions from 0 to 3.
T. Yevenes
Master your productivity: ChatGPT
Code testing
Prompt 20
Write tests for this code. (attach code)
T. Yevenes
Master your productivity: ChatGPT
Code testing
T. Yevenes
Master your productivity: ChatGPT
Code testing
Prompt 20.1
Write tests for Jess. (attach code)
T. Yevenes
Master your productivity: ChatGPT
react
Prompt 21
Create an accordion component using React.
function Accordion() {
const [isOpen, setIsOpen] = useState(false);
return (
<div className="accordion">
<div className="accordion-header" onClick={toggleAccordion}>
…
T. Yevenes
Master your productivity: ChatGPT
Typescript
Prompt 22
Use Typescript for the accordion component. (attach code)
function Accordion() {
const [isOpen, setIsOpen] = useState<boolean>(false); // Add
boolean type annotation
return (
<div className="accordion">
<div className="accordion-header" ={toggleAccordion}>
…
T. Yevenes
Master your productivity: ChatGPT
Dummy data
Prompt 23
Generates dummy data for a table called users, each user must
have a first name, a last name, an address and an id.
T. Yevenes
Master your productivity: ChatGPT
Dummy data
Prompt 23.1
Give me the SQL query to insert this data.
T. Yevenes
Master your productivity: ChatGPT
SQL
Prompt 24
Create a table of goals, each goal has an id, description,
deadline, completed. Use SQL
T. Yevenes
Master your productivity: ChatGPT
SQL
Prompt 24.1
Add the day, month, year column.
T. Yevenes
Master your productivity: ChatGPT
SQL
Prompt 24.2
Can you use only one column for day, month, year?
T. Yevenes
Master your productivity: ChatGPT
SQL
Prompt 24.3
Create the query to get all completed goals
T. Yevenes
Master your productivity: ChatGPT
NodeJS/Express
Prompt 25
Create an API to return a list of goals from the url /api/metas,
each goal has an id, description, deadline_date, completed. Use
NodeJS and Express.
T. Yevenes
Master your productivity: ChatGPT
Python/Django
Prompt 26
Create an API to return a list of goals from the url /api/metas,
each goal has an id, description, deadline_date, completed. Use
NodeJS and Express.
class Meta(models.Model):
description = models.CharField(max_length=200)
deadline_date = models.DateField()
completed = models.BooleanField(default=False)
def __str__(self):
return self.description
…
T. Yevenes
Master your productivity: ChatGPT
MongoDB/PostgreSQL
Prompt 27
Create the model or schema for a user in NodeJS.
T. Yevenes
Master your productivity: ChatGPT
MongoDB/PostgreSQL
Prompt 27.1
Can you create it to connect to a PostgreSQL database?
const usersData = [
{ ID: 1, First name: 'Juan', Last name: 'Pérez', Address: 'Calle
Principal, 123' },
{ ID: 2, First name: 'María', Last name: 'López', Address: 'Avenida
Central, 456' },
{ ID: 3, First name: 'Carlos', Last name: 'Rodríguez', Address:
'Plaza del Sol, 789' },
{ ID: 4, First name: 'Laura', Last name: 'García', Address: 'Paseo
de la Luna, 101' },
…
T. Yevenes
Master your productivity: ChatGPT
Computer's science
Prompt 28
What is the time complexity of this algorithm? (attach code)
T. Yevenes
Master your productivity: ChatGPT
Spring 2023
Presentation based on the advanced ChatGPT course for Programmers from Programmer
T. Yevenes