Assuming:The employee and company are parting on good termsThe new company is OK with a little contract work as long as it doesn't distract from the new jobThe former company wants the help and the employee is willing to work a few hours a weekIs it a good idea to do contract work for a former full time employer?Has anyone ever done this?  How did it work out for you?  I can see some possible pitfalls, so I wonder how good an idea it really is.  What difficulties do you encounter doing development work outside the office and on a different schedule from the rest of the programming staff and how can they be overcome?If I  do go forward, what would be a fair amount to request as compared to current salary?
Is it a good idea to do contract work for a former full time employer?
freelancing
Lots of people do this. We have two people that I know of doing it right now for our company. The key is to keep the work separate from the new job and make it clear you will be working on this only after hours and that you are not available for questions during hours when you are at your new job. Whatever you do, you don't want to risk your new job, so make it clear that if your new job tells you that you can no longer do this, you will be giving notice. Keep everything in Source control of course and make sure the repository is kept up-to-date in a branch that you update after each work seesion, so the old company can access the code you are working on if something becomes too urgent to wait until you can work on it that night. Negotiate how long this will go on if you only want to do this for the short-term until someone else gets up-to-speed. You can usually get them to give you a higher hourly wage than when you worked for them as well. 