Using Cauchy's integral formula to solve $\int_{|z| = 2} \frac{e^z}{z^2(z-1)}\,dz$
We want to calculate $$I = \int_{\partial D} \frac{e^z}{z^2(z-1)}dz$$ where $D = \{z \in \mathbb{C}: |z| \leq 2\}$.
Since the integrand $\frac{e^z}{z^2(z-1)}$ has two singularities in $D$, namely, at $z = 0$, and $z = 1$, we remove two epsilon-discs, containing these points, from $D$, in order to get a domain where the integrand $\frac{e^z}{z^2(z-1)}$ is analytic. This we do in order to apply Cauchy's theorem ($\int_{}f(z)dz = 0$ whenever $f(z)$ is analytic.)
We now consider the integral $$I_\epsilon = \int_{D_\epsilon}\frac{e^z}{z^2(z-1)}dz$$ where $D_\epsilon$ is the punctured disc, $D\epsilon = D-\{z \in \mathbb{C}: |z| \leq \epsilon\}-\{z \in \mathbb{C}: |z-1| \leq \epsilon\}$.
By Cauchy's theorem, $$0 = \int_{D_\epsilon}\frac{e^z}{z^2(z-1)}dz = \int_{D} \frac{e^z}{z^2(z-1)}dz - \int_{|z| = \epsilon}\frac{e^z}{z^2(z-1)}dz - \int_{|z-1| = \epsilon} \frac{e^z}{z^2(z-1)}dz \iff \int_{D} \frac{e^z}{z^2(z-1)}dz = \int_{|z| = \epsilon}\frac{e^z}{z^2(z-1)}dz + \int_{|z-1| = \epsilon} \frac{e^z}{z^2(z-1)}dz$$
We can apply Cauchy's integral formula, $$f^{(m)}(z) = \frac{m!}{2\pi i} \int_{\partial D} \frac{f(w)}{(w-z)^{m+1}}dw,$$
to each summand of the integral,
$$I = \int_{|z| = \epsilon}\frac{e^z}{z^2(z-1)}dz + \int_{|z-1| = \epsilon} \frac{e^z}{z^2(z-1)}dz = 2\pi i \frac{d}{dz}\left[\frac{e^z}{z-1}\right]\biggr\rvert_{z = 0} + 2\pi i \left[\frac{e^z}{z^2}\right]\biggr\rvert_{z = 1} = 2\pi i (-2) + 2\pi i (e) = 2\pi i(e-2).$$