Category: Small Tips

Get All Files in Directory and All Child Directories

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

Tagged with: , , , , ,

Change default date for Jackson in Spring Boot application

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

Tagged with: , , , , , ,

API Versioning – best practices

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

Tagged with: , , ,

Load configurations from custom bundle in Symfony2

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

Tagged with: , , ,

Install PHP mcrypt on UNIX server

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]

Tagged with: ,

SQL: Remove HTML with procidure

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

Tagged with: , ,

Magento: How to reset admin pssword

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

Tagged with: , ,

Serve main domain from subdirectory with .htaccess

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

Tagged with: , ,

Magento white screen or how XML can break your site?

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

Tagged with: , , ,

MySQL – Delete/Drop all tables with specific prefix

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

Tagged with: , , ,
Top