As for attaching a file, I'm usually screenshotting small amounts of code - usually of the ephemeral variety.