Skip to content

Instantly share code, notes, and snippets.

@charlespwd
Created October 19, 2020 19:58
Show Gist options
  • Save charlespwd/a3c5918b7d0acde66b7583489d6c2d48 to your computer and use it in GitHub Desktop.
Save charlespwd/a3c5918b7d0acde66b7583489d6c2d48 to your computer and use it in GitHub Desktop.
Save Blob URL to File
# How it works: They're just base64'd with a small header at the start
# Trim the header + decode and there you have it!
# (just make sure you're using the appropriate file type)
# macOS
pbpaste | sed 's#data[^,]+,##' | base64 -d > image.png
open image.png
# Linux (IIRC)
xclip -sel clipboard -o | sed 's#data[^,]+,##' | base64 -d > image.png
xdg-open image.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment