How to share code as an image on Twitter

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.

How to generate code snippet image

  1. To do it copy your code to clipboard (⌘ - command + C)).
  2. Open Codeshot.
  3. Paste the code to Codeshot (Edit > Replace or ⌘ - command + ⇧ - SHIFT + V).
  4. Select the theme and style that you want.
  5. Select Sizes (⌘ - command + 3).
  6. Select Twitter size.
  7. Export as image with File > Export or ⌘ - command + E.

That's it. You will get a perfectly aligned code image for your tweet.

← Home