Cycling in the city is not easy; a daily battle between you, cars, and smog. City riding requries tactics to dramatically increase your survival time on the streets.
It's your ears that can be the most useful: the engine of the car behind you, the click of the latch on the parked car right in front of you, the sound of loose sand or gravel on the road, or your bike coming apart.
The best way to avoid having cars turn in front of you is to listen. If I hear a car slowing down, I know they are turning. In addition, I always look over my shoulder when approaching intersections. If I see a car, I pay attention to it. If the speed is constant, it's going straight, but if it's slowing, it's going to turn.
You can see farther ahead than most drivers, so take advantage of the fact. Spot and respond to problems when they're still a hundred metres away. Scan the driver's seat of parked cars for door-opening blockheads. Watch the tires of cars who are about to make a right turn or leave their driveway through your front wheel. Watch the ground under cars for feet, wheels or strollers about to walk in front of you.
Know Your Rights
Pick up a drivers handbook for your area. Read the laws that apply to cyclists, so you know when you are right, and when it would be best to say "sorry" and leave promptly. Remember that no matter what the law says, cars always win in a fight.
If someone is being an idiot, don't be afraid to let them know. Usually these idiots are the type of people who will stop and start yelling and screaming. If they stop, just keep riding.
Another option is to report them to the police. Although they will probably not even get a ticket, when the police pull them over for speeding next time, they will not be as leniant when the license plate matches to several complaints from cyclist.
Wear reflective clothes. Also, get one of those rear-facing LED blinkers. The blinking makes it very difficult for drivers to simply ignore you as another spot of road debris.
Choose Your Enemies Wisely
It pays to be selective in who you harass, leaning heavily on camero-driving pimply teenage jerks who nearly ran you over. Unless you're a six-foot-six football player or know Kung Fu, it's best to steer clear of six-foot-two truck drivers.