How to setup Google reCAPTCHA in a ReactJS app?

Google’s reCAPTCHA is an industry standard when it comes to fighting bots. Integrating it in a regular web app has almost become a no-brainer, thanks to plugins available on almost every platform to do the job. With this expectation, I started integrating it in my latest app built on ReactJS but encountered many roadblocks. Without going into details, I’m sharing here fastest recipe for integrating it with your ReactJS app.
Continue reading How to setup Google reCAPTCHA in a ReactJS app?

How to install ColorThief in a NodeJS project?

ColorThief is an incredibly cool library that not only gives you dominant color of a given image but also generates a color palette out of it. However, trying to make it work in a NodeJS project can become devilishly hard because of its dependencies which go beyond the realm of NPM. Here I’m sharing the steps I went through, so you don’t have to repeat the struggle. Note that my steps are for OSX, so you’ll have to translate them yourself if you’re on a different platform.
Continue reading How to install ColorThief in a NodeJS project?

Why my browser sent duplicate requests to the server for a page?

I have a specific page in one of my webapps, requesting which from browser sent duplicate requests to the backend controller. We spent hours and hours but found no clue: there was no page refresh tag in head, no JavaScript that would invoke a reload, no favicon problem.
Continue reading Why my browser sent duplicate requests to the server for a page?

An Easy Way To Use Contact Picker

API for selecting a contact in iOS seems unnecessarily difficult, it becomes a nightmare when you have to use it again and again at different places in your project. I think the idea of delegates is over-used in iOS, and they could have made things much simpler by relying on blocks instead.
Continue reading An Easy Way To Use Contact Picker

How to make scrolling work on an iOS app screen?

Among many other things, scrolling is one that we take for granted when developing web apps. As soon as content grows beyond visible screen, good browsers themselves add scrollbars to the screen. Try making it work on an iOS app screen, you’ll be surprised how tricky this thing can get.
Continue reading How to make scrolling work on an iOS app screen?

Taming UIAlertView

There are a few things in iOS development which are surprisingly difficult, UIAlertView is one of them. If your UIAlertView contains only one button, which cancels the dialog, things will be easy. But as soon as you’ll think of adding more buttons to it, you’ll realize that you’ll need to create a delegate class and assign the delegate to the UIAlertView instance. This is ridiculous, because given the frequency of use of UIAlertView, you’ll end up creating unnecessary delegate classes.
Continue reading Taming UIAlertView

How To Extract String Reference To An Image In iOS And Then Load The Image Later?

Recently I had to create this flow in one of my projects:

  1. Let the user select an image from the gallery.
  2. Store the image reference to Core Data.
  3. Later, load the image from the gallery using the saved reference and show image again to the user.

Here is how I did the job:
Continue reading How To Extract String Reference To An Image In iOS And Then Load The Image Later?