At work, we have an Angular app that deals with a lot of custom JSON. With a distributed dev team, we pass a LOT of JSON around. Copying from Chrome’s net tab, formatting, adding to a Github gist for easy transport is a PITA when you are doing it 20 times a day. I have 2 Alfred workflows to help with this.
- Copy unformatted JSON to clipboard
- Alfred “JsonLint”. Formatted JSON is now in my clipboard
- Alfred “gist”. URL to raw gist is now in my clipboard
- One of these days I’ll chain these together
To get this working:
- You’ll need the Alfred PowerPack
- Install my JSON lint workflow. (It needs work, but gets the job done)
- Install AlfredGist
- Be sure to follow the setup instructions.
- I prefer to have the ‘raw’ url returned from AlfredGist. (in the clipboard and opened)
To enable this, open functions.sh
Look for this line:
gist_url=$(get_json_key “html_url" "$json")
gist_url=$(get_json_key “raw_url” "$json")
- In “gistconfig” set the gists to be private
You should now be able to chain together as I listed above
Let me know if you have any questions!