This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<h1>cors test</h1> | |
<script> | |
const tester = async () => { | |
const out = await fetch("http://localhost:7777/"); | |
const text = await out.text() | |
console.log(text); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const serialport = require('serialport'); | |
const SerialPort = serialport.SerialPort; | |
const PORT = "/dev/ttyUSB0"; | |
serialPort = new SerialPort({ | |
path: PORT, | |
baudRate: 115200, | |
}); | |
serialPort.on("open", () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const reader = (blob) => { | |
return new Promise((resolve, reject) => { | |
const reader = new FileReader() | |
reader.onloadend = () => resolve(reader.result) | |
reader.onerror = reject | |
reader.readAsDataURL(blob) | |
}) | |
} | |
const toDataURL = async (url) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<input type="file" class="choose" value=""><br/> | |
<img id="original-image" width="300px"><br/><br> | |
<div id="images"> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sleep, 1000 | |
WinActivate, ahk_exe chrome.exe | |
Loop { | |
Sleep, 30000 | |
WinActivate, ahk_exe chrome.exe | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import puppeteer from 'puppeteer'; | |
let page, context; | |
const browser = await puppeteer.launch({ | |
headless: false | |
}); | |
const sleep = (time) => { | |
return new Promise((resolve) => { | |
setTimeout(resolve, time); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import browser from "webextension-polyfill"; | |
const entries = async (key) => { | |
const values = await browser.storage.local.get(key); | |
if (Array.isArray(values[key])) { | |
return values[key]; | |
} else { | |
return []; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const API_KEY = `UsEYourOwnApIK3Yp|ea5e`; // https://console.developers.google.com/apis/credentials?project=phot-256520 | |
const MAX_PAGES = 10 // * 50 | |
const VIDEO_ID = new URLSearchParams((new URL(window.location.href)).search).get('v'); | |
const API_URL = `https://www.googleapis.com/youtube/v3/commentThreads?key=${API_KEY}&textFormat=plainText&part=snippet&videoId=${VIDEO_ID}&maxResults=50`; | |
const API_NEXT_URL = `https://www.googleapis.com/youtube/v3/commentThreads?key=${API_KEY}&textFormat=plainText&part=snippet&maxResults=50&pageToken=`; | |
const getComments = async (nextToken) => { | |
const resp = await fetch(nextToken ? `${API_NEXT_URL}${nextToken}` : API_URL) | |
const json = await resp.json(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {jsPDF} from "jspdf"; | |
import {encode, decode} from 'node-base64-image'; | |
const B64 = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAklEQVR4AewaftIAAAJMSURBVO3BMWocVhiF0e9dpkjh0gtI50UYLcYgrcqN9zK4ygoGFdEG0qmY7qUNGFTkMn788J2z/oKN9D8FqRCkQpAKQSoEqRCkQpAKQSoEqRCkQpAKQSoEqRCkQpAKQSoEqRCkQpAKQSoEqRCkQpAKFx7sjy9f+PT0hH6/9+uV++3GI114sE9PT/z5/Tv6/d5eXrjfbjxSkApBKgSpEKRCkApBKgSpEKRCkApBKgSpEKRCkApBKgSpEKRCkApBKgSpEKRCkApBKlzQh/7+9o3/WsDmYwvYfGwBn75+5fPzM5Nd0If++fGDR9nA5+dnJgs6ZjFf0DGb+YKOWcwXdMxmviAVgo5ZzBd0zGa+IBWCVAg6ZjFf0DGb+YKOWcwXdMxmviAVgo5ZzBd0zGa+IBWCVAg6ZjFf0DGb+YKOWcwXdMxmviAVgo5ZzBd0zGa+IBWCVAg6ZjFf0DGb+YKOWcwXdMxmviAVgo5ZzBd0zGa+IBWCVAg6ZjFf0DGb+YKOWcwXdMxmviAVgo5ZzBd0zGa+IBWCVAg6ZjFf0DGb+YKOWcwXdMxmviAVgo5ZzBd0zGa+IBWCVAg6ZjFf0DGb+YKOWcwXdMxmviAVgo5ZzBd0zGa+IBWCVAg6ZjFf0DGb+YKOWcwXdMxmviAVgo5ZzHfhwd6vV95eXtCv3n/+5O3lhUd5v155tAsPdr/duN9u6Ff311fur69MFqRCkApBKgSpEKRCkApBKgSpEKRCkApBKgSpEKRCkApBKgSpEKRCkApBKgSpEKRCkApBKvwLKw1EpVhhTq4AAAAASUVORK5CYII=` | |
const doc = new jsPDF("p", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Log Oe Line command | |
alias.lol log --one-line | |
# log history | |
git config --global alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short" | |
# get all alias | |
git config --global --get-regexp alias |
NewerOlder