You might come across a tweet with a code snippet image like this and wonder how they did it.
Generate an image from a code snippet like this is very easy with Codeshot.
- To do it copy your code to clipboard (⌘ - command + C)).
- Open Codeshot.
- Paste the code to Codeshot (Edit > Replace or ⌘ - command + ⇧ - SHIFT + V).
- Select the theme and style that you want.
- Select Sizes (⌘ - command + 3).
- Select Twitter size.
- Export as image with File > Export or ⌘ - command + E.
That's it. You will get a perfectly aligned code image for your tweet.