Skip to content

Instantly share code, notes, and snippets.

View gokusenz's full-sized avatar
🎯
Focusing

Nattawut Ruangvivattanaroj gokusenz

🎯
Focusing
View GitHub Profile
@gokusenz
gokusenz / th-address.json
Created November 20, 2023 04:30 — forked from mennwebs/th-address.json
Thai Address from Postal Code - JSON
This file has been truncated, but you can view the full file.
[
{
"zipCode": "10100",
"subDistrictList": [
{
"subDistrictId": "100801",
"districtId": "1008",
"provinceId": "10",
"subDistrictName": "ป้อมปราบ"
const { ethers } = require('ethers');
const provider = new ethers.providers.JsonRpcProvider('https://bsc-dataseed.binance.org/');
const BEP20 = {
BUSD: '0xe9e7cea3dedca5984780bafc599bd69add087d56',
DOP: '0x844fa82f1e54824655470970f7004dd90546bb28',
};
const Contract = {
router: new ethers.Contract(
# -*- coding: utf-8 -*-
from linepy import *
import sys
try:
token = "F3iWbBNmXS7aPitUypbb.75Zncsa61HrO8lDHlrY9oW.l5XSOhru+suz1h1cN+pYIGvf+NMwOzHC54qqudKYW94="
line = LINE(token)
except Exception as e:
/**
* A Simple Wrapper for LINE MEssanger Notify
*/
const request = require("request-promise");
const fs = require("fs");
const config = {
BASE_API_URL : "https://notify-api.line.me",
NOTIFY_API_QUERY_PATH : "/api/notify",
STATUS_API_URL_QUERY_PATH : "/api/status",
const restoreLocalStorage = async () => {
let json = JSON.parse(fs.readFileSync(`${__dirname}/local.json`));
await page.evaluate(json => {
localStorage.clear();
for (let key in json)
localStorage.setItem(key, json[key]);
}, json);
}
const saveLocalStorage = async () => {
exc
link = "https://timeline.line.me/post/_dQ4XOI8jK1yKjiPF0iyxFvLeFEITrpP0qU28bKk/1159635356703039478"
r = requests.get("https://api.fckveza.com/timeline?link={}&apikey=apikeylu".format(link))
data = r.text
data = json.loads(data)
jun = "Timeline Info"
jun += "\nType Media : Video"
jun += "\nCreator : " + str(data["result"]["title"])
jun += "\nDeskripsi : " + str(data["result"]["desk"])
jun += "\nDownload video in timeline Pelase wait... "
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
def lineNotify(message):
payload = {'message':message}
return _lineNotify(payload)
def notifyFile(filename):
file = {'imageFile':open(filename,'rb')}
payload = {'message': 'test'}
@gokusenz
gokusenz / timestamp.js
Created June 5, 2020 18:29
JS Timestamp
var now = new Date();
var nowUTC = now.getTime() + now.getTimezoneOffset() * 60 * 1000;
var utc_timestamp = Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(),
now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds());
document.write("Correct UTC timestamp " + now.getTime());
document.write("<br/>");
document.write("Incorect UTC timestamp " + utc_timestamp);
document.write("<br/>");
document.write("Incorect UTC timestamp " + nowUTC);
@gokusenz
gokusenz / post.js
Created June 5, 2020 18:28
puppeteer post
// Used for serializing POST parameters from an object
const querystring = require('querystring');
// ...
const browser = await puppeteer.launch();
const page = await browser.newPage();
let postData = {a: 1, b: 2};
@gokusenz
gokusenz / b.txt
Created March 6, 2020 08:30
Open browser with external browser
?openExternalBrowser=1