Headphones in, code on both screens (reddit on one screen says "I've got spare time"), posture (bent over keyboard, staring intently is much less approachable than lounging back), not looking around (making eye contact invites them to chat). If they walk to your desk wait 10 seconds before pulling out your headphones, they might just walk away, or at least know they're interrupting.