2 posts in total

Tip

Posts tagged

HTTP headers in Rails

by Syed Aslam · 1 min read

Accessing the headers sent by clients in rails spits out both headers along with other environment variables. This adds a bit of inconvenience if you want to process only the external headers.

Keeping array elements uniq in Ruby

by Syed Aslam · 1 min read

With uniq method you can remove duplicates from an array, however using the bitwise | operator we can avoid adding duplicate items in the first place.