  We consider partial theta series associated with periodic sequences of
coefficients, of the form $\Theta(\tau) := \sum_{n>0} n^\nu f(n) e^{i\pi
n^2\tau/M}$, with $\nu$ non-negative integer and an $M$-periodic function $f :
\mathbb{Z} \rightarrow \mathbb{C}$. Such a function is analytic in the
half-plane $\{Im(\tau)>0\}$ and as $\tau$ tends non-tangentially to any
$\alpha\in\mathbb{Q}$, a formal power series appears in the asymptotic
behaviour of $\Theta(\tau)$, depending on the parity of $\nu$ and $f$. We
discuss the summability and resurgence properties of these series by means of
explicit formulas for their formal Borel transforms, and the consequences for
the modularity properties of $\Theta$, or its ``quantum modularity'' properties
in the sense of Zagier's recent theory. The Discrete Fourier Transform of $f$
plays an unexpected role and leads to a number-theoretic analogue of \'Ecalle's
``Bridge Equations''. The motto is: (quantum) modularity = Stokes phenomenon +
Discrete Fourier Transform.
