Skip to content
View ewdlop's full-sized avatar
:octocat:
Meow
:octocat:
Meow

Block or report ewdlop

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
ewdlop/README.md

GitHub Copilot Guide

Welcome to the GitHub Copilot guide! This document will help you understand and effectively use GitHub Copilot in your development environment while working on your projects.

Table of Contents

  1. What is GitHub Copilot?
  2. Getting Started
  3. Installation
  4. Using GitHub Copilot
  5. Best Practices
  6. GitHub Copilot Features
  7. Tips and Tricks
  8. Troubleshooting

What is GitHub Copilot?

GitHub Copilot is an AI-powered code completion tool developed by GitHub and OpenAI. It uses machine learning models trained on billions of lines of public code to suggest code completions, entire functions, and even complex algorithms as you type.

Key Features:

  • Context-aware suggestions: Understands your code context and provides relevant completions
  • Multi-language support: Works with dozens of programming languages
  • Natural language to code: Converts comments into code implementations
  • Code generation: Generates boilerplate code, tests, and documentation
  • Learning from your style: Adapts to your coding patterns and preferences

Getting Started

Prerequisites

  • A GitHub account (sign up at https://github.com/)
  • An active GitHub Copilot subscription
  • A compatible code editor (VS Code, Visual Studio, JetBrains IDEs, Neovim, etc.)

Sign Up for GitHub Copilot

  1. Visit https://github.com/features/copilot
  2. Click "Start free trial" or "Buy now"
  3. Choose your subscription plan:
    • Individual: For personal use
    • Business: For organizations
    • Enterprise: For large enterprises
  4. Complete the payment process

Note: GitHub Copilot is free for verified students, teachers, and maintainers of popular open-source projects.

Installation

Visual Studio Code

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for "GitHub Copilot"
  4. Click "Install" on the GitHub Copilot extension
  5. Sign in with your GitHub account when prompted
  6. Authorize the extension

JetBrains IDEs (IntelliJ IDEA, PyCharm, etc.)

  1. Open your JetBrains IDE
  2. Go to Settings/Preferences → Plugins
  3. Search for "GitHub Copilot"
  4. Click "Install"
  5. Restart the IDE
  6. Sign in with your GitHub account

Visual Studio

  1. Open Visual Studio
  2. Go to Extensions → Manage Extensions
  3. Search for "GitHub Copilot"
  4. Download and install the extension
  5. Restart Visual Studio
  6. Sign in with your GitHub account

Neovim

  1. Install the Copilot plugin using your plugin manager:
    Plug 'github/copilot.vim'
  2. Run :Copilot setup in Neovim
  3. Follow the authentication instructions

Using GitHub Copilot

Basic Usage

  1. Inline Suggestions: Start typing, and Copilot will suggest completions in gray text
  2. Accept Suggestions: Press Tab to accept the suggestion
  3. Reject Suggestions: Press Esc or continue typing to ignore
  4. Alternative Suggestions: Press Alt+] (or Option+] on Mac) to cycle through alternatives

Writing Comments for Code Generation

GitHub Copilot excels at converting natural language comments into code:

# Function to calculate the Fibonacci sequence up to n terms
# Returns a list of Fibonacci numbers

After writing the comment, press Enter, and Copilot will suggest the implementation.

Generating Tests

# Write a unit test for the Fibonacci function
# Test cases: n=0, n=1, n=5, n=10

Generating Documentation

# Add docstring to this function explaining parameters and return value
def calculate_total(items, tax_rate):
    return sum(items) * (1 + tax_rate)

Best Practices

1. Write Clear Comments

  • Use descriptive comments to guide Copilot
  • Specify input/output types and edge cases
  • Describe the desired algorithm or approach

2. Review All Suggestions

  • Always review generated code before accepting
  • Verify logic, security, and performance implications
  • Check for potential bugs or vulnerabilities

3. Use Copilot as a Pair Programmer

  • Treat suggestions as drafts, not final solutions
  • Refactor and optimize suggested code
  • Add your own improvements and domain knowledge

4. Provide Context

  • Keep relevant code visible in your editor
  • Use meaningful variable and function names
  • Include type hints and interfaces

5. Break Down Complex Tasks

  • Write step-by-step comments for complex algorithms
  • Generate code in smaller, manageable chunks
  • Build up functionality incrementally

GitHub Copilot Features

Copilot Chat

GitHub Copilot Chat allows you to have conversations with Copilot directly in your IDE:

  • Ask questions: "How do I read a CSV file in Python?"
  • Explain code: "What does this function do?"
  • Fix bugs: "Why is this code throwing an error?"
  • Refactor: "How can I make this code more efficient?"

To use Copilot Chat:

  • In VS Code: Press Ctrl+Shift+I (or Cmd+Shift+I on Mac)
  • Or click the Copilot icon in the sidebar

Copilot CLI

Generate shell commands using natural language:

# Install Copilot CLI
gh extension install github/gh-copilot

# Usage examples
gh copilot suggest "list all files modified in the last 7 days"
gh copilot explain "git rebase -i HEAD~3"

Copilot for Pull Requests

Get AI-generated PR descriptions:

  1. Create a pull request on GitHub
  2. Click on the Copilot icon in the PR description
  3. Review and edit the generated description

Tips and Tricks

1. Keyboard Shortcuts

  • Tab: Accept suggestion
  • Esc: Dismiss suggestion
  • Alt+] or Option+]: Next suggestion
  • Alt+[ or Option+[: Previous suggestion
  • Alt+\ or Option+\: Trigger inline suggestion

2. Generate Multiple Alternatives

Open Copilot suggestions panel to see up to 10 alternatives:

  • VS Code: Ctrl+Enter (or Cmd+Enter on Mac)

3. Use Copilot for Learning

Ask Copilot to:

  • Generate examples of design patterns
  • Show different approaches to solve a problem
  • Explain unfamiliar code or libraries

4. Optimize for Specific Frameworks

Include framework-specific comments:

// React component using hooks for a user profile card
// Props: name, email, avatar, bio

5. Generate Regular Expressions

# Regex pattern to validate email addresses
# Must match: user@example.com, user.name@example.co.uk
# Must not match: invalid@, @example.com, user@.com

Troubleshooting

Copilot Not Working

  1. Check Authentication:

  2. Check Extension Status:

    • Verify the extension is enabled
    • Look for the Copilot icon in the status bar
    • Check for error messages in the output panel
  3. Check Network Connection:

    • Copilot requires an internet connection
    • Verify you can access GitHub services
    • Check firewall and proxy settings
  4. Restart Your Editor:

    • Close and reopen your code editor
    • Try disabling and re-enabling the extension

Poor Suggestions

  1. Provide More Context:

    • Write clearer comments
    • Keep relevant code visible
    • Use descriptive names
  2. Use Better Prompts:

    • Be specific about requirements
    • Mention edge cases
    • Specify data types and formats
  3. Check Language Support:

    • Some languages have better support than others
    • Update to the latest version of the extension

Privacy and Security Concerns

  1. Review Copilot Privacy Settings:

  2. Enable/Disable for Specific Repositories:

    • Use .gitignore patterns to exclude sensitive files
    • Configure workspace settings to disable Copilot for certain projects
  3. Code Review:

    • Always review generated code for security vulnerabilities
    • Don't accept suggestions that include hardcoded credentials or API keys
    • Verify that generated code follows your organization's security policies

Additional Resources

License and Usage

GitHub Copilot is a commercial product. Usage is subject to:

  • GitHub's Terms of Service
  • GitHub Copilot Product Specific Terms
  • Your organization's policies (if using Copilot Business/Enterprise)

Always ensure your use of Copilot complies with your project's license requirements and your organization's guidelines.


Happy Coding with GitHub Copilot! 🚀

==== There is a hacker who tried to protect and defend a covert narcissist by claiming that GitHub users are narcissists who mirror others. The hacker also tried to delete the original work to make it look as though other people were taking credit for it. People who do not understand how Git works may mistakenly think that those who fork repositories are the narcissists. Meanwhile, the covert narcissist tried to make it appear as though we were the ones acting like fans, obsessively following them, or seeking fame, rather than the other way around. Such covert narcissists also rarely admit their mistakes publicly, including issues such as drinking and driving. Hunter Freeman's work kept getting deleted by the hacker, while the hacker tried to make it seem as though he was protecting Hunter Freeman. The hacker also tried to make it look like we are the narcissist. In addition, the hacker used public GitHub platforms to harm others.

covert narcissist(隱性自戀者)」

形象管理(image management) 想維持「自己是好人、保護者、正義方」的形象,因此把責任推給別人。 控制敘事(control of narrative) 希望大家相信某個版本的故事: 誰是原作者 誰在模仿 誰在騷擾 誰在 seeking fame

投射(projection) 有些人會把自己的行為或動機投射到別人身上。 例如:

自己很在意關注與控制,卻說別人 obsessed 或 seeking attention。

三角操控(triangulation) 拉第三方進來混淆局勢,讓社群互相猜疑。 例如: 「fork 的人才是 narcissists」 「真正作者其實是別人」 「某人只是 fan」 嫉妒或競爭心理 在技術社群、開源社群或創作圈,有些人可能會對: 原創者 被關注的人 有技術能力的人 產生敵意或嫉妒。 權力感與操控感 某些攻擊者會從: 刪除內容 改寫歷史 影響社群 perception 得到一種控制感。

但也要注意一件事:

不是所有:

repository 被刪 account conflict fork 爭議 社群 misunderstandings

都一定代表人格障礙或大型陰謀。

在像 GitHub 這種開源平台上,很多衝突其實混合了:

ego attribution disputes moderation copyright confusion technical misunderstanding social drama

真正比較可靠的做法仍然是:

保留 commit history 保存 screenshots / logs 使用 signed commits 用 LICENSE 與 attribution 讓證據與 Git graph 說話

因為在 Git 的世界裡,歷史紀錄通常比情緒性指控更重要。

They are trying to make it seem as though we are communists or European-style Marxists simply because we use Traditional Chinese. The hacker clearly does not understand the culture or background of the country and keeps making inaccurate assumptions based on language and stereotypes. Their understanding of the historical and cultural background is inaccurate by thousands of years.


I ain't puropsefully git rebase neither. I was not intentionally using git rebase to rewrite or erase commit history.

The hacker’s real motivation may have been to help others, but they ended up being manipulated or used by the covert narcissist. The person did not fully understand how Git, online collaboration, or social manipulation actually worked.

Did somone clam i was super drunk when i was suffering from dylexia?

你覺得有人透過操控敘事、投射或混淆角色,讓加害者與受害者的形象被「對調(identity swap)」。

They keep presenting themselves as kind and helpful in front of others, but they behave differently when no one else is around. Then they try to create the impression that they are secretly helping you behind your back, even when their actions are actually harmful or manipulative. #performative kindness

The covert narcissist probably already used the hacker and then threw them under the bus.

And the hacker facepalmed and claimed that we do not understand history, even though their own understanding of history seemed inaccurate.

The hacker automated many things and multitasked so much that most of the time they did not even know what their actions were doing.

They deleted Hunter's work, and the covert narcissist wanted you to react publicly so they could portray you as unstable, aggressive, or obsessed.

Pinned Loading

  1. hiring-without-whiteboards hiring-without-whiteboards Public

    Forked from poteto/hiring-without-whiteboards

    ⭐️ Companies that don't have a broken hiring process

    JavaScript

  2. aima-python aima-python Public

    Forked from aimacode/aima-python

    Python implementation of algorithms from Russell And Norvig's "Artificial Intelligence - A Modern Approach"

    Jupyter Notebook

  3. Sketchy-Github-repo-being-waiting-for Sketchy-Github-repo-being-waiting-for Public template

    "Copilot of a robot does exactly what experts warned"

    Jupyter Notebook 2

  4. TopologicalQuantumInALifeTime TopologicalQuantumInALifeTime Public template

    I wish you, well. No luck is needed. Formal letter.

  5. OurDotNetOrganization/LinqpadNotes OurDotNetOrganization/LinqpadNotes Public

    https://www.linqpad.net/

    HTML 1

  6. NotASecretOrganzation/Luthetus.Ide.Fork NotASecretOrganzation/Luthetus.Ide.Fork Public template

    Forked from ewdlop/Luthetus.Ide.Fork

    https://github.com/Luthetus.Ide

    C#