Thursday, 20 March 2014
Thursday, 19 December 2013
Build a hash from an array
We need to build a hash, and we need to build it from each element in an array.
Old way
def visitors_name_email
result = {}
visitors.each do |visitor|
result[visitor.name] = visitor.email
end
result
end
New way
def visitors_name_email
visitors.inject({}) do |result, visitor|
result.merge(visitor.name => visitor.email)
end
end
Wednesday, 18 December 2013
Monday, 16 December 2013
Wednesday, 27 November 2013
Tuesday, 12 November 2013
Noty is a Jquery plugin that makes it easy to create alert, success, error, warning etc....
Noty is a Jquery plugin that makes it easy to create alert, success, error, warning etc....
http://needim.github.io/noty/
http://needim.github.io/noty/
Saturday, 9 November 2013
Difference b/w library and framework
Libraries just fit into your existing architecture and add a specific functionality whereas a Framework gives you an architecture and you will need to follow the rules.
To make it simpler for you – Backbone and Knockout are JavaScript libraries and Ember and AngularJS are frameworks.
Subscribe to:
Posts (Atom)