Computational indistinguishability for any distribution using a Chernoff bound
How the Chernoff bound is applied
What does it mean for $D$ and $D'$ to be indistignuishable by a circuit $C$? It means that
$$
|\Pr_{x \in D}[C(x) = 1] - \Pr_{x \in D'}[C(x) = 1]| \leq \epsilon.
$$
Let $x_1,\ldots,x_w$ be the sampled elements. Then
$$
\Pr_{x \in D'}[C(x) = 1] = \frac{X_1 + \cdots + X_w}{w},
$$
where $X_i$ is the indicator of $C(x_i) = 1$. If we sample $x_1,\ldots,x_w$ at random, then $X_1,\ldots,X_w$ are independent Bernoulli random variables whose expectation is $\Pr_{x \in D}[C(x) = 1]$. Chernoff's bound shows that their average is concentrated around their expectation.
Applying the union bound
The probability that a choice of $x_1,\ldots,x_w$ is bad for a specific circuit $C$ is $e^{-\epsilon^2 w}$. The probability that a choice of $x_1,\ldots,x_w$ is bad for one of $N$ different circuits is at most $Ne^{-\epsilon^2 w}$. Hence if $Ne^{-\epsilon^2 w} &lt; 1$, the probability that a choice of $x_1,\ldots,x_w$ is good to all $N$ circuits is positive, hence there exists such a choice which is good to all $N$ circuits.
Since $w$ is in the exponent, the minimal $w$ needed to satisfy $Ne^{-\epsilon^2 w} &lt; 1$ scales only logarithmically in $N$.