this repository was initially created for a microsoft stu internal event to show our colleagues how easy it is to code with gh copilot, how it feels to develop with an autocomplete on steriods and teach them how to inspire customers to use gh copilot. it's current iteration will be used for a microsoft internal learning event.
- create a github account
- get access to github copilot
- setup
- option 1: gh codespaces
- option 2: local
- install the needed extensions for your ide
- install everything needed on your local pc (but not today - we use github codespaces!)
- have fun coding with github copilot! 🎉
- open the
app/views/index.ejs
file - change the background color to a css gradient of your choice
- add a button to the page
- add a div that displays a number
- add an on-click event to the button that increases the number by 1
tip: if you do not know how to do something, just ask github copilot chat for help :)
- add an input field for an email address and a "Submit" button to the page
- bonus points: center it vertically, add a label and a placeholder
- add an on-click event to the button that validates the email address
- if the email address is valid, display a success message, if the email address is invalid, display an error message
tip: use a regular expression to validate the email address
- add three buttons to the page
- one for scissors, one for paper, one for stone
- add an on-click event to every button to start a new game
- the computer should randomly choose one of the three options
- the user should be able to see the computers chouce, the result of the game and the score
tip: use a random number generator to let the computer choose one of the three options
- write tests for your game with all possible outcomes (scissors vs scissors, scissors vs paper, scissors vs stone, paper vs scissors, paper vs paper, paper vs stone, stone vs scissors, stone vs paper, stone vs stone)
- create a new file in the folder
app
calledgame.py
if your codespace asks you if you want to install the python extension, click yes
- use github copilot to translate your javascript code to python
- run your python code in the terminal and play the
- open the
app/utils.py
file - let github copilot chat explain you the code
- add meaningful comments to the code (rule of thumb for good comments: if you open the file in roundabout 6 months again, they should help you understand the code asap again :))
- distribute the regular expressions to different functions
- oh no! there is a bug 🐞 in the code. try to find out where and fix it!
- bonus ✨: write tests for the functions
- open the az-deploy.sh and create an azure deployment for your app with azure cli
- use environment variables for the resource group name, app service plan name, app service name and location
- create azure app service
- create a linux app service plan
- use node 18
- deploy your app
want to do your own github copilot demo? here are some tips:
- think about a simple but fitting use case (ask about the used programming languages in advance!)
- do a dry run and write down the steps you want to show
- do not get nervous if there are hallucinations, be precise in your prompting
- be aware if you are using codespaces or your local machine (the behaviour and possibilties might be different)
- things I usually show:
- inline generation of a function
- generate deployment script
- generate whole html page
- let github copilot chat explain a piece of code
- let github copilot chat write a test (and explain it)