Skip to content

Instantly share code, notes, and snippets.

View fanfan1609's full-sized avatar
🎯
Focusing

VO QUOC DAT fanfan1609

🎯
Focusing
View GitHub Profile
@fanfan1609
fanfan1609 / export-chat.js
Last active February 16, 2023 08:41 — forked from schnabear/export-chat.js
ChatWork Export Chat
let room_id = 26059xxx;
let myid = 664xxx4
let token = "9ea08b3b75d344100773333086ca22e6c76f458a63ed71d023xxx";
let first_chat_id = '167282491827159xxx'
let chat_ids = [];
let other_ids = [];
fetchChat(myid, room_id, first_chat_id, _t);
@fanfan1609
fanfan1609 / __upload_file.md
Created November 25, 2022 08:08 — forked from maxivak/__upload_file.md
PHP upload file with curl (multipart/form-data)

We want to upload file to a server with POST HTTP request. We will use curl functions.


// data fields for POST request
$fields = array("f1"=>"value1", "another_field2"=>"anothervalue");

// files to upload
$filenames = array("/tmp/1.jpg", "/tmp/2.png");
@fanfan1609
fanfan1609 / regexCheatsheet.js
Created February 8, 2019 02:33 — forked from sarthology/regexCheatsheet.js
A regex cheatsheet πŸ‘©πŸ»β€πŸ’» (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"