Pinning and sliding of driven elastic systems: from domain walls to charge density waves