Skip to content

Instantly share code, notes, and snippets.

View phamdinhhau's full-sized avatar

Hau Pham phamdinhhau

View GitHub Profile
<!-- GTranslate: https://gtranslate.io/ -->
<a href="#" onclick="doGTranslate('en|en');return false;" title="English" class="gflag nturl" style="background-position:-0px -0px;"><img src="//gtranslate.net/flags/blank.png" height="16" width="16" alt="English" /></a><a href="#" onclick="doGTranslate('en|id');return false;" title="Indonesian" class="gflag nturl" style="background-position:-300px -300px;"><img src="//gtranslate.net/flags/blank.png" height="16" width="16" alt="Indonesian" /></a>
<style type="text/css">
<!--
a.gflag {vertical-align:middle;font-size:16px;padding:1px 0;background-repeat:no-repeat;background-image:url(//gtranslate.net/flags/16.png);}
a.gflag img {border:0;}
a.gflag:hover {background-image:url(//gtranslate.net/flags/16a.png);}
#goog-gt-tt {display:none !important;}
.goog-te-banner-frame {display:none !important;}

###RequireJs Modules

  • RequireJs module needs to be defined inside: Your_Module/view/frontend/web/module.js path

  • Simple RequireJs module definition can look like this:

http://collabshot.com/show/A65S78

@phamdinhhau
phamdinhhau / Mb-M2-resources.md
Created October 14, 2022 04:36 — forked from molotovbliss/Mb-M2-resources.md
Magento2 Resources List; Needing a place to keep a list of all the tools/references used during Magento development.
@phamdinhhau
phamdinhhau / VS Code Disable GPU Acceleration
Created April 13, 2022 04:47
VS Code Disable GPU Acceleration
Visual Studio Code frequently crashes linux. Using NVIDIA GPU
1. Open command pallete (Ctrl + Shift + P)
2. Enter "Preferences: Configure Runtime Arguments"
3. Add config: "disable-hardware-acceleration": true
4. Restart VS Code
@phamdinhhau
phamdinhhau / IndexController.php
Created March 22, 2022 03:51 — forked from tvazmaciel/IndexController.php
Doctrine's Named Native Queries
<?php
/**
* This is off ZF2's skeleton project. Just added stuff to the indexAction() method.
*/
namespace Application\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
@phamdinhhau
phamdinhhau / read-access.sql
Created February 28, 2022 01:09 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@phamdinhhau
phamdinhhau / MySqlBackup.bat
Created February 7, 2022 02:58 — forked from adityasatrio/MySqlBackup.bat
Mysql Backup Script For Windows
@echo off
set dbUser=root
set dbPassword=password
set backupDir="F:\AdityaSatrioNugroho\testbackupDb-bat\"
set mysqldump="C:\xampp\mysql\bin\mysqldump.exe"
set mysqlDataDir="C:\xampp\mysql\data"
set zip="C:\Program Files\7-Zip\7z.exe"
:: get date
@phamdinhhau
phamdinhhau / generator.php
Created December 1, 2021 02:13 — forked from tawfekov/generator.php
Doctrine2 Generate Entities form Existing Database
<?php
include '../vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
$classLoader->register();
// config
$config = new \Doctrine\ORM\Configuration();
@phamdinhhau
phamdinhhau / Mautic - 404 mtc.js generate.js on Nginx [FIX]
Last active May 26, 2021 03:15
Mautic - 404 mtc.js form/generate.js on Nginx [FIX]
Add to Nginx
# Mautic tracking fallback
location = /mtracking.gif {
expires off;
gzip off;
default_type "image/gif";
add_header 'Access-Control-Allow-Origin' *;
try_files $uri /index.php?$args;
}