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
package main | |
import ( | |
"context" | |
"errors" | |
"fmt" | |
"os" | |
"os/signal" | |
"syscall" | |
"time" |
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 | |
# Return a recursive digest of all files in the current directory, including modified ones. | |
set -eo pipefail | |
# ensure we're in a git repo and running from its root. | |
cd "$(git rev-parse --show-toplevel)" | |
# If the repo is completely clean, we can just print the current tree OID. | |
if [ -z "$(git status --porcelain)" ]; then |
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
gh api graphql \ | |
--paginate \ | |
--jq 'tostream | select(.[0][-1]=="login" and .[1]!=null) | .[1]' \ | |
-F owner=community \ | |
-F name=community \ | |
-F number=12341 \ | |
-f query=' | |
query($owner: String!, $name: String!, $number: Int!, $endCursor: String) { | |
repository(name: $name, owner: $owner) { | |
discussion(number: $number) { |
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
#!/bin/sh | |
set -euxo | |
cleanup() { | |
rm -f 1.mp4 2.mp4 3.mp4 4.mp4 palette.png | |
} | |
trap cleanup EXIT | |
# extend the last frame |
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 sh | |
set -euo pipefail | |
remote=`git remote |head -1` | |
repoNwo=`git remote get-url $remote | sed 's/.*://;s/\.git//'` | |
repoNodeId=`gh api repos/$repoNwo --jq '.node_id'` | |
branch=`git rev-parse --abbrev-ref HEAD` | |
newBranch="new-branch-$RANDOM" | |
contents=`echo -e 'Hello, GraphQL!\n' | base64` | |
expectedHeadOid=`git rev-parse HEAD` |
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
perl: warning: Setting locale failed. | |
perl: warning: Please check that your locale settings: | |
LANGUAGE = (unset), | |
LC_ALL = (unset), | |
LANG = "en_US.utf8" | |
are supported and installed on your system. | |
perl: warning: Falling back to the standard locale ("C"). |
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
gh api graphql --paginate -f query=' | |
query($endCursor: String) { | |
repository(owner: "OWNER", name:"REPO") { | |
pullRequests(first: 3, after: $endCursor, states: [OPEN], baseRefName: "master") { | |
nodes { | |
headRefName | |
} | |
pageInfo { endCursor hasNextPage } | |
} | |
} |
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
alias ports="gh codespace ports forward 80:80 2222:2222 3003:3003 3033:3033 3034:3034 3035:3035 3306:3306 8025:8025 9092:9092 9293:9293 15000:15000 15001:15001 15306:15306 18081:18081 8091:8091 9002:9002 28081:28081 9200:9200 40427:40427 45621:45621 35317:35317 45939:45939 43577:43577 33207:33207 38081:38081" | |
# until https://github.com/cli/cli/issues/6148 is fixed: | |
# copy from codespace | |
gh cs ssh --codespace $CODESPACE_NAME 'gzip < /path/to/some_file' | gunzip > some_file | |
# copy to codespace | |
gzip < some_file | gh cs ssh --codespace $CODESPACE_NAME 'gunzip > /path/to/some_file' |
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
def wrap(text) | |
result = [] | |
fenced = false | |
text.split(/\r?\n/).each do |line| | |
if line.start_with?("```") | |
fenced = !fenced | |
end | |
if fenced || line.size <= 72 | |
result << line | |
else |
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
gh api graphql --paginate -f query=' | |
query($endCursor: String) { | |
organization(login: "rails") { | |
repositories(first: 10, after: $endCursor, | |
orderBy: { field: STARGAZERS, direction: DESC } | |
) { | |
nodes { | |
url | |
stargazers { | |
totalCount |
NewerOlder