Recent Activity
Software bugs are inevitable; some are especially difficult to track down, causing you to waste countless hours before throwing your hands up in defeat. It doesn't have to be this way! The mental fatigue and wasted time can be avoided by using strategies like identifying the most-appropriate tool, taking a logical & objective approach, challenging assumptions, listening to variables, isolating the code path, and reinforcing code with automated tests.
I recently upgraded my system from Ubuntu 16.04 with Unity to Ubuntu 17.10 with Gnome Shell 3. One of the "features" I found annoying was that my IDE PhpStorm was not popping to the front and receiving focus whenever breakpoints were hit. I eventually figured out a solution and wanted to document it in case others were also searching for a solution.
I first confirmed that "Focus application on breakpoint" was indeed enabled in my settings:
Back in November I released colinodell/json5 - a JSON5 parser for PHP. It's essentially a drop-in replacement for PHP's json_decode()
function, but it allows things like comments, trailing commas, and more.
Fast forward to this weekend when I received the following bug report from a user named Antonio:
league/commonmark is wrapping up 2017 with the release of version 0.17!
Changes include:
- Minimum PHP version bumped to 5.6
- New "max_nesting_level" setting
- A few performance optimizations
- Clean up deprecations and not-so-great code
For more info, check out:
Psst - PHP 7.4 is now available! Learn how to upgrade to PHP 7.4 here!
Magento has just released the SUPEE-10415 security patch for the following versions:
- Magento Commerce 1.9.0.0-1.14.3.7 (formerly known as Enterprise Edition)
- Magento Open Source 1.5.0.0-1.9.3.7 (formerly known as Community Edition)
The patch contains fixed for several security vulnerabilities including cross-site request forgery (CSRF), Denial-of-Service (DoS), and authenticated Admin user remote code execution (RCE).
This weekend I released an open-source JSON5 parser for PHP!
JSON5 is a JS-compatible extension to JSON which allows comments, trailing commas, single-quoted strings, and more:
colinodell/json5 is a UTF-8 compatible JSON5 parser for PHP. It provides a json5_decode()
function which is a drop-in replacement for PHP's existing json_decode()
function.
JSON5 is a JS-compatible extension to JSON which allows comments, trailing commas, single-quoted strings, and more.
I recently came across this really helpful PHP trick:
You can cast a numeric string to either int
or float
, depending on its contents, by simply adding 0
:
var_dump("1" + 0);
// int(1)
var_dump("1." + 0);
// float(1)
var_dump("1.0" + 0);
// float(1)
var_dump("1.5" + 0);
// float(1.5)
That's much cleaner than trying to make a conditional cast yourself: