Skip to content

Instantly share code, notes, and snippets.

@chriscorwin
Last active August 29, 2015 14:00
Show Gist options
  • Save chriscorwin/11294544 to your computer and use it in GitHub Desktop.
Save chriscorwin/11294544 to your computer and use it in GitHub Desktop.
Grabs contents from clipboard, pastes it into a clipboard file, sends it to highlight to format it as RTF (and places result in clipboard), then creates a Gist of .sh type and opens the Gist in the browser.
#!/bin/bash
touch '/Users/ccorwin/Google Drive/Documents/pasteboard.sh'
pbpaste > '/Users/ccorwin/Google Drive/Documents/pasteboard.sh'
highlight -O rtf -t 2 -K 11 -k 'Source Code Pro' --syntax 'Bash' '/Users/ccorwin/Google Drive/Documents/pasteboard.sh' | pbcopy
gist --type sh --open '/Users/ccorwin/Google Drive/Documents/pasteboard.sh'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment