Skip to content

Gist

Github Gist

no png file in gist

Convert png file to code:

echo "data:image/png;base64,$(base64 -w 0 clock.png)"
... ...
Copy all output above, then change the image line like this:
background-image: url("clock.png");
background-image: url("data:image/png;base64,iVBORw0KGgo...");

creat gist

public

gh gist create one.html two.md three.js --desc "little-doc-in-md" --public

private

gh gist create zz.html zz.md marked.umd.js --desc "little-doc-in-md"

list gist

gh gist list
ID                                DESCRIPTION        FILES   VISIBILITY  UPDATED
cd97d286516c0285394f9c8e15461181  My favorite clock  1 file  public      about 14 minutes ago

build and output gists URL to share

gh api gists --jq '.[] | "\(.description)  \(.html_url)"'
My favorite clock   https://gist.github.com/ox0/cd97d286516c0285394f9c8e15461181