30. Juli 2010

GitHub, I like…

Toying around with GreaseMonkey I wrote a little userscript that integrates the Facebook Like button into GitHub repository pages (click here to install it). Nothing special, but maybe you like it too :)

Next up: Stop messing around with GreaseMonkey and learn how to write Safari Extensions.

21. Juli 2010

Loading GreaseMonkey userscripts from a server

Codeshelver relies heavily on the GreaseMonkey/GreaseKit userscript to customize the GitHub dashboard and repository pages. As I have got some more ideas for extending these functionalities (i.e. adding a list of recently shelved repositories to the dashboard) I was searching for a way to load the userscript from my server so that the users do not have to update the userscript manually everytime I add new features.

It turns out to be fairly simple, because you just have to split your userscript into two parts: The first one is the userscript that the user adds to his browser and which just loads the second part, namely a javascript file that gets integrated into the webpage and which contains the real functionality.

myapp.user.js

This is the userscript that you offer to download/add to the browser: It just integrates the real userscript from the server, so that the users do not have to update their userscripts and it also disables the userscript functionality in case your server is not available. The latter can be seen as a bug or a feature (depends on your use case), but for codeshelver.com this is a feature, because if the server is down you are not able to shelve repositories anyway ;)

(function() {
  //
  var script = document.createElement('script');
  script.src = 'http://myapp.com/userscript.js';
  script.type = 'text/javascript';
  document.getElementsByTagName('head')[0].appendChild(script);
})();

userscript.js

Here goes the real functionality :)

var Userscript = {
  init: function() {
    alert("Hello :)");
  }
};
Userscript.init();

As I said this is pretty straight forward, so go ahead and enhance the web!

18. Juli 2010

Codeshelver: Tagging GitHub repositories

Codeshelver lets you clean up your GitHub watchlist by storing repositories you would like to remember on your shelf.Last week I polished my latest spare time project so that I could release it into the wild: Codeshelver lets you clean up your GitHub watchlist by tagging repositories you would like to remember. If you are a GitHub fanboy like me you probably know the problem: Almost daily an interesting project appears in your timeline and you want to remember it, because you might need something like that in the future. You hit the watch button and from now on you are notified about every single commit, issue and wiki change of that project- This is great for code you are using on a daily basis but doesn’t make sense for repositories you would just like to remember, because it practically spams your dashboard timeline with things you are not really interested in.

I had the idea for this project on my mind for some time, but didn’t get around to realizing it because I lacked the motivation to build it with the common stack of technologies. A few weeks ago I started to play with NodeJS and tried to come up with something that was beyond the Hello World examples so I stumbled upon ExpressJS, which could be described as the Sinatra of NodeJS. And so I had my use case for trying out some new technologies to which I also added GreaseMonkey and CouchDB to make it more buzzwordy.

All in all it was fairly easy to develop the app as I just had to knit some good libraries together like express, node-couchdb and nodejs-autorestart which I’m currently using to make the deployment a little easier. Talking about deployment: I had some problems figuring out how to do it the best way, everyone seems to be using Ubuntu’s Upstart and Monit for deploying NodeJS apps. I’d prefer a more generic solution, but I haven’t found a really satisfying way yet, so I’m just killing and restarting the processes.

There are some features in the pipeline that I’d like to add once some more people are using the service and I gather more data, which would offer the possibility to evaluate things like trending and interesting repositories. Now that ExpressJS 1.0 is around the corner I’ll migrate the app and will most likely use CoffeeScript for that, because it looks very promising and easy to integrate – it will also give me one more buzzword up my sleeve ;)

Please go ahead and try Codeshelver, let me know what you think and leave comments and feedback here!


14. Juli 2010

Installing a current CouchDB (and Erlang) from source on Ubuntu 8.04 LTS

Two weeks ago I had quite a hard time getting CouchDB up and running on my VPS, but with some help from Jonathan and Lars it finally worked. My main problem was that Erlang wasn’t configured with SSL support and that the CouchDB version I was using (0.11.0) did not play nice with the latest Erland (R14A), so that I had to get CouchDB from the SVN repository. Now that CouchDB 1.0 is here, I thought it might be a good opportunity to summarize the steps I had to take to install the latest Erlang and CouchDB 1.0 on my Ubuntu Hardy system…

diesen Eintrag lesen »