For the cyclists:
It's quite simple, if you're riding a bike on the road, follow the rules of the road. Don't ever try to take right-of-way when you don't have it. At stop lights, don't zip over into the crosswalk and ride straight across. Wait your turn like the rest of the traffic. Yield to pedestrians when they have the right-of-way.
There's right-of-way, and there's riding smart. You might have the right to take a full lane, but shouldn't do so unless you need to for safety reasons. For the most part, you should stay as far right as is safe. Having said that, it's not smart to put yourself in a position of weaving back and forth. If there are parked cars along the side of the road, it's generally better to stay in a position to clear them then going between them and back out. Also, leave enough room so that you won't get doored (have a car door opened into your path).
Whenever possible, signal your intentions. There's the old fashioned road signals, but it's becoming more common to just point the direction you are planning on going. It can also be easier for everyone to understand what you are doing.
There's no advantage to pissing drivers off. When you do have right of way, take it, but always always remember that the motorists may not see you and be cautious enough that you can avoid an accident in those cases. It doesn't matter if you had the right of the way if you get hit. You still lose.
For pedestrians on bikes:
By a pedestrian on a bike, I mainly mean you are riding on sidewalks - which is something you shouldn't generally be doing unless you are a child. Having said that, I will admit to doing it at times with my hybrid bike, when I have the kids in a bike trailer, so I get that there are times it is safer.
So, pedestrian on bike? You need to act like a pedestrian at intersections.When crossing intersections, you should dismount. At the very least, you need to slow down a lot. Drivers are not looking for something going 20km/h in crosswalks.
As well, give right of way to pedestrians on feet. Let them know when you are passing them and do it at a safe speed. Always assume that children and pets may be unpredictable and make sudden movements.
For the drivers:
Please pay attention. Please. Yes, bikes are smaller and less noticeable then cars, but if you can't notice one on the road, you shouldn't be driving.
Give sufficient passing room. In many places, the legal requirement is 3 feet. Keep in mind, that's a minimum. If it's safe to do so, it is really nice to give more. If it isn't possible to give 3 feet, you need to slow down and wait for a few seconds until it is safe.
If a cyclist is riding out from the right edge of the road, rather then getting angry, consider there might be a reason. There may be glass in the shoulder, or perhaps they're about to make a left turn. Give the benefit of doubt rather then just getting annoyed.
Don't give up your right of way just to be polite. I know it sounds odd to ask you not to be polite, but when someone on the road gives up their right of way, it just causes confusion. Last week, while on my bike, I was waiting for a gap in traffic so I could turn left onto a road. (There were no traffic lights, but I had a stop sign.) A vehicle coming from one way stopped for me, but it took me a minute to figure out why he was even stopping. Initially, I thought he was about to turn left without signalling. Plus, it wasn't safe for me to pull out anyways, because there was still traffic coming from the other way. Seriously. Treat us like vehicles, not pedestrians.
If you are turning right at an intersection, don't pass a cyclist immediately before the intersection. They'll run right into you.
Keep in mind that bikes sometimes go much faster then you expect. Don't pass just because you think you should always pass cyclists. When going downhills, cyclists often keep pace with the traffic. Likewise in lower speed limit zones. There's a school/playground zone around the corner from my house with a speed limit of 30 km/h (18.6 mi/h). It's also a little bit downhill, so I am almost always doing at least the speed limit there. I've had cars that speed up to pass me, but then go slower in front of me then I'm even riding.
My final point is not to generalize the whole group as jerks because you've encountered one. Yes, there are cyclists that ride 4 wide, take up the road and are generally jerks. There are also motorists that throw things at cyclists, and pass them close enough that they clip them with their mirrors. As with any group of people, the existence of one moron does not make the whole group morons.
Disagree with me on any points? Want to add anything?