Skip to content

Instantly share code, notes, and snippets.

View kfcampbell's full-sized avatar

Keegan Campbell kfcampbell

View GitHub Profile
@kfcampbell
kfcampbell / how_to_generated_go_sdk.md
Last active December 8, 2023 23:25
Use the generated Go SDK

Using the generated Go SDK

  • Install Go 1.21
  • Export a valid GITHUB_TOKEN
  • Create a directory for your project
  • From your directory, run go mod init github.com/yourUsername/yourProjectName
  • Create a main.go file with the following contents in it:
package main
@kfcampbell
kfcampbell / curl-ua.shell
Created October 27, 2023 19:05 — forked from pengwynn/curl-ua.shell
Pass a User-Agent header with curl
curl -v --user-agent "dartvoid/0.1 (https://github.com/dartvoid\) terminal/0.0" https://api.github.com/users/dartvoid
* About to connect() to api.github.com port 443 (#0)
* Trying 207.97.227.243...
* connected
* Connected to api.github.com (207.97.227.243) port 443 (#0)
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
@kfcampbell
kfcampbell / modified_github_openapi_spec.json
Created February 1, 2023 19:46
Modified GitHub OpenAPI spec
This file has been truncated, but you can view the full file.
{
"openapi": "3.0.3",
"info": {
"version": "1.1.4",
"title": "GitHub v3 REST API",
"description": "GitHub's v3 REST API.",
"license": {
"name": "MIT",
"url": "https://spdx.org/licenses/MIT"
},
@kfcampbell
kfcampbell / switch_go_version.sh
Created March 25, 2020 17:12
Easily switch Go versions at the command-line.
# my amazing colleague @fatih showed me this. saving it here so i don't forget it.
function switchgo() {
version=$1
if [ -z $version ]; then
echo "Usage: switchgo [version]"
return
fi
if ! command -v "go$version" > /dev/null 2>&1; then
echo "version does not exist, downloading with commands: "
echo " go get golang.org/dl/go${version}"