Donating capitol that has gained value to a non-profit to then use to pay yourself a salary with causes you to pay more taxes than if you had just realized the gains and skipped the non-profit as cap gains taxes are lower than income taxes for the top bracket.