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 / IoTLabs_Cloud_MQTT_ESP32_Integration_Arduino_IDE_Advanced.ino
Created January 11, 2026 04:02
Hướng dẫn tích hợp ESP32 với IoTLabs Cloud MQTT trên Arduino IDE (nâng cao)
/*
IoTLabs ESP32 WiFi + MQTT (TLS) Core
--------------------------------------------------
Yêu cầu:
- Board: ESP32 (Arduino IDE)
- Libraries: WiFi, WiFiClientSecure, PubSubClient
- Device Info: Đã tạo device trên IoTLabs Dashboard và lấy thông tin kết nối MQTT thành công
Ghi chú:
- Code đã được đóng gói sẵn thành các hàm WiFi/MQTT “lõi”, rõ ràng và độc lập
@quan-vu
quan-vu / IoTLabs_Cloud_MQTT_ESP32_Integration_Arduino_IDE_Basic.ino
Created January 11, 2026 03:24
Hướng dẫn tích hợp ESP32 với IoTLabs Cloud MQTT trên Arduino IDE (cơ bản)
/*
ESP32 MQTT Integration (Arduino IDE)
- Broker: mqtt.iotlabs.vn:8883
- Ping topic: send latest status without sensor data
- Telemetry topic: send sensor data
- TLS enabled (port 8883) for secure.
Auth:
- username: d_696309d71a367b6c5fb9663e
- password: PASSWORD
@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
```