There are solutions on the market, but they are expensive and don't always fit the look of your bike. Plus if you could afford to spend the money, you probably just bought a more expensive bike computer with a bigger or with a rotational mount.
The second picture shows what was inside the package of my speedometer.
For this project you will need:
rotary tool (Dremel)
Speedometer magnet & sensor
(If you don't own a dremel you can always make due with a candle and a box cutter to make the holes.)
Step 1: Decide Where You Want to Install Your Speedometer
Find a zip tie that is big enough to fit around either the handlebars or stem of your bike.
Plan where you will fit the sensor on the front fork, and how you will route the wire to the sensor. Like most people, I will guide the wire alongside my brake-cable.
As you can see in the picture, the mount for my speedometer was in the wrong orientation, it also wouldn't fit my handlebars since the bracket was way too short.
Step 2: Attach Zip Tie to the Speedometer Mount
Drill/cut/melt holes on the underside of the bracket. I didn't have a dremel on hand, so I used a box cutter to make the holes.
Heat the box cutter in the flame of the candle to make it easier to cut trough the plastic.
Feed the zip tie through the holes on the mount and use scissors to remove the bracket, you won't be using it since it won't fit.
Step 3: Attach the Bracket to Your Handlebars/stem
twist the sensor-cable down to the front fork via the brake cable.
Step 4: Install the Sensor and Magnet
If you want a super neat/clean install, you can also follow the instructable to hide the sensor-cable underneath a shrink wrap (by brianbarkey).
Add the magnet to the wheel. Use a screwdriver to attach it to a spoke on the same side of the wheel as your sensor. Adjust the height of the magnet to the height of the sensor. Make sure the distance between the magnet and the sensor is only a few millimetres.
Finally: Follow the instructions included in the package to set up the computer. Set it up to the wheel-size of your bike to ensure a correct measurement of distance and speed. At this point you can also follow the instructions to change the measurement to miles or kilometres.
Step 5: Ride Your Bike
I wrote this instructable to participate in the bike contest. Feel free to vote for me if you like my instructable.
Thank you for reading and enjoy riding!
EDIT: add creddit to user brianbarkey for refferencing his idea of hiding the cable underneath a piece of shrink-wrap.