Extremal eigenvalues of the Laplacian on Euclidean domains and closed surfaces