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 / 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);
@minhphong306
minhphong306 / install_postaman.sh
Created March 19, 2024 07:13 — forked from lucasalvessouza/install_postaman.sh
Install postman fedora
#!/bin/bash
wget https://dl.pstmn.io/download/latest/linux64 -O postman-linux-x64.tar.gz
sudo tar xvzf postman-linux-x64.tar.gz -C /opt
sudo ln -s /opt/Postman/Postman /usr/bin/postman
cat << EOF > ~/.local/share/applications/postman2.desktop
[Desktop Entry]
Name=Postman
GenericName=API Client
@minhphong306
minhphong306 / rfc-7396-test-cases.txt
Created February 12, 2024 07:50
RFC 7396 test cases
ORIGINAL PATCH RESULT
------------------------------------------
{"a":"b"} {"a":"c"} {"a":"c"}
{"a":"b"} {"b":"c"} {"a":"b",
"b":"c"}
{"a":"b"} {"a":null} {}
{"a":"b", {"a":null} {"b":"c"}
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
type AutoGenerated struct {

Hướng dẫn sử dụng

Copy lark data

javascript:(function()%7Bfunction getNodeByXPath(xpath%2C contextNode %3D document) %7B%0A  return document.evaluate(xpath%2C contextNode%2C null%2C XPathResult.FIRST_ORDERED_NODE_TYPE%2C null).singleNodeValue%3B%0A%7D%0A%0Aconst orderId %3D getNodeByXPath("%2F%2Fspan%5B%40title%3D'MÃ ĐƠN HÀNG'%5D%2Ffollowing-sibling%3A%3Adiv").innerText%3B%0Aconst agentName %3D getNodeByXPath("%2F%2Fspan%5B%40title%3D'ĐẠI LÝ'%5D%2Ffollowing-sibling%3A%3Adiv").innerText%3B%0Aconst address %3D getNodeByXPath("%2F%2Fspan%5B%40title%3D'ĐỊA CHỈ'%5D%2Ffollowing-sibling%3A%3Adiv").innerText%3B%0Aconst customerName %3D getNodeByXPath("%2F%2Fspan%5B%40title%3D'TÊN KHÁCH HÀNG'%5D%2Ffollowing-sibling%3A%3Adiv").innerText%3B%0A%0Aconst data %3D %7B%0A  orderId%3A orderId%2C%0A  agentName%3A agentName%2C%0A  address%3A address%2C%0A  customerName%3A customerName%2C%0A%7D%3B%0A%0AcopyToClip
@minhphong306
minhphong306 / example.go
Created November 10, 2023 23:58
example.go
for i := 0;i < 1000; i++ {
slice := make([]int, i)
slice = append(slice, 1)
fmt.Println("i: ", i ," len:", len(slice), " cap:", cap(slice))
}
---
i: 0 len: 1 cap: 1
i: 1 len: 2 cap: 2
@minhphong306
minhphong306 / go-google-sheet.go
Created September 8, 2023 08:04
go-google-sheet.go
package main
import (
"context"
"encoding/json"
"fmt"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"google.golang.org/api/option"
"google.golang.org/api/sheets/v4"
@minhphong306
minhphong306 / example_3.ts
Created August 24, 2023 00:52
example_3.ts
if (!file_exist){
console.log('Run into create file');
create_file();
}
console.log('Read all file content');
content = read_all_files_content();
return content;
@minhphong306
minhphong306 / example_2.ts
Last active August 24, 2023 00:49
example_2.ts
if (!file_exist)
console.log('Run into create file');
create_file();
console.log('Read all file content');
content = read_all_files_content();
return content;