Lattice models for Josephson junctions and graphene superlattices