To get unlimited gold, you must have at least ten troops in you reserves. Take any unit and put them in the last spot for reserves. Click on the arrow on the right and put the unit in that location.
Note: You can repeat this again, but it is not necessary to do so.
Then, move the unit next to the rest of the reserves. Save the game and close your browser. Reload your saved game file and go to the barracks. Go to the end of the reserves. If done correctly, a unit will be flashing between all of the unit looks.
Sell this unit back to the barracks and you will now have unlimited gold.