Programmable mechanical metamaterials with tunable stiffness and frictional energy dissipation