It’s been almost exactly 2 years since my last post, and I’m excited to start writing again. My blog was on Wordpress previously, and part of me was dreading getting back into that for such a simple site. So, I decided it was time to try something different: I settled on Hugo, a static site generator, and so far have been extremely pleased. I’ll write more about that transition in a bit. »

Linux swap directories quickly

If you’re hopping back and forth between say /etc/apache2 and /var/log/apache2. From /etc/apache2 type: pushd /var/log/apache2   This pushes /etc/apache2 on the directory stack and then cd’s to /var/log/apache2. Now to go back, just type: pushd   This swaps the current directory and the directory on the top of the stack. pushd again and you’re back to /var/log/apache2. »

Triggering xdebug from PHPStorm's REST client

If you want to trigger and xdebug session from PHPStorm’s REST client (or anywhere else for that matter), you can set the debug cookie manually. Add a new Request header: Name: Cookie Value: XDEBUG_SESSION=PHPSTORM The value to use for XDEBUG_SESSION can be set in php.ini under xdebug.idekey   »

PHPStorm Tip - Conditional Breakpoints

Simple Condition: After creating a breakpoint - right click - Edit. The conditions box lets you enter the conditions under which the breakpoint will suspend execution. Break only if another breakpoint has been hit: I've found this really handy for functions that get called a lot, but I only want it to suspend when it's been called from a specific place. This is great, for example, if I want to only break on a line after it's been called by a specific test. »