A resistor with brown, black and green bands is 1 MOhm. Brown is 1, black is 0 and green is 5, meaning five zeros, so the value is 1000000 Ohms. Gold is the tolerance (5%)
That is used to discharge the capacitor so you can't get a shock from the pins of the plug.
If the capacitor is across the supply terminals, it is to suppress noise and possibly reduce arcing in the switch as it turns on and off. The value is arbitrary and either 100 or 220 nF would be fine.