Client side JavaScript error reporter.
I am too much afraid of client side code which can potentially slow down or even block page load which will negatively affect user experience. That’s why I am not bothering to try it on production sites. May be next time…
While working on photo application for iOS which allows users to apply certain photo filters I am gathering some information and resources on digital image processing. Here what I’ve found so far in no particular order:
CarrierWave has an awesome ability to attach file to the model by downloading it via remote URL. Utilizing this feature, I’ve faced a problem when remote file does not have an extension thus failing the extension white list check. These files without extensions, however, are 100% correct image files and can be attached to the model safely. The workaround for this behavior is to try to detect the extension after caching file locally using it’s mime type.
Checkout my solution here:
You can do retry cycles in Ruby easily using ‘retry’ statement:
tries, max_tries = 0, 5 begin # raise an error if the code failed and needs to be retried rescue tries += 1 retry unless tries == max_tries end