This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| abstract class AbstractSender | |
| { | |
| protected $senderChecker; | |
| // assume typical getter/setter for $senderChecker | |
| public function send() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Expected working directory structure | |
| =========================================== | |
| ./lib/ConsoleAdapter.js -- your custom modules | |
| ./App.js -- your application main entry point | |
| ./index.js -- purpose of this file is to use the esm module to do all the module loading | |
| Preparation | |
| ======================================= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Assumptions | |
| ================================== | |
| Working directory structure: | |
| ./lib/Console.js | |
| ./App.js | |
| /* in ./lib/Console.js */ | |
| "use strict"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace MyCustomVendor\Catalog\Setup; | |
| use Magento\Catalog\Model\Product; | |
| use Magento\Catalog\Setup\CategorySetup as Base; | |
| use MyCustomVendor\Catalog\Api\CustomProductInterface; // interface with constants defining the keys for all the custom attributes | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace YourVendorName\FrameworkOverride\Framework\Serialize\Serializer; | |
| use Magento\Framework\Serialize\Serializer\Json as Base; | |
| class Json extends Base | |
| { | |
| public function unserialize($string) // override of base class method |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| require(['domReady', 'jquery', 'http://you.can.also.use.urls/blah.js'], function (domReady, $, blah) { | |
| domReady(function () { | |
| // do jquery stuff, among other things | |
| $("#form-validate").css('display', 'none'); | |
| var forgot = $('forgotPasswordLink'); | |
| var forgotEmail = $('email_address'); | |
| $(forgot).on('click', function(event){ | |
| event.preventDefault(); | |
| $("#form-validate").css('display', 'unset'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # to get admin user api token | |
| curl -X POST "http://localhost.magento2.com/index.php/rest/V1/integration/admin/token" -H "Content-Type:application/json" -d '{"username":"admin", "password":"admin123"}' | |
| # example api token: gltdyin7xidjpmkgn2afd5p945hry64d | |
| # use countries api | |
| curl -X GET "http://localhost.magento2.com/index.php/rest/V1/directory/countries" -H "Authorization: Bearer c4chlm8e9j819mss4x1f6hs5jvdu7syp" | |
| # create customer | |
| curl -X POST http://localhost.magento2.com/index.php/rest/V1/customers" -H "Content-Type:application/json" -H "Authorization: Bearer ich23vrq4be4yj671j6u1bx12r3n03u7" -d '{"customer":{"email":"rparsi@commer.com","firstname":"Rahi","lastname":"Parsi","dob":"1976-11-28","storeId":1,"websiteId":1},"password":"Admin123"}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| sudo chown `whoami`:apache -R pub var app/etc | |
| sudo chmod ug+rw -R pub var app/etc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <VirtualHost *:80> | |
| ServerName localhost.magento2.rahi | |
| ServerAlias localhost.magento2.rahi | |
| DocumentRoot /var/www/sites/magento2 | |
| <Directory /var/www/sites/magento2> | |
| Require all granted | |
| AllowOverride All | |
| #<IfModule mod_rewrite.c> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import $ from 'jquery'; | |
| class Modal extends Component { | |
| constructor(props) { | |
| super(props); // props are always read only | |
| this.modalRef = React.createRef(); | |
| } | |
| checkIsOpen() { |
NewerOlder