I used jackstands a few times on a sloped driveway. It's not the safest idea in the world, but if you do it be sure to raise only front or rear and not both at the same time and chock both wheels of the other end. For example to do the front struts, park facing uphill, chock both rear wheels, set parking brake, then jack up front end to do struts. Then turn car around so it's pointing downhill, chock both front wheels, put transmission in park or 1st (if you have FWD or AWD) and raise rear to replace rear springs and shocks.
The more sloped your driveway, and the softer the driveway material (concrete is harder than cold asphalt, which is harder than hot asphalt, which is harder than dirt), the greater the risk of the car falling off the jackstands and landing on you. Be sure to chock BOTH wheels of the end you aren't lifting and use jack stands on the raised end. Or take some beer to your friend's house and use his/her garage.
Lowering my car's resale value one track day at a time...