Here's what I do, wherever I may roam:
1. Have the instrument in a good gig bag with lots of padding, not a hardshell case.
2. Approach boarding with the gig bag hanging from the shoulder furthest away from the attendant checking your boarding pass. Try to arrange things so that you can board early.
3. This one is important: always, always be pleasant and super polite to staff. You do not want to get aggressive or demanding.
4. If asked to gate-check the guitar, don't sweat it. Let them issue you the tag. While you're walking down the jet bridge, "accidentally" drop the tag on the floor nonchalantly. Once you board the plane, if they hassle you about stowing it in overhead, ask politely if you can stow the guitar in the crew closet or in the back of the plane.
5. As a safeguard, take an all-purpose screwdriver and pack it in the gig bag. If you have a sturdy electric (like, say, a Fender Telecaster), you can easily unscrew the neck to allow you to store it in a smaller space. Obviously, I don't like doing this but it may be necessary in a jam.