Skip to content

Instantly share code, notes, and snippets.

@chriscorwin
Created April 25, 2014 16:04
Show Gist options
  • Save chriscorwin/11294620 to your computer and use it in GitHub Desktop.
Save chriscorwin/11294620 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 .js type and opens the Gist in the browser.
#!/bin/bash
touch '/Users/ccorwin/Google Drive/Documents/pasteboard.js'
pbpaste > '/Users/ccorwin/Google Drive/Documents/pasteboard.js'
highlight -O rtf -t 2 -K 11 -k 'Source Code Pro' --syntax 'js' '/Users/ccorwin/Google Drive/Documents/pasteboard.js' | pbcopy
gist --type js --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