post.length > 140

  • Archive
  • RSS

Coming up with a fresh icon for tvQ app

Source: dinethmendis.com

  • 1 month ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Great UICollectionView Tutorial

  • 5 months ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
LocationBot
Suneth and I decided to take a quick stab at solving iOS6 Map’s annoying lack of business listings (by that I mean Suneth pretty much writing the whole thing!). We are pretty much done with a fully functioning app that helps you search either Google Places API / FourSquare Venues API and get a set of results. When you find what you’re looking for, you can quickly use the app to flip over to iOS6 Maps for navigation with just one click!
More about it later…
But here’s my awesome icon (LocationBot). Not too bad for an hour’s worth of work… right? Attempt #2.
And just for reference, here’s the failed attempt #1:
Pop-upView Separately

LocationBot

Suneth and I decided to take a quick stab at solving iOS6 Map’s annoying lack of business listings (by that I mean Suneth pretty much writing the whole thing!). We are pretty much done with a fully functioning app that helps you search either Google Places API / FourSquare Venues API and get a set of results. When you find what you’re looking for, you can quickly use the app to flip over to iOS6 Maps for navigation with just one click!

More about it later…

But here’s my awesome icon (LocationBot). Not too bad for an hour’s worth of work… right? Attempt #2.

And just for reference, here’s the failed attempt #1:

Failed attempt

    • #icon
    • #design
    • #iOS
    • #app
    • #project
    • #location
    • #maps
    • #iOS6
  • 5 months ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

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):

validates_presence_of :owner_id

What’s better to write is:

validates_presence_of :owner 

This actually makes sure that your :owner_id actually maps to a real object in the database. So you can’t just set a random integer as owner_id and get away with it!

Sadly this has made testing a little bit harder. Tearing through FactoryGirl documentation again now!

    • #rails
    • #ruby
    • #ruby on rails
    • #validation
    • #database
  • 5 months ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

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:

$.ajaxPrefilter( function( options, originalOptions, jqXHR ) {
    options.url = ‘http://yourdomain.com’ + options.url;
});

This prefilter allowed all my BackboneJS calls to be hitting the remote API correctly. I’ve put this on my main.js before the router is initialised just to be sure.

The difficult bit was the server support for CORS (cross-origin resource sharing). Browsers don’t like to let webapps just talk to other domains by default and require the server to specifically support this.

With CORS, there’s generally 2 calls made. The first call is a test from the browser with the HTTP header OPTIONS. Browser asks for what HTTP headers, requests and origins are allowed by the server. Your server has to respond accordingly or none of this will work. The next call is the actual backbone fetch() call.

After all that reading… yes, someone made a fantastic gem for this purpose!! Rack-Cors (https://github.com/cyu/rack-cors) is a rack-middleware addon. The setup instructions are there, it works with rails 3. Quick sample below from application.rb. And that’s it!!

config.middleware.use Rack::Cors do
    allow do
      origins 'https://yourdomain', 'localhost:3000'
      resource '*', :headers => :any, :methods => [:get, :post, :options]
    end
  end
    • #rails
    • #ruby on rails
    • #backboneJS
    • #CORS
  • 5 months ago
  • 2
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

ActiveAndroid

Good shot at bringing #Rails’ ActiveRecord functionality to Android apps. Keep an eye on it!

    • #library
    • #lib
    • #rails
    • #android
    • #database
  • 5 months ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
An MVP is the smallest solution that delivers customer value.
    • #mvp
    • #lean-startup
  • 5 months ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Behavior Driven Development

Great introduction

    • #development
    • #testing
  • 6 months ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

gitignore templates

    • #git
    • #github
  • 6 months ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

CanTango gem - User roles & permissions management on rails

cantango!

This is really the ultimate user role management gem! It is derived from another popular gem called CanCan, written by the great Ryan Bates himself (guy who does railscasts). This gem really builds on the humble beginnings of CanCan. Some of its core features:

  • Managing user roles
  • Permissions per user, account type, roles and roles groups
  • Lots of features like caching engine to autoload permissions etc.
  • Categories, licenses etc etc etc!!

Endless ways to extend the functionality, check it out!

    • #gems
    • #ruby on rails
  • 6 months ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Selectively merging branches with git

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

  1. Checkout the branch you want to merge into: git checkout production
  2. git checkout feature_branch_name <list of files> to merge just the changes from specific files: git checkout push-notif-branch app/controllers/controller.rb config/certificates/* …
  3. Git automatically does a git add into your initial branch with the files you specified. Just follow up with a git commit -m “message” and you’re done!
    • #git
    • #code-management
    • #programming
  • 6 months ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

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.

    • #Ruby
    • #RoR
    • #Ruby on rails
    • #gems
    • #server
    • #github
    • #rails3
    • #rails
  • 7 months ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
Pop-up View Separately
Pop-up View Separately
Pop-up View Separately
Pop-up View Separately
Pop-up View Separately
Pop-up View Separately
PreviousNext

androidniceties:

Google Now for Jelly Bean

Love the UI.

  • 7 months ago > androidniceties
  • 52
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
'\x3ciframe width=\x22500\x22 height=\x22375\x22 src=\x22http://www.youtube.com/embed/GkDz4wMI9J8?wmode=transparent\x26autohide=1\x26egm=0\x26hd=1\x26iv_load_policy=3\x26modestbranding=1\x26rel=0\x26showinfo=0\x26showsearch=0\x22 frameborder=\x220\x22 allowfullscreen\x3e\x3c/iframe\x3e'

This is how you present a compelling argument #iOS6

    • #iOS
    • #apple
  • 8 months ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Discovery of the day: @autoreleasepool { }

  • 8 months ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
Page 1 of 3
← Newer • Older →
  • M2D2

Me, Elsewhere

  • @dineth on Twitter
  • dineth on Pinboard
  • Linkedin Profile

Twitter

loading tweets…

Top

I Dig These Posts

See more →
  • Photo via kaythekoala
    Photo via kaythekoala
  • Photo via chromjuwelen

    (via Spyder Tail)

    Photo via chromjuwelen
  • Photoset via androidniceties

    Google Now for Jelly Bean

    Photoset via androidniceties
  • Photo via ummhello
    Photo via ummhello
  • Photo via californarniadreaming
    Photo via californarniadreaming
  • RSS
  • Random
  • Archive
  • Mobile
Effector Theme by Pixel Union