Singularities of geometric flows and applications