On GitHub

I am an Internet addict. And the website I’m most addicted to is called GitHub. GitHub is a social code hosting website that is totally awesome. Not your general run-of-the-mill awesome, but rather ass-kicking best-thing-in-the-world awesome. If GitHub was a ninja, it would be Po, defeating the evil clutches of SourceForge.

When Linux was released a couple of decades ago, it was hosted on a university FTP server. Today, the days of FTP are way past, and unless your code is hosted on a code-sharing website like GitHub, it is as good as dead. The last decade has seen an explosive grown in software and the open source movement. Things like GitHub, Linux, Android, Facebook have been made possible due to the combine efforts of millions across the globe following the Unix philosophy of doing one thing well.

Ahh, I digress. The point I’m trying to make is that it is very hard to explain to a layman how important GitHub has been to the software community. It has been used as a collaboration platform for writers, law makers, governments, programmers, and even musicians. People have used its issue tracking feature to even plan weddings. And above all, people adore GitHub. It is one of the few startups that have been accorded God status in the community.

The question here is what makes GitHub tick? As the largest hosting site for code, it obviously makes a huge impact just by virtue of being there. But its tide of features and innovative progression had made it a darling of all. For instance, their 1 click to fork feature has allowed people to contribute to any project so much easier.

GitHub has an amazing User Experience, making sure it works perfectly on all devices large or small. Their amazing support makes sure all of its users are happy as possible. Their regular meetups makes sure that GitHub is invested in the software community themselves. And their GitHub Store lets people invest back in GitHub by romoting them via Tees, stickers and even laptop sleeves.

My personal experience with GitHub has been overwhelmingly positive. People have stood beside GitHub even as they faced major issues, and for me that is indicative of a trust in GitHub that no money can buy. The GitHub API (which I’ve used more than once) lets developers create their own apps on top of GitHub which others can use to create even more awesome things.

For me GitHub is more than just a coding website. It is a testament to creativity and the Hacker Way, reminding me every day that anything is possible.

Making HackerTray

A few days back, I found the excellent HackerBarApp via Hacker News. Hacker News, for those of you who don’t know, is tech news website run by YCombinator. Hacker Bar was the simplest way of accessing HN stories that I’d ever seen. Unfortunately, it was only for Mac (made using rubymotion) and even though the source was available, it was of no use to me as a Linux User.

I decided to make a clone of Hacker Bar that would work on Linux. My first choice of the stack was node-webkit, an application framework that allows you to build cross-platform applications using HTML, CSS, JS, and modules from the node.js ecosystem. After reading a lot about node-webkit, I figured out that building this application in node-webkit (as it stands) would not be possible. Or rather, it would not work under Ubuntu and its derivatives because of lacking appindicator support in node-webkit. More details here.

The next obvious language and stack of choice was Python + Gtk. I’d already played a little bit with Gtk and Python some time back, so I knew the basics. But I’d never build a real application with PyGtk, just toys and small scripts. I found a basic skeleton app that was written for AppIndicator and modified it somewhat to form the base of HackerTray.

The next challenge I faced was keeping the check boxes always checked despite of any number of clicks after the first. That is, we don’t want any menu item to be “un-checked” at any moment. A basic idea is to do this (partial code):

def open(self, widget):
	if(widget.get_active() == False):
		widget.set_active()
	webbrowser.open(widget.url)

def addItem(self, item):
	#create a new CheckMenuItem (i)
	i.connect('activate', self.open)

However, this does not work as expected, because the widget.set_active() call also results in the activate event being fired, which ultimately calls open. This means on a click to an unchecked menuItem, the open function is called twice. This results in the browser opening the link twice.

As a workaround, I disabled the event handler in case it is a checked menuItem:

def open(self, widget):
	if(widget.set_active() == False)
		wiget.disconnect(widget.signal_id)
		widget.set_active(true)
		widget.signal_id = widget.connect('activate', self.open)
	webbrowser.open(widget.url)

def addItem(self, item):
	#create a new CheckMenuItem (i)
	i.connect('activate', self.open)
	i.signal_id = i.connect('activate', self.open)

The next thing I worked on was a persistent memory for the app. In a nutshell, I needed to make sure that the tick on an item remained there, even if the app was restarted. This meant writing a list of all the “viewed” items into a file. After looking at shelve for a bit, I just rolled my own implementation , based on storing the data into ~/.hackertray.json file.

After that I worked on packaging the app into a python package, so that it could be easily installed. The python packaging tutorial was an easy to use guide that let me create the package easily and push it to the Python Package Index. A few issues in the package were found, and were fixed quickly thanks to the pull request by @brunal.

After improving the README a bit, I posted about it on Hacker News, where it failed to get any traction. I re-tried with a link to the HackerTray website, and that fell flat as well. It was on the next day, when I posted it to HN for the third time, that it took off. After 50 or so upvotes, I found that my instance refused to run because it had hit the API Rate Limit on the excellent node-hnapi. I quickly pushed a fix that used a list of servers to hit as fallback in case it crossed the Rate Limits.

After a lot of feedback from HN, I started work on a node-webkit based clone of hackertray for Windows. I should be able to release it in a few more days, if nothing else crops up. Keep watching this space for info. If you have any queries, just file an issue on GitHub or contact me.

Aboard the Nautilus

I’d done a post on this a long time back (2009), detailing what all softwares I use on a daily basis. This is an update to that post.

Since the last post, I’ve moved on to using Linux, using Elementary OS as my primary OS. Over the time period this post was written, I’ve shifted from using Cinnamon to Openbox and finally to elementaryOS’s pantheon as my Desktop Manager. I’m thinking of switching to Arch Linux, just to get a faster experience. I use Synapse as my application launcher, because its much faster than anything else out there.

For most of my web browsing needs, I rely on Google Chrome Stable and a daily build of Chromium (v31 as of now) for most of my work. I switch between them all the time. I use Firefox (stable) only to test out my projects from time to time.

The current editor I use is Sublime Text. It is everything you need, and much more. I’m still to get started using its build system, and its plethora of packages; but its still an excellent choice for a daily use editor. On the command line, I use Vim, git (with SCM Breeze), fasd and tig, which is an excellent git interface on the command line.

I listen to music on my own browser-based music player, called Muzi, YouTube and GrooveShark.

For my terminal needs, I use Gnome-Terminal. I use Byobu to manage my session, and often connect to it from other computers as well. Its an excellent multiplexer that fits in my workflow really well.

I use Imo.im on both the Desktop and my tablet to chat. I occasionally use ReText for editing markdown files. I use RedShift on my laptop and f.lux on my iPad to help me sleep better. I recommend it to everyone who is suffering from eye-strain or wants to sleep better.

On the browser, my most visited sites would be Hacker News (via hckrnews.com), WorkFlowy for managing my to-do list and GitHub on a daily basis for most of my projects.

Hardware

I own a old Nokia X3-02, and will be upgrading to a Firefox OS Phone soon enough. I use a Dell Inspiron 1545 as my personal machine. I also use an iPad 2 (with 3G) on a daily basis (mostly for reading). I also own a Dayan Zhanchi 3x3 and a 5x5 shengshou speed cube.

iPad Apps

The must have iPad apps for me are Chrome, imo, and iBooks. I have installed Mailbox alongside GMail, and haven’t used GMail since I installed it. I sometimes write stuff using Plaintext, and sketch using Paper. I read my RSS feeds using Newsify and Feedly.

Extensions

Chrome Extensions that I use on a daily basis include Chime for wonderful notifications (highly recommended), Ghostery for getting a tracker-free internet , HTTPS Everywhere to keep me secure, LastPass to manage passwords and Stylish for customizing the looks of various websites.

Dream Setup

My dream setup would consist of a lightweight Ubuntu Laptop that I can carry around that still has lots of processing power and battery life. I’ll prety much be satisfied by any high-end Android phone as long as it has a decent battery life.