browse the blogs

[ 22 Nov 2017 ]

CMocka: Unit Testing C Code:

Coming at C from a “test legacy code first” point of view is tricky. All those neat test framework features for testing code not written under test (i.e. mocks, etc.) rely on a language’s dynamic nature for implementation details. You don’t get that easily in C, so it was a pleasure to be introduced to the cmocka framework. In addition to being a fully featured unit test framework (pass/fail tests, fixtures, etc.), cmocka allows you to “mock” specific C functions in a particular test suite using the linker’s –wrap option. I use the term mock loosely here. The system itself […]

[ 20 Nov 2017 ]

Magento 2 Command Line Test Invocations:

I’m not sure if the talks (i.e. videos) from the recent MageTestFest conference will show up online, but these slides from Vinai Kopp are worth a link, if only because they capture most of the weird, non-obvious incantations you’ll need to run Magento 2’s unit and integration tests.

[ 17 Nov 2017 ]

PHP Meminfo and Memory Leaks:

You can’t walk ten steps in this businesses without hearing Engineering is a set of tradeoffs. You rarely hear the other side of that: and sometimes we make the wrong tradeoffs which lead to living with garbage behavior for years. PHP leaks memory like a sieve. By leak we mean during a long running PHP request the amount of memory will slowly increase over time because there’s some memory the garbage collector can’t free up. The usual response to this is a shrug, and mumbling some words about PHP’s process model taking care of this. i.e. PHP doesn’t have many […]

[ 16 Nov 2017 ]

Magento UI Components 2017:

Campaigning season’s winding down, which means conference season is upon us. Two years after release, Magento’s XML/PHP/HTML/Javascript/KnockoutJS based UI Component System continues to be a topic of regular dissection and drubbing. At the recent Mage Titans conference in Manchester Maria Kern gave a well regarded talk on what, exactly UI Components are. It is good. You should watch it. At the same conference some other, well regarded speakers mentioned how they’re opting out of any work that requires UI Components because the system is (paraphrasing) The Swamp of Despair. Technically speaking, this is where I mention my UI Components Series […]

[ 14 Nov 2017 ]

Magento 2: Dependency Injection and API Calls:

This one came out of a conversation in my Patreon mentoring Slack room. Someone was having trouble with their Magento 2 object manager configurations (di.xml) not showing up — but only during checkout. Their problem? They were dropping their di.xml files into the frontend folder etc/frontend/di.xml This is good enough to get class preferences and plugins set for the page that renders the checkout, as well as any pages that make ajax requests through a frontend controller. However — the stock Magento checkout application also accesses Magento’s rest API directly, and rest API requests happen in a custom area call […]

[ 14 Nov 2017 ]

React and WordPress:

My career’s headed down the other end of the Stack these days, so caveat-ihaventusedit-emptor, but based on pedigre alone this WordPress+React starter kit seems worth checking out.

[ 1 Oct 2017 ]

Just Enough C for PHP: Running C Programs:

This entry is part 2 of 2 in the series Just Enough C for PHP. Earlier posts include Just Enough C for PHP. This is the most recent post in the series. In our last article, we promised to show you how to run a simple hello world program written in C //File: main.c #include int main() { printf(“Hello World\n”); return 0; } If you’re lucky, and your computer already has the tools you’ll need to work with C, all you’ll need to do is create the above main.c text file, and then run the following terminal commands $ cd […]

[ 17 Sep 2017 ]

Chrome to force .dev domains to HTTPS via preloaded HSTS:

TLDR; There’s a real .dev top level domain that Google owns (and Amazon previously tried to buy), and a recent Chromium nightly (Google Chrome’s browser engine) automatically redirects all .dev domain names to an HTTPs version of the site. Chrome to force .dev domains to HTTPS via preloaded HSTS

[ 16 Sep 2017 ]

Unofficial Magento Roadmap:

An Unofficial Magento Roadmap, pulled together from various promises, metions, and allusions made by Magento Inc. employees. (Glad I took Dr. Jones’ course at Marshal University (I thought about Kremlinolgy joke instead but too real)).

[ 4 Sep 2017 ]

Git Move:

When I’m working solo, (which usually means I’m doing the initial scoping and prototyping of some sort of feature and/or system), my “git workflow” is usually a shove it all into master affair. When I switch off to team work I often find myself in a situation where I’ve done a done of work without branching first. That’s where git move comes to the rescue. Okay, one more… Ever commit something only to immediately realize that you’re on the wrong branch? Use “git move ”. http://pic.twitter.com/fKpZTRkdRu — coderabbi™[for rent] (@coderabbi) September 4, 2017