Inhomogeneous superconductivity in condensed matter and QCD