Copy the above code into the config file found at
/etc/wpa_supplicant/wpa_supplicant.conf. You can edit this using
$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
According to the Raspberry Pi website:
wpa_supplicant.conffile is placed into the
/boot/directory, this will be moved to the
/etc/wpa_supplicant/directory the next time the system is booted, overwriting the network settings; this allows a Wifi configuration to be preloaded onto a card from a Windows or other machine that can only see the boot partition.
Thanks to Pieter Beulque for the article explaining the config options.