Category: Small Tips

I was playing with PHP the other day and was trying to fetch and rename 1000s of files I have stored locally on my machine. Seemingly PHP isn’t the best language to that operation Python or even BASH could do …

Get All Files in Directory and All Child Directories Read More »

Tagged with: , , , , ,

Dates as a concept are seamingly simple and straight forward. Though in programming world those could be rather complex starting from format, representation, time zones, machine default configuration going through different calendars and date manipulations. In this post I won’t …

Change default date for Jackson in Spring Boot application Read More »

Tagged with: , , , , , ,

What happens if you need to make changes to your API? If you’re making additions to the API – e.g., adding services or adding fields to your services – you likely don’t need to do anything more to notify users …

API Versioning – best practices Read More »

Tagged with: , , ,

When I build apps or add new functionality to Symfony2 I build it into a separate bundle, thus trying to keep the structure modular which is generally a good practice as everyone knows. Keeping all parts of the bundle together …

Load configurations from custom bundle in Symfony2 Read More »

Tagged with: , , ,

In this quick tip I’ll show you how to install the PHP extensionmcrypt. This is needed for Magento to run properly otherwise you’ll get an error like: [cc type=”text” escaped=”true”]Fatal error: Call to undefined function mcrypt_create_iv() in lib/Varien/Crypt/Mcrypt.php on line 64[/cc] …

Install PHP mcrypt on UNIX server Read More »

Tagged with: ,

I had a problem with client’s data that was saved as HTML in the database and I needed it in plain format. Many would say this is very inefficient way of doing it but sometimes desperate time call for desperate …

SQL: Remove HTML with procidure Read More »

Tagged with: , ,

If you forget your admin password for Magento and you can’t remember the email or just want quick fix you can use one line of SQL to sort that issue out. [cc lang=”sql”]UPDATE admin_user SET password=CONCAT(MD5(‘qXpassword’), ‘:qX’) WHERE username=’admin’;[/cc] All …

Magento: How to reset admin pssword Read More »

Tagged with: , ,

If you are running your site on a shared hosting and you have multiple domain installed as subdirectories the things could go out of hand really fast. In my specific case I have multiple installs of different CMS and one …

Serve main domain from subdirectory with .htaccess Read More »

Tagged with: , ,

I had an odd white screen on one of my websites. No exceptions, no messages, it was time to check the error log. There I found the following error: [cc lang=”text”]PHP Fatal error: Call to a member function extend() on …

Magento white screen or how XML can break your site? Read More »

Tagged with: , , ,

MySQL is great database especially for small and mid size web applications. You can do loads of stuff with it but not everything is possible with regular SQL query. Imagine you have a database and you want to delete set …

MySQL – Delete/Drop all tables with specific prefix Read More »

Tagged with: , , ,