Skip to content

Instantly share code, notes, and snippets.

View vulieumang's full-sized avatar
📜

Vu vulieumang

📜
View GitHub Profile
sudo pm2 install typescript
sudo pm2 install @types/node
cd node_modules/.bin
pm2 install typescript
cd ..
cd ..
pm2 start src/server.ts --watch
https://github.com/Unitech/pm2/issues/3312
@vulieumang
vulieumang / gist:ba1e7fcc21c4db3406bddb99382eb8a5
Created April 29, 2023 14:17
// Add custom tab in ultimate member account page.
// Add custom tab in ultimate member account page.
// global $form_id;
// $form_id = 26;
/**
* Add custom tabs.
*
@vulieumang
vulieumang / export_db.command
Created April 5, 2022 14:59
Using wordpress cli to auto export db to db.sql file
// using for command file
cd `dirname $0`
wp db export db.sql --allow-root
// using command on terminal
wp db export db.sql --allow-root
@vulieumang
vulieumang / laravel-auto-refresh.md
Created October 13, 2021 15:25 — forked from vades/laravel-auto-refresh.md
Auto refresh after changes with Laravel Mix

Laravel auto refresh after changes

To achieve this you can use Laravel Mix

  1. Ensure that Node.js and NPM are installed: run node -v and npm -v.
  2. Install Laravel Mix npm install.
  3. Open webpack.mix.js and add mix.browserSync('127.0.0.1:8000');.
  4. Run php artisan serve.
  5. And the npm run watch.

Sources

@vulieumang
vulieumang / gist:fb1c60d44790a01550f3419365f2b1f1
Created August 20, 2021 07:04
Translate wpDiscuz from label
// using chrome and press translate and using this script in console
// sử dụng chrome để dịch trang, sau đó dùng script ở console, script sẽ copy label to input
let products = [];
let product_wrapper = document.querySelectorAll('.wp-list-table tr');
product_wrapper.forEach((product) => {
let dataJson = {};
try {
dataJson.title = product.querySelector('label font font').innerText;
product.querySelector('input').value = dataJson.title;
product.querySelector('textarea').value = dataJson.title;