Skip to content

Instantly share code, notes, and snippets.

View minhphong306's full-sized avatar
😄
Don't watch the clock. Do what it does! Keep going!

Phong Do minhphong306

😄
Don't watch the clock. Do what it does! Keep going!
View GitHub Profile
@minhphong306
minhphong306 / pw.py
Created March 18, 2025 23:56
Python Playwright multi thread cookie
import threading
import time
from playwright.sync_api import sync_playwright
import requests
# Biến toàn cục để lưu cookie và lock để đảm bảo thread-safe
cookie_storage = None
cookie_lock = threading.Lock()
# Luồng 1: Login và lấy cookie
const listA = [1, 2, 3, 4];
const listB = [4, 5, 6];
// Build map
const mapA = {
'1': true,
'2': true,
'3': true
};
listA.forEach(item => mapA[item] = true);

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@minhphong306
minhphong306 / node_output.txt
Created August 28, 2024 07:17
node_output.txt
/Users/alex/workspace/001-teaching-courses/004-udemy/001-ts
/Users/alex/.nvm/versions/node/v20.0.0/bin/node
/Library/Preferences/Logging/.plist-cache.GZngdQrO
/Users/alex/workspace/001-teaching-courses/004-udemy/001-ts/node_modules/fsevents/fsevents.node
->0xf5018b9f9838bf57
->0xf432b7ce42f96861
->0xa9b4f01ee205c115
->0x73d3239d63d7d1ed
count=0, state=0
->0x12fb13533d75bb25
@minhphong306
minhphong306 / example_lesson-7.html
Created August 23, 2024 18:55
example_lesson-7.html
<div class="container" id="ancestor">
<h1 id="self">User Registration</h1>
<form id="registrationForm">
<div class="form-group" id="parent">
<label for="username" id="preceding">Username:</label>
<input type="text" id="username" name="username" required="">
</div>
<div class="form-group" id="child">
<label for="email">Email:</label>
<input type="email" id="email" name="email" required="">
@minhphong306
minhphong306 / example-html.html
Created August 23, 2024 01:36
example-html.html
<form id="registrationForm">
<div class="form-group" id="parent">
<label for="username" id="preceding">Username:</label>
<input type="text" id="username" name="username" required="">
</div>
<div class="form-group" id="child">
<label for="email">Email:</label>
<input type="email" id="email" name="email" required="">
</div>
<div class="form-group">
@minhphong306
minhphong306 / Dockerfile
Created July 4, 2024 14:34
selenium dockerfile
# Sử dụng hình ảnh Maven chính thức làm hình ảnh cha
FROM maven:3.8.1-openjdk-11-slim
# Đặt thư mục làm việc trong container
WORKDIR /app
# Sao chép nội dung thư mục hiện tại vào container tại /app
COPY . /app
# Cài đặt cron
@minhphong306
minhphong306 / loc.ts
Last active May 19, 2024 15:42
Loc nguyen to
function locNguyenTo(arr) {
const arrNguyenTo = [];
for (let i = 0;i < arr.length; i++) {
if (arr[i] === 0 || arr[i] === 1) {
continue;
}
let count = 0;
for (let j=2; j < arr[i]; j++) {
@minhphong306
minhphong306 / code.js
Created March 25, 2024 17:34
code mess
function toggle(type) {
const chatList = document.querySelectorAll("a[href*='/t/']");
// Add filter blur(2px) for each item
chatList.forEach((item) => {
const parent = getUpToEightParents(item);
let filterValue = '';
switch (type) {
case 'off':
@minhphong306
minhphong306 / send_mail.php
Created March 25, 2024 05:05
send_mail.php
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
// Setting response header json
header('Content-Type: application/json');
// Check if not post method -> throw error
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
http_response_code(405);