Your home directory is a great place to store your code on a Mac/Ubuntu (Linux based system).
I would still create sub directories under it as appropriate. I usually organize by project, with a few extra directories for whatever, e.g.
/home/myname/project_pear
/home/myname/project_pear/upgrade/
/home/myname/random_java_code
/home/myname/Dropbox/my_open_source_awesome_project
The other thing I do which is really "big" for me is to create aliases in .bash_rc (Ubuntu) or .bash_profile (Mac). I have so many now I put them in a separate file called .bash_aliases. (which I keep on Dropbox of course...) and include it with:
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
For instance, for the above, I might create a 'mup' alias that does a cd /home/myname/project_pear/upgrade
, then I can just type mup
at the command line to do that long cd!
Another hint - when you copy working code into a unix based system, you will often find that executable say 'insufficent permission'. However you can frequently fix that with chmod +x filename
(modify the file so that is has eXecute permission.