Thursday, May 26, 2016

Stack Trace analysis - finding a bottleneck

Always bear in mind that the level above (parent node in Stack Trace) might have called other functions in the same level, That means, you cannot have all the information in a level. Only totals of previous level might possible to calculate (i.e. total processing time up to a point in stack trace).

Tuesday, May 17, 2016

Fixing Chrome's ERR_NETWORK_CHANGED error

If you are frequently facing the gray ERR_NETWORK_CHANGED error in your Chrome, you should try disabling "Automatically detect settings" in Control Panel->Connections->LAN Settings.


Monday, May 16, 2016

jQuery - select by multiple attributes - whitespaces are very important!

If you want to fetch this element:

<p data-t1='a' data-t2='b'></p>

You need this code:

jQuery([data-t1=a][data-t2=b])

instead of:

jQuery([data-t1=a] [data-t2=b])

The later would return 0 elements

Saturday, May 14, 2016

Mass rename using Linux rename command

rename command is useful for mass rename operations on many files in a single directory.

-n parameter enables test mode (no real changes done)
-v enables verbose mode

Thursday, May 12, 2016

Gravity Forms causing error 404 on WP frontend

If this error happens, probably GF WebAPI controller's wp_rewrite logic is conflicting with the wp_rewrite logic from other plugins. Just disable Gravity Forms WebAPI and it should help.

Monday, May 9, 2016

ASP.NET MVC has server side cache enabled by default

When developing ASP.NET MVC apps, be sure you calculate with cache being enabled by default(for js, css, and other file types).

Thursday, May 5, 2016

phpstorm, default builtin web server for php

Default location (port) for phpstorm's builtin server:


http://localhost:63342/

port: 63342

phpstorm + gulp - automate scss generation

If you use phpStorm, you can easily automate generation of the CSS files from source SCSS file using gulp.

Just use the Settings ->File Watchers with parameters like this (under Windows you should use gulp.cmd instead of just gulp script).


Windows: Keyboard shortcut for moving windows between monitors (multi monitor setup)

  • Windows: Keyboard shortcut for moving windows between monitors (multi monitor setup)


  • Win+Shift+Left: Move the window to the monitor on the left
  • Win+Shift+Right:  Move the window to the monitor on the right


Some other tricks:
  • Win+Left : Snap to the left half of the screen
  • Win+Right: Snap to the right half of the screen
  • Win+Up: Maximize the window
  • Win+Down: Minimize/Restore



Wednesday, May 4, 2016

WP ACF - ideally, you should be using keys instead of field names in ACF's CRUD methods

If you rely on field name, instead of field key, your CRUD operations (add_row, update_field, etc) might silently fail (by just returning false).

For example:

//this can silently fail returning FALSE:
$field_key = "org_shareholders";

//this should always work:
$field_key = "field_5717fad0e2885";




PSR-1 and PSR-2 coding standards for PHP

Visual aspects of code play a significant role in raising or drowning developer's productivity. In case that there's too much clutte...