Skip to content

Instantly share code, notes, and snippets.

View mrtuvn's full-sized avatar
👨‍💻
Keep calm and enter your center

Tu Nguyen mrtuvn

👨‍💻
Keep calm and enter your center
View GitHub Profile
/*
* author: pace zhong
* date: 2015-06-15
* desc: accordion componet
* dependencies: jQuery 1.6+
*/
define([
'jquery'
], function ($) {
'use strict';
@mrtuvn
mrtuvn / ubuntu commands start.txt
Last active January 28, 2019 04:10
Commands for start machine from clean setup
sudo apt-get install build-essential gcc make perl dkms git
sudo apt install apt-transport-https ca-certificates curl software-properties-common
sudo /sbin/vboxconfig
#fix for virtualbox + vagrant
sudo apt-get install nfs-common nfs-kernel-server
sudo apt install php7.2 php7.2-common php7.2-cli php7.2-fpm
@mrtuvn
mrtuvn / fballiano-docker-compose.yml
Created February 17, 2019 16:02
customize docker compose for magento 2
version: "3"
services:
cron:
image: fballiano/magento2-cron
depends_on:
- apache
- varnish
links:
- db
- cache

Running Magento 2 functional tests

  1. If not installed, download and install JDK: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  2. Download selenium server: http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar
  3. Run selenium filter: java -jar ~/Downloads/selenium-server-standalone-2.53.1.jar
  4. [Automated in current vagrant box] Copy dev/tests/functional/phpunit.xml and change: app_frontend_url, app_backend_url (i.e. URL's of your storefront and admin page).
  5. [Automated in current vagrant box] Copy dev/tests/functional/etc/config.xml and change: application/backendLogin, application/backendPassword (i.e. admin username and password).
  6. Add the following custom server declarations to dev/tests/functional/etc/config.xml and use one of them at a time
    <server>

UPDATE setup_module SET schema_version = 'x', data_version = 'x' WHERE 'MODULE_NAME' = 'module';

//Add admin

php bin/magento admin:user:create --admin-user='admin2' --admin-password='123123q' --admin-email='[email protected]' --admin-firstname='Admin2' --admin-lastname='Admin2'

//git log find magento ticket git log origin/2.4-develop --grep 'MAGETWO-95311'

@mrtuvn
mrtuvn / auth.json.sample
Created April 19, 2019 02:05
auth.json.sample
{
"github-oauth": {
"github.com": "TOKEN"
},
"http-basic": {
"packages.vnecoms.com": {
"username": "key",
"password": "pass"
},
"repo.magento.com": {
@mrtuvn
mrtuvn / Collection.php
Last active June 18, 2019 15:17
PdfPro Fix storeview
<?php
namespace Vnecoms\PdfPro\Model\ResourceModel\Key;
use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;
class Collection extends AbstractCollection
{
protected function _construct()
{
@mrtuvn
mrtuvn / get_table_name_from_collection.txt
Created July 19, 2019 02:36
Get table name from collection magento 2
$from = $this->collection->getSelect()->getPart('from');
$table = $from['e']['tableName'];
@mrtuvn
mrtuvn / classes_and_interfaces.txt
Last active January 29, 2020 23:57
Interfaces, Classes Helpful In Magento 2
#Catalog
> Magento\Catalog\Model\Locator\LocatorInterface
getProduct getStore getWebsiteIds getBaseCurrencyCode
> Magento\Catalog\Api\ProductLinkManagementInterface
> Magento\Catalog\Model\ResourceModel\Product\Website\Link
#Framework
Interface for entities which can be extended with custom attributes.