Stochastic homogenization of Hamilton–Jacobi equations and some applications