Have some motivation for the project. Code should be written to address a problem or scratch an itch. For example, a personal project I am working on has a goal of destroying PHP. So every time I get discouraged, I think, "If I don't keep hacking, then PHP wins, and that's really horrible."
@helium: don't trust online storage. Simply encrypt your files with tools like boxcryptor to be sure dropbox (=the NSA) cannot read your files that easy.