RSync FTW

Firstly, sorry for the long gap between my posts. I promise to be more committed 🙂

These past two weeks, we have been working on Makedrive: a file system module that can sync to every copy of that file system. It is important to understand the power of what we are trying to do here. As a user, if I have a file system on my desktop and I add/change/remove files or directories in there, I can now just check my tablet on my way to work and see the changes I made on my desktop on my tablet. And the point is to make it work on a browser. Kinda like Dropbox in a browser. Sounds neat eh? Well, as cool as it sounds, it was really really hard to implement.

We used Filer, an awesome filesystem unit conceptualized by the genius Alan K., as our base and worked from there. I worked primarily on the syncing component. I worked of code developed by a fellow classmate of mine Petr B. It took a while to understand the code, especially since it was quite complex, but within two days I had a decent understanding of how rsync (which is the syncing algorithm we were using) worked. But there were some issues that needed to be fixed like syncing empty directories. That took forever! I had to figure out where stuff went wrong which is hard when you are working with MD5 hashes and non-human readable data. But I was able to get it done in the end.

Then came the hard part. We were able to sync from one file system to another. But what about over a network. There was nothing that could really help us with this design and no real resources we could look for. Well, it took a while but we were able to come up with a design (courtesy of David H. and Alan K.) that involved syncing through an API. In a few days, I was able to configure routes for an API (since I have good experience with designing API’s thanks to the Web services course I took) based on what I thought would be good end-points in each step of the sync process.

It took a while, but after integrating with my colleagues pieces of code, we were able to show a small demo of this to Mozilla themselves o/

And there you have it…another successful project by the CDOT Mozilla Webmaker team!

r.gideonthomas@gmail.com / May 31, 2014 / CDOT / 0 Comments

You can do anything in Javascript!

This is my first blog post! 🙂

I have always been deluded by the misconception that Javascript can only be used to make a webpage interactive. As a matter of fact, that was what I was taught a few years ago when I took a HTML/CSS/Javascript course. But things have changed a lot since then. With technologies like Node.js, Require.js, Travis CI… the possibilities are endless.

I am still a beginner in Node.js. This week, we were required to create an app that would extract links from a markdown file. Seems pretty straightforward! But here’s the catch – the logic for the extraction should be a separate module so that the module can be used to create two apps: one that will run on a browser and another that will work on command line.

Here’s where Node.js came in. Node allowed me to create these parts of the app using a modular approach. First, I created a module that would simply get the links. I pretty much match a regular expression pattern to get the links. But after chatting with my colleagues, turns out there are several ways to do this. In fact, I was told that Array.map() was a better approach…it was 🙂

Require.js made my work even simpler. It allowed me to include my node module as a javascript module in my html file. So, I was able to run it on both the command line and on a browser.

I am excited to see what else you can do with Node and javascript in general and I am sure with the help of my team, we will be able to create innovative apps using javascript…can’t wait to see what our next challenge will be 🙂

r.gideonthomas@gmail.com / May 13, 2014 / CDOT / 0 Comments