rails authentication: authlogic to devise

Originally posted on Nakshtra:
Are you using authlogic for authentication purpose in your rails application and now want to switch to Devise? Overview of Authlogic: user = User.find_by_email(‘test2@endpoint.com’) actual_password = “password” digest = “#{actual_password}#{user.salt}” 20.times { digest = Digest::SHA512.hexdigest(digest) } # compare digest and user.crypted_password here to verify password Note that the stretches value for…

git today: know your work

Originally posted on Nakshtra:
Do you want to know all your git commits from different repositories and even from different branches? First, create this alias: git config –global alias.today “log –since=midnight –author=’John Roy’ –oneline” Here replace author name with yours. You can avoid hard-coding your name as follows: git config –global alias.today ‘!git log –since=midnight –author=”$(git config user.name)”…

Importing CSV and Excel in rails 4 and ruby 2.0

You can use a single gem ‘roo’ for reading all types of file, instead of rubyXL, spreadsheet etc. multiple gems for different files(.xls, .xlsx). You can check here railscasts for importing csv and excel import in ruby 1.9.3. But this code snippet is not working with Ruby 2.0. As this episode used gem ‘roo’ for reading files and gem ‘roo’ has been updated…