Setting neumann and dirichlet boundary conditions in 2D with assemble vector

Can you provide a MWE?