[PHP] Unable to detect character encoding – how to detect it properly?

Last time I had a very strange case for simple XML file processing. the file was downloaded from the external server, there was no response header about content-encoding but the browser (Chrome) could display it correctly, the file was processed by file_get_contents function. The issue was that preg_match couldn’t find anything and str_replace was not…… Read more [PHP] Unable to detect character encoding – how to detect it properly?

[How To] Change character set and collate for all tables (and fields)

This is the template: Running this query will produce a list of ALTER TABLE queries you can adjust (remove/modify lines for some tables etc.). Just replace [CHARACTER-SET], [COLLATE] and [DBNAME] with values you want to set. If you want to run the code right away just modify statement like this: For example below you can… Read more [How To] Change character set and collate for all tables (and fields)

How to exit from: vi(m), telnet, bash, …

Exit VI(M) Press ESC to enter normal mode, Optional: Type :w (colon + w) to save changes, Type :q (colon + q) to exit vi(m). If you don’t want to save changes, add an exclamation mark – :q! More about vi(m) modes you can find e.g. here: https://en.wikibooks.org/wiki/Learning_the_vi_Editor/Vim/Modes You are not alone: https://stackoverflow.blog/2017/05/23/stack-overflow-helping-one-million-developers-exit-vim/ Exit Telnet Telnet is giving… Read more How to exit from: vi(m), telnet, bash, …

Speed-up your coding with PHPStorm features

In this post I want to present you some basic features of PHPStorm IDE which could really speed-up your coding process. Beware. You’ll not find here any fancy things  – just basics. But still very helpful if you didn’t know it before. Plugins You can install plugins on Preferences > Plugins page. Codeglance Plugin page: https://plugins.jetbrains.com/plugin/7275-codeglance… Read more Speed-up your coding with PHPStorm features

JavaScript: don’t remove element before all events occurs

Sometimes really simple bug can be very hard to find – and expensive to have. In this case I’m talking about business costs – a lot of some specific events for a marketing campaign wasn’t tracked properly. The Problem Tracking of “clicked” events doesn’t work for some buttons (mostly responsible for closing modals/alerts). The Context… Read more JavaScript: don’t remove element before all events occurs