Category Archives: Programming

Installing PHPUnit with Composer on Windows

On Windows to install PHPUnit, need Composer, which you can download from https://getcomposer.org/Composer-Setup.exe. Also need Git, which can be downloaded from http://git-scm.com/download/win. I installed Git with the option "Use Git from the Windows Command Promt". After you install Git and … Continue reading

Posted in Programming | Tagged , , , , | 3 Comments

Disable phpMyAdmin ajax notifications

Installed a new version of phpMyAdmin 4.2.7 and noticed that with ajax version appeared a notification about every action in the middle of the screen. It is often notifies not mandatory actions, such as loading the page and it can … Continue reading

Posted in Programming | Tagged , | Leave a comment

Android virtual device screen bit depth

Using drawable with a gradient there is visible defects on Android virtual device (emulator) because screen bit depth is 16 bpp by default. AVD bit depth can be increased in settings. Create AVD with checked box Use Host GPU, open … Continue reading

Posted in Programming | Tagged , , | 1 Comment

Resize and crop image from center with PHP

Sometimes I need to not only resize the image, but also to change its size by removing unnecessary edges for new size. This function changes image size and if the height or width is too large after resizing then the … Continue reading

Posted in Programming | Tagged , , , | 26 Comments

Outbound links click tracking with Google Analytics

Google Analytics allows you to create events and track them. It can be used to track clicks on links to external sites. For example, we need to track only the outbound links and email clicks, then with jQuery filter links … Continue reading

Posted in Programming | Tagged , , , | Leave a comment

Show only sticky posts on home page in WordPress

To create a list of posts by WordPress query it is possible to filter it by adding a custom filter to the condition. For example, if you need to show only sticky posts, you have to take a list of … Continue reading

Posted in Programming, WordPress | Tagged , , , , | Leave a comment

jQuery Jeditable and Chosen hybrid

Jeditable – edit in place plugin for jQuery. Chosen - jQuery plugin that makes select boxes user-friendly. So why not combine them together. This javascript code will let you select in place with Chosen select box. Default list and save … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment

jQuery Jeditable and Autocomplete hybrid

Jeditable – edit in place plugin for jQuery. The Autocomplete - jQuery UI Autocomplete control widget provides suggestions while you type into the field. So why not combine them together. This javascript code will let you edit in place along … Continue reading

Posted in Programming | Tagged , , , , , | 5 Comments

Sort by specific order in MySQL query

If you want to sort the list by a certain order, such as a list of numbers from the beginning of 4,5,1, and then in ascending order, you can create a sort order by IF statement rule with additional columns … Continue reading

Posted in Programming | Tagged , , , | Leave a comment

Local date format in PHP or MySQL

If locale is installed on the server then with PHP: For MySQL local date:

Posted in Programming | Tagged , , , | Leave a comment

Display data from long running PHP script with jQuery

When a PHP script is executed for a long time and it is not clear what it is happening, such as a long loop, a prolonged processing, rainy weather, or other magical things. That is, the desire to see what … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment

Text wrap for imagettftext

One line text does not always fit into a given width of the picture, then you need to word wrap the text to a new line, depending on the width. If only the width is less than one word, then … Continue reading

Posted in Programming | Tagged , , , , | 4 Comments