Skip to content

Instantly share code, notes, and snippets.

@jhrcook
jhrcook / common-github-badges.md
Last active July 13, 2025 08:26
A list of GitHub badges I usually add to me README files.

GitHub Badges

Social

jhc github jhc twitter jhc website

Code

@kornysietsma
kornysietsma / github_api.sh
Last active October 12, 2021 11:15
curl while hiding secrets for github api
#!/bin/bash -eu
# uses 1pass to get token from 1password vault
export GITHUB_API_TOKEN=`1pass "github api token"`
function ghapi() {
# escape double quotes as we need to insert the passed heredoc into a json string
# optionally we could build this with jq?
local json=$(cat | sed 's/"/\\"/g')
curl -sS -K <(cat <<<"header \"Authorization: token $GITHUB_API_TOKEN\"") -X POST https://api.github.com/graphql -d @- <<EOT