-
Passing session keys in headers for Embjer.JS Data REST calls
First thing you have to do is to override the RESTAdapter if you aren’t already. The ajax function is the key. It is given the jQuery hash that will get passed down so all you have to do is to populate the beforeSend key with a function like below. The ‘xhr’ passed in can be…
-
Trouble with Time Zones and Day Light Savings in iOS
As you all know, Suneth and I are working on 60Hz 2.0 and we had the weirdest date related problem yesterday. We have a weekly calendar which tells you when your library shows air and what are the premiering (returning or new series) airing on any particular day. Yesterday, our calendar looked like this!! …
-
Windows 8 Should Have Shipped With… Windows
I think Windows 8 is great. It is fast, the UI is simplified and it is a much needed reset for the Windows ecosystem. The problem is, however, the way Microsoft’s latest desktop offering ignores the desktop users altogether. Windows, as its name states, has always been about desktop + windows. This is a metaphor…
-
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…
-
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
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…