Tuesday, April 29, 2014

Android : Big finding for shared preferences with putStringSet

Wednesday, October 9, 2013

Sorting ruby array based on one condition

Example

1.9.2p320 :013 > ["Carter's", "Gerber", "Petit Bateau (as pictured)"].sort_by { |word| word.include?('(as pictured)') ? 0 : 1}

 => ["Petit Bateau (as pictured)", "Gerber", "Carter's"]