Skip to content

Instantly share code, notes, and snippets.

View quan-vu's full-sized avatar
🎯
Focusing

Quan Vu quan-vu

🎯
Focusing
View GitHub Profile
@quan-vu
quan-vu / gist:054ec0ee922f79f9b9148e9e70d12e67
Created April 15, 2025 08:27
"The best way to predict your future is to create it." —Abraham Lincoln.
"The best way to predict your future is to create it." —Abraham Lincoln.
@quan-vu
quan-vu / build-dev.yml
Created July 15, 2024 03:24
Github action build Vite App
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Build Frontend Dev
on:
push:
branches: ["main", "cicd", "dev/*"]
pull_request:
branches: ["main"]
@quan-vu
quan-vu / Bash script create a file with date if not exist.md
Created November 23, 2022 10:56
Bash script create a file with date if not exist
          • cd /home && LOG_FILE=laravel-$(date --date="tomorrow" +"%Y-%m-%d").log && [ ! -f $LOG_FILE ] && echo "" > $LOG_FILE
@quan-vu
quan-vu / How to run laravel Schedule and Queue with Supervisor.md
Created November 23, 2022 10:29
How to run laravel Schedule and Queue with Supervisor

How to run laravel Schedule and Queue with Supervisor

Create supervisor config file for laravel

nano /etc/supervisor/conf.d/laravel-worker.conf

laravel-worker.conf

@quan-vu
quan-vu / clean_html_tags.js
Last active September 29, 2022 08:29
Javascript - Clean HTML tags
function stripTags (str) {
return str.replace(/(<([^>]+)>)/gi, "");
}
var str = '<p>This is a <strong style="color: red">string</strong> with some <u>HTML</u> in it.</p>';
var cleaned = stripTags(str);
console.log(cleaned);
@quan-vu
quan-vu / Dockerfile
Last active April 26, 2022 10:19
Docker php fpm install mongodb extension
FROM php:8.1-fpm
# Arguments defined in docker-compose.yml
ARG user=ubuntu
ARG uid=1000
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
@quan-vu
quan-vu / jetbrains-phpstorm.desktop
Created December 11, 2021 15:40
How to add PhpStorm to Ubuntu Unity Launcher
[Desktop Entry]
Version=1.0
Type=Application
Name=PhpStorm
Icon=/home/super/Programs/PhpStorm-2021.3/bin/phpstorm.png
Exec="/home/super/Programs/PhpStorm-2021.3/bin/phpstorm.sh" %f
Comment=Develop with pleasure!
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-phpstorm
@quan-vu
quan-vu / gist:40700446d51581c8b18310502cccec88
Created November 12, 2021 14:54
How to change default python version ubuntu
#
```shell
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
```
@quan-vu
quan-vu / nginx_enable_site.sh
Created November 8, 2021 16:41
Nginx link config file
sudo ln -s /etc/nginx/sites-available/your_domain /etc/nginx/sites-enabled/
@quan-vu
quan-vu / webserver_file_permissions.sh
Created October 31, 2021 03:44
How to Set all directories to 755 And all files to 644
cd /var/www/html
sudo chown -R www-data:www-data ./
sudo find . -type d -exec chmod 0755 {} \;
sudo find . -type f -exec chmod 0644 {} \;