Never wake another man by shaking or touching him, as he might wake suddenly and shoot you.
Real cowboys are modest. A braggert who is "all gurgle and no guts" is not tolerated.
Always fill your whiskey glass to the brim.
Be there for a friend when he needs you.
Drinking on duty is grounds for instant dismissal and blacklisting.
A cowboy is loyal to his "brand," to his friends, and those he rides with.
Never shoot an unarmed or unwarned enemy. This was also known as "the rattlesnake code": always warn before you strike. However, if a man was being stalked, this could be ignored.
Never shoot a woman no matter what.
Consideration for others is central to the code, such as: Don't stir up dust around the chuckwagon, don't wake up the wrong man for herd duty, etc.
(More after the link.)