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?
Recently, I was reading Zen and the Art of Running when I came across a very interesting topic: Mindfulness. My initial understanding of the word mindfulness was more like combination of awareness and alertness of mind in present state. Though this definition is not incorrect but this word has far greater and deep meaning and its power can change your attitude entirely towards different everyday scenarios.
Continue reading Mindfulness
One thing I have realized over the time is title of this post. I am a firm believer of idea that motivation, no matter how strong and powerful it may feel, will eventually cool down. It can be a new year’s resolution, a sudden surge of energy you felt while you were passing by the gym, a strong will to lose weight when you saw your tummy in the mirror or a new side project idea that kept you awake all night. We face similar scenarios routinely in our daily lives and all these occasions have a common pattern: a sudden powerful will to act, preparation in excitement, few days of quick action and then not so happy ending. At the end we realize we aren’t motivated enough anymore, we give up the change and simply go back to old routine.
Continue reading Motivation is temporary, discipline is permanent
In past two years, along with day job, I have worked on several side projects with different people. Here are lessons I have learned and few do’s and dont’s
Continue reading Lessons learned while working on side projects
Continue reading Why my browser sent duplicate requests to the server for a page?
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
While some people argue against these functions, I think they are pretty good tools for rapid prototyping. And I really missed them in iOS, so I created similar functions in my iOS projects. Here is how they can be used:
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?
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