Muhammed Imran Hussain

LAMP/LEMP, MEAN, JAVA Developer

SQL: Faster way to COUNT records from large data set

For small data set COUNT() function works fine but for large data set for example 1M records the query may exceed time limit. Since MySQL >= 4.0.0 we can use SQL_CALC_FOUND_ROWS option and FOUND_ROWS() function. SQL_CALC_FOUND_ROWS tells MySQL…

Read More »

CURL response is empty; API server running on Docker container

My API endpoint (for example http://localhost:3000) server running on Docker container. Initiated curl session in PHP (vagrant box) and the response was empty. Here is the code sample without proxy.

I then read docker networking docs and…

Read More »

(AngularUI) UI-grid auto height and remove scrollbar

Angular-UI-grid is a powerful data grid library. But it’s scrollbar and fixed height is really annoying. Here is the quick fix: Set 100% width and height:

Remove scrollbar:

Read More »

ImageMagick delegate failed error – Fix

ImageMagick is a great tool to create, edit, compose, or convert images. I was working on converting DNG files into JPG using ImageMagick and convert command was throwing following errors.

After spending several hours I found ImageMagick…

Read More »

(WordPress) How to handle multiple instance of “send_to_editor” js function

WordPress built-in media uploader is a great library for uploading media. We can create a upload popup instance for upload media or select media from media library by following way:

After upload done we can get the…

Read More »