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 OpenAI from "openai"; | |
import { tavily } from "@tavily/core"; | |
import { readFileSync, writeFileSync, statSync } from "fs"; | |
const tavilyApiKey = process.env.TAVILY_API_KEY; | |
const openaiApiKey = process.env.OPENAI_API_KEY; | |
const model = "gpt-4o"; // "gpt-4o-mini" | |
const names = readFileSync("list.txt", { encoding: "utf8" }).split(/\r?\n/); | |
const title = "HCI researcher"; | |
const wait = 1000; |
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
// Test if destination IPs are serving HTTP service or not. | |
// Java: https://gist.github.com/arcatdmz/5012993 | |
const http = require("http"); | |
const urls = []; | |
for (i = 1; i < 256; i++) { | |
urls.push(`http://192.168.1.${i}`); | |
} |
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 traverseCodeBlock = ({ fileNamePattern, perLine, preBlock, postBlock }) => [...document.querySelectorAll(".code-block")].filter(el => el.children[1].firstChild.className === "code-start" && fileNamePattern.test(el.textContent)).map(el => { | |
let line = el.parentElement, classList; | |
preBlock && preBlock(line); | |
line = line.nextSibling; | |
while (line && [...line.children[1].classList].indexOf("code-block") >= 0) { | |
perLine && perLine(line); line = line.nextSibling; | |
} | |
postBlock && postBlock(line); | |
}); |
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><head><script src="//api.songle.jp/v2/api.js"></script><script> | |
function onSongleAPIReady(Songle) { | |
// Show the music player | |
var player = new Songle.Player({ | |
mediaElement: document.querySelector('div.media'), | |
accessToken: '00000095-cVwZKVo', // Access token | |
secretToken: 'zVJkeswdA7tSFTfSWB75scZ2a5jL99g4' // Secret token | |
}); |
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><head><script src="//api.songle.jp/v2/api.js"></script><script> | |
function onSongleAPIReady(Songle) { | |
// Show the music player | |
var player = new Songle.Player({ | |
mediaElement: document.querySelector('div.media'), | |
accessToken: '00000095-cVwZKVo', // Access token | |
secretToken: 'zVJkeswdA7tSFTfSWB75scZ2a5jL99g4' // Secret token | |
}); |
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><head><script src="//api.songle.jp/v2/api.js"></script><script> | |
function onSongleAPIReady(Songle) { | |
// Show the music player | |
var player = new Songle.Player({ | |
mediaElement: document.querySelector('div.media'), | |
accessToken: '00000095-cVwZKVo', // Access token | |
secretToken: 'zVJkeswdA7tSFTfSWB75scZ2a5jL99g4' // Secret token | |
}); |
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
PS C:\Users\arc\Documents\Source\deno_std> deno --allow-read --allow-write multipart/multipart_test.ts | |
running 12 tests | |
test multipartScanUntilBoundary1 ... ok | |
test multipartScanUntilBoundary2 ... ok | |
test multipartScanUntilBoundary4 ... ok | |
test multipartScanUntilBoundary3 ... ok | |
test multipartMatchAfterPrefix1 ... ok | |
test multipartMatchAfterPrefix2 ... ok | |
test multipartMatchAfterPrefix3 ... ok | |
test multipartMultipartWriter ... ok |
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
PS C:\Users\arc\Documents\Source\deno_std> deno bytes/bytes_test.ts | |
running 4 tests | |
test bytesBytesFindIndex ... FAILED | |
Error: | |
[Diff] Left / Right | |
- 5 | |
+ 2 |
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><head><script src="//api-dev.songle.jp/v2/api.js"></script><script> | |
function onSongleWidgetAPIReady(SongleWidget) { | |
// 音楽プレーヤーを表示する | |
var player = new SongleWidget.Player({ | |
accessToken: 'foo' // アクセストークン | |
, secretToken: 'bar' // シークレットトークン | |
}); | |
player.useMedia( | |
'https://youtube.com/watch?v=xOKplMgHxxA', |
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><head><script src="//api.songle.jp/v2/api.js"></script><script> | |
function onSongleWidgetAPIReady(SongleWidget) { | |
// 音楽プレーヤーを初期化する | |
var player = new SongleWidget.Player({ | |
accessToken: 'foo' // アクセストークン | |
}); | |
player.addPlugin(new SongleWidget.Plugin.SongleSync()); | |
// 再生時刻を定期的に更新する |
NewerOlder