Answer check: $\int_{\lvert z\rvert=1}\lvert z-1\rvert^2 dz$ - stuck, I (HOPE) I've missed a trick $\int_{\lvert z\rvert=1}\lvert z-1\rvert^2 dz$ where z is a complex number (so the integral over a circle effectively)
I'm still working it out (I'm doing lots of show thats in the margin, I've got $j\cos(\theta)^3-\sin(\theta)^3$ and I'm showing if that's $e^{3j(-\theta+\frac{\pi}{2})}$ so I am checking myself!)
I am interested in what method you use because I'd love to see a nice short-cut!
Working
The gist is: $dz=dx+jdy$, let $x=\cos(\theta)$ and $y=\sin(\theta)$ for $\theta\in[0,2\pi]$ and tidy up. It's not hard I'm just out of practice (~2 years without a complex number) 
Next
I'm going to assume (where $s=\sin(\theta)$ and $c=\cos(\theta)$) you can get to this without me doing every step:
I=$\int^{2\pi}_0(jc^3-s^3+jc-s+2sc-sc^2-2jc^2+js^2c)d\theta$
This "tidies" up into:
$I=\int^{2\pi}_0(e^{3j(-\theta+\frac{\pi}{2})}+e^{j(-\theta+\frac{\pi}{2})}+\sin(2\theta)-2j\cos^2(\theta)+j\sin(\theta)^2\cos(\theta)-\sin(\theta)\cos(\theta)^2)d\theta$
That last bit looks like it ought to tidy up.
Actually
I'm kind of stuck at that point. I could do it but it'd be long winded, is there a short cut I have missed?
Because I really don't want to evaluate that:
I'm exploring $z=e^{j\theta}$ and seeing where that gets me.
 A: Better yet: for $t \in [0,2 \pi]$, let $z=e^{i t}$, $dz=i e^{i t} dt$, and
$$|z-1|^2 = \left | e^{i t}-1\right |^2 = 2 - 2 \cos{t}$$
The integral becomes
$$i 2 \int_0^{2 \pi} dt \, e^{i t} \,  (1-\cos{t}) = i 2 \int_0^{2 \pi} dt \, e^{i t} - i \int_0^{2 \pi} dt \, \left (e^{i 2 t}+1 \right ) = -i 2 \pi$$
A: I'm going to start from scratch here.  What you want to do is take a contour integral along a path that traces the curve $\Gamma = \{z:|z| = 1\}$.  
To that effect, take $z(t) = e^{it} = \cos(t) + i\sin(t), 0\leq t\leq 2\pi$.  We note that $z'(t) = ie^{it}$.  From there, we have
$$
\begin{align}
\int_\Gamma f(z)\,dz &= \int_0^{2\pi} f(z(t))z'(t)\,dt\\
&= \int_0^{2\pi} |e^{it}-1|^2(ie^{it})\,dt\\
&= \int_0^{2\pi} |(\cos t-1) + i\sin(t)|^2(ie^{it})\,dt\\
&= \int_0^{2\pi} \left((\cos t-1)^2 + \sin^2(t)\right)(ie^{it})\,dt\\
&= \int_0^{2\pi} \left(1 - 2\cos t + \cos^2(t) + \sin^2(t)\right)(ie^{it})\,dt\\
&= \int_0^{2\pi} \left(2 - 2\cos t\right)(ie^{it})\,dt
\end{align}
$$
It seems the other answer has taken it from here, so I'll leave it at that.
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\on}[1]{\operatorname{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
Note that
$\ds{\verts{z - 1}^{2} = \pars{z - 1}\pars{\overline{z} - 1} =
\pars{z - 1}\pars{{1 \over z} - 1} = {2 - z - {1 \over z}}}$.

\begin{align}
&\bbox[5px,#ffd]{\int_{\verts{z}\ =\ 1}\,\,
\verts{z - 1}^{2}\,\,\dd z} =
\int_{\verts{z}\ =\ 1}\,\,
\pars{2 - z - {1 \over z}}\,\,\dd z = \bbx{-2\pi\ic} \\ &
\end{align}
