Author: dineth

  • Happiness Must Be Earned

    Happiness Must Be Earned

    If my last 12 months have proven me anything, it is that being brave and working hard on your passions is the only way to be happy. Good things come to those who are proactive and willing to make it happen.  About a year ago, I decided to do something a little odd. I decided…

  • Coming up with a fresh icon for 60Hz app

    We’ve been working hard to get tvQ 2.0 out on the App Store (currently doing some beta testing). We really needed a new icon that captured the essence of our new UI and still kept a somewhat familiar vibe.​ Needed it to be cleaner, more modern and still very much recognisable on the iPhone dashboard.…

  • Problems with Bootstrap and Google Maps

    If you are having problems with image controls not showing up properly on Google Maps while using alongside Twitter Bootstrap, use this:

  • Gem: Export to Excel

    Creating excel spreadsheets (with charting) has never been easier. This looks like an amazing bit of code if you’re writing a data driven app that requires exporting to excel! ​

  • Build for a need

    Build for a need

    As developers we love to build cool stuff. It is like building legos. We love putting the blocks together to form something amazing. Often though, we tend to not think about the larger implications. We don’t ask ourselves if this is what is needed? Is it even useful? We often have the opinion of “we…

  • Selectively merging branches with git

    git-checkout is the key here. Here are the quick steps: ​

  • Rails Validating Field vs Association

    ​One really interesting thing I came across recently is validating a field vs association. I’ve always written something like this (assume this is a… Company model with a attribute called owner_id and a belongs_to association called owner): What’s better to write is: This actually makes sure that your :owner_id actually maps to a real object in the database.…

  • Ruby on Rails: Deleting data models without deleting from database

    Act as paranoid is a great little gem if you want to keep your models to hang around for audit purposes till some later process clears it out. Calling ActiveRecord.destroy first time removes it from all queries and the next destroy removes it from the database entirely. Fantastic. Rails 3.2 compatible.

  • Talking to a cross-domain API (CORS) with Backbone JS and Ruby on Rails

    After doing a whole load of reading, the solution is absolutely simple. Here’s what to do. On your backbone (or any other client side JS) side, we add some jQuery goodness with the following method: This prefilter allowed all my BackboneJS calls to be hitting the remote API correctly. I’ve put this on my main.js…