
Gotta love Dropbox :)
I came up with a plan to be able to work from anywhere without depending on my laptop. Pretty Dropbox standard, but with a minimalism in the mix.
The inspiration was this Google Chrome app called “Sourcekit”.
It’s a “textmate” like editor that allows you to code from your Chrome browser by saving the files in your Dropbox account.
So that’s my start point. I can code without having my laptop. Just open a Chrome Browser in another computer or in a cyber cafĂ© and I have all my work there available instantly.
No Chrome browser around? Then I could grab any device that has a Dropbox app: Ipad, Android, Iphone…these should also have a code editor app.
And that gives you many possibilities.
That idea that you may get while in the shower, that bug fixing you thought about while listening to music..You ought to be prepared!
You could code with an Ipad while sitting in a train, for example.
But wait, how about testing? I want to see the changes I made in the browser. And I don’t want FTP, I want instant gratification.
Just install Dropbox in your VPS as well! And it’s pretty easy.
Then you just symlink your files to your http server.
So here’s the plan:
Mount bind your source files into your Dropbox folder, making a “mirror” of it. Careful! this is not like symlinking. Deleting something on one folder will also delete in the other.
mount —bind <source> <your Dropbox folder>
To make it mount for you every time you boot, you should add this in your fstab:
<source> <your Dropbox folder> none bind
Install Dropbox on your VPS and symlink your Dropbox files to your httpdocs folder (or whatever folder that is):
ln -s <dropbox folder> <your httpdocs folder>
To finish, just make sure you have Dropbox installed in your other devices (ipad, smartphone, etc) and install SourceKit in any Google Chrome browser you have around.
So now I’m at home using my girlfriend’s laptop to write something I thought about, I code from Google Chrome and save it. It updates in the VPS instantly and it will update in my laptop. Just waiting for me in the next day.
No extra programs or computers required. Totally independent.
Note that any time you save in your browser/device, it will update instantly in your server and that’s what I want, because I’m just developing something that is not in production. If you don’t want that to happen, and you want it to update in your VPS only after you’re “done” with something, just add git to the mix! So instead of mount binding you could use git clone for example. Then something like “git push dropbox master” would push it to your Dropbox and eventually update in the VPS.
“But hey, you can already select the folder you want to sync with Dropbox, so what’s the point of this again?”
Because:
- I want to keep my folder structure. I don’t want everything under the “Dropbox” folder. That gives me flexibility to organize the way I want and just tell “Dropbox” what should be in the cloud.
- I don’t have a desktop computer. And I don’t have plans on buying one, it’s pretty useless to me.
- I don’t like to depend on my laptop. I actually leave my laptop at work on Mondays and bring it back home only on Fridays.
That’s so I don’t have to carry it around all the time and so I stay away from the screen a little on the evenings. - With SourceKit I can get a good editor to let me code from anywhere (if I can find a Chrome browser).
- I want it to sync with my VPS as well. Automatically. And with git goodness.
Want to push this even further?
How about git bare repositories hosted in a Dropbox folder, shared with your team for a ridiculously easy collaboration? Also doable. And there’s even a little script that fixes that for you.
Hopefully this will be useful to you to!
Right, almost forgot the basic disclaimer: if you mess up with your computer, it’s not my fault! It can’t be, how could I? So be careful! :)