Image brightness detection in client side script

This function will convert each color to gray scale and return average of all pixels, so final value will be between 0 (darkest) and 255 (brightest) function getImageLightness(imageSrc,callback) { var img = document.createElement(“img”); img.src = imageSrc; img.style.display = “none”; document.body.appendChild(img); var colorSum = 0; img.onload = function() { // create canvas var canvas = document.createElement(“canvas”); … Read more

Can you get a public Facebook page’s feed using Graph API without asking a user to allow?

If you’re anything like me your clients won’t want a standard Facebook likebox plugin, they’ll want it all styled and customised their own way. You don’t need to spend all day going round the official documentation wondering if any of it applies to you for something simple like this, it’s quite easy. The confusion arises … Read more

AngularJS: Understanding design pattern

Thanks to a huge amount of valuable sources I’ve got some general recommendations for implementing components in AngularJS apps: Controller Controller should be just an interlayer between model and view. Try to make it as thin as possible. It is highly recommended to avoid business logic in controller. It should be moved to model. Controller … Read more