Posted by Suhas on January 5, 2018 ·
If you have a page that takes a lot of time to generate the cache. The first user who stumbles upon it is in pain. Sometimes it times out before it gets generated completed.
So, I created a method in one of the helper class
def self.recreate_cache
the_controller = ActionController::Base.new
# Set any instance variables required by your partial in the controller,
# they [...]
Posted by Suhas on March 10, 2015 ·
I was trying to store Random IVs generated for AES encryption but couldn’t store them into a PostgreSQL database.
The Random IVs generated were binary data. So, you have to escape them.
While storing, do this
PGconn.escape_bytea(data)
While retrieving, do this
PGconn.unescape_bytea(data)
Posted by Suhas on May 2, 2012 ·
Here’s a quick snippet to install Ruby on your Ubuntu system. RVM = Awesomeness!
login as single user, not root.
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bashrc
source ~/.bashrc
Check [...]