The adaptability and resilience of cities to major epidemics