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.
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, 2017astorm
Real Talk: I mostly just split/explode strings down to the parts I need these days, but I’ll always have a palce in my heart for regular expressions. Regular expression cheat sheet. pic.twitter.com/C0PdZ5aNXx — Mike Kearney📊 (@kearneymw) September 3, 2017astorm
One thing I breezed by in my recent Modifying a jQuery Widget in Magento 2 article was the whole returns two widgets RequireJS module thing. We mentioned that modules like the mage/menu module will do this. //File: vendor/magento/magento2-base/lib/web/mage/menu.js define([ "jquery", "matchMedia", "jquery/ui", [...]astorm
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
Menu Editor to Replace Category Based Menus in Magento 2. Feels like I can recommend checking out stuff from SnowdogApps, sight unseen.astorm
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 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 custom Knockout.js bindings | Magento 2 Developer Documentation It might have taken 11 months, but it looks like Magento finally gave its dev docs team the resources they needed to document the UI Component Knockout JS custom bindings.astorm
Packagento – A curated list of open source Magento 2 modules A new Composer repository from Adam Johnson that’s curating open-source Magento 2 extensions.astorm
(Putting this here in an external-memory/thinking-out-loud sort of way) Prior to Magento 2’s release, Magento executives circulated the idea that Magento 1 would reach its “end-of-life” three years after the release of Magento 2. Magento 2 was released November 17, 2015, which means Magento 1 reaches its end-of-life [...]astorm
(With apologies to whomever originally posted this technique – I can’t seem to find your original article. If you’d like link/credit just let me know) As companies start to go ahead with Magento 2 builds and Magento 2 upgrades, more an more developers are wondering what to do about the missing code pools from Magento 1. [...]astorm
List of mod_security Rules for Magento 1 A list of instructions from the (semi?) independent Mage Security Council on installing their scanner. This sort of buries the lead – the end of the instructions point off to a list of malware fingerprint, which server administrators can use to block common attacks before they ever reach Magento.astorm
The bin/magento setup:upgrade Command will Enable Non-Enabled modules · Issue #9516 · magento/magento2
The bin/magento setup:upgrade Command will Enable Non-Enabled modules · Issue #9516 · magento/magento2 Weird bit of behavior where the setup:upgrade command will automatically enable any module you’ve dropped into app/code. Small, but annoying bit of behavior if your run into it.astorm
I’m writing this down so I can remember it later – if you’re not deep into Magento service contracts apologies for the word soup. When Magento’s parsing doc block’s for parameter types, it’s only looking at interfaces – or possibly its only looking at the type it knows about. i.e. if you have [...]astorm