Categories


Recent Posts


Archives


Category: Programming Quickies

Back in they day, I ran a Tumblr blog named Magento Quickies where I’d post shorter, less in-depth posts about my travels through Magento’s source code. This Programming Quickies categories is the successor to that Tumblr blog. You’ll find all the old Magento Quickies content here, as well as new short posts about programming in general.

This section has its own RSS feed, the old Magento Quickies feed should should be redirecting, and we’re cross posting notifications for new posts over to magento-quickies.tumblr.com. In other words, you shouldn’t need to know any of this, but the duct tape that keeps the internet held together isn’t aging well, so your mileage may vary.

Below you'll find all the Programming Quickies articles on the site, followed by a chronological listing of the same. You may also browse the 7 series directly via the following links. Pestle, Four Steps to Async Iterators, Checking in on OpenMage and Magento in 2020, Text Encoding and Unicode, Shopware's Development Environment, A Sentimental Gen-X Programmer Culls his Tech Books, and, Containers, Containers, Containers.

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. [...]

astorm

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 [...]

astorm

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 [...]

astorm

Git Move

Visit Linked Page

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 <branch>". pic.twitter.com/fKpZTRkdRu — coderabbi™[for rent] (@coderabbi) September 4, 2017

astorm

Re: A Declarative Approach for Database Schema Upgrades

Visit Linked Page

Re: A Declarative Approach for Database Schema Upgrades It sounds like Magento’s planning a pretty radical overhaul of how it handles schema and data upgrades between versions. The looks to be a fiat from on high (vs. the community driven approach they’ve been using for bug fixes). If you’re making schema/data changes that aren’t in Magento’s core or Marketplace code bases, you’ll want to pay attention to this – your deck chairs may need shifting about.

astorm

oddyssey/mailtrap

Visit Linked Page

oddyssey/mailtrap A simple mailtrap extension for Magento 2. Mailtrap is a service that lets you point your development instances at an SMTP server that accepts mail, but doesn’t deliver it. Instead mailtrap collects all the mail in a single INBOX. If you’ve ever accidentally emailed an entire customer list with a subject line like Subject: Testing, hope this s——t works. you’ll instantly see the value. The Magento extension is also a simple example of how to hook into the MagentoFrameworkMailTransport class with a custom preference and change the behavior of the email system.

astorm

Reserved Words in Magento 2 URL  Paths

Visit Linked Page

Reserved Words in Magento 2 URL  Paths A StackExchange self answer where I use a plugin to work around the reserved-PHP-symbol-in-class-name problem that can plague Magento 2 URL routing. What’s extra baffling about this is Magento has a fix coded up, but only applies it to one URL segment. I suspect this is less baffling if you can gives up the idea that Magento 2 should retain its the rapid application prototyping roots of its ancestors.

astorm

Magento 2 – Form Validation

Visit Linked Page

Magento 2 – Form Validation A StackExchange post that contains most (all?) of the CSS classes that can control Magento 2’s form validation. Magento seems to apply the validation rules on all form submits – although I haven’t dug too deeply into that one so caveat emptor etc. Also, a bonus for folks who read these Tumblr desciptions — here’s a quick bit of javascript that will take M1 style HTML and make all the fields required in an M2 context. require(['jquery'], function($){ $('.required-entry').each(function(key, element){ $(element).attr('required','required'); }); }); Useful if you have a complex form built with a combination of […]

astorm
email hidden; JavaScript is required