The following is a quick summary of About Copilot agents.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Octokit } from "octokit"; | |
import dotenv from "dotenv"; | |
dotenv.config(); | |
const octokit = new Octokit({ | |
auth: process.env.GITHUB_TOKEN, | |
}); | |
const username = process.argv[2] |
Follow the exercise from https://probot.github.io/docs/development.
Bonus:
-
Open your probot source directory in VSCode.
-
Add a new VSCode Launch config (Run > Add Configuration):
-
Go to https://github.com/robandpdx/octokit-js-demo > Code > Create codespace..
-
Give it a few minutes to set up.
-
Rename env.orig to .env and populate with your PAT and org name.
-
Add breakpoints in script.js.
View Answer
require "octokit"
octokit = Octokit::Client.new(access_token: ENV["GITHUB_TOKEN"])
Octokit.auto_paginate = true
View Answer
import { Octokit } from "octokit";
import dotenv from "dotenv";
dotenv.config();
const octokit = new Octokit({
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash -e | |
for commit in $(git log --format="%H"); do | |
size=0 | |
blobs=0 | |
IFS=$'\n' | |
for line in $(git log -1 --raw --no-merges --no-renames --no-abbrev --full-index --raw --pretty=oneline $commit | tail -n +2); do | |
id=$(echo $line | cut -d' ' -f4) | |
blob_size=$(git cat-file -s $id 2>/dev/null || echo 0) | |
(( size += blob_size )) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from aws_cdk import core | |
from my_python_sample.my_python_sample_stack import MyPythonSampleStack | |
app = core.App() | |
MyPythonSampleStack(app, 'my-python-sample', env={'region': 'ap-southeast-2'}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
""" slack_delete.py | |
Removes files uploaded to Slack | |
Usage: | |
virtualenv slack | |
source slack/bin/activate | |
pip install requests |
NewerOlder