Skip to content

Instantly share code, notes, and snippets.

View yamachu's full-sized avatar
🚼
babu-mi

Yusuke Yamada yamachu

🚼
babu-mi
View GitHub Profile
@yamachu
yamachu / Makefile
Created November 8, 2023 03:59
ISUCONでインスタンスに入った後にコピペしたりcurlで引っ張ってくるいつものMakefieのGitHub CLIに限定した部分を公開
# >() がbashじゃないと使えないので
SHELL=/bin/bash
# Issue番号は用途によって分けているけど、とりあえずDB周りは1
ISSUE=1
# https://github.com/cli/cli/blob/trunk/docs/install_linux.md#official-sources
gh:
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
emcmake cmake \
-DCMAKE_BUILD_TYPE=Release \
-DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
-DBUILD_SHARED_LIBS=OFF \
-DENABLE_CXX11=ON -DBUILD_TESTS=OFF \
-DBUILD_PERF_TESTS=OFF \
-DBUILD_DOCS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_JAVA=OFF \
-DBUILD_opencv_java_bindings_generator=OFF \

setup required tools

brew install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly ffmpeg

convert vtt to srt (if using vtt)

in: sub.vtt
out: sub.srt

@yamachu
yamachu / Virtual FileSystem on BlazorWebassembly.txt
Created October 29, 2021 11:12
BlazorWebassembly(.NET6 rc2)のFileSystemを眺めたやつ
/
/tmp
/home
/home/web_user
/dev
/dev/null
/dev/tty
/dev/tty1
/dev/random
/dev/urandom
@yamachu
yamachu / index.ts
Last active September 17, 2021 18:23
VOICEVOX CoreをNodeで動かしたかったんだ…
import { Library } from "ffi-napi";
import ArrayType from "ref-array-napi";
import { types, alloc } from "ref-napi";
// typedef
const longArray = ArrayType(types.long);
const floatArray = ArrayType(types.float);
var kernel32 = Library("kernel32", {
'SetDllDirectoryA': ["bool", ["string"]]
@yamachu
yamachu / libopenjtalk.ts
Created September 12, 2021 08:08
https://github.com/yamachu/LibOpenJTalk をNode.jsから呼び出すやつの下書き
import { Library } from 'ffi-napi';
import ArrayType from 'ref-array-napi';
import {
alloc,
allocCString,
readCString,
refType,
sizeof,
types,
} from 'ref-napi';
@yamachu
yamachu / check_api_with_gh_command.sh
Last active May 3, 2021 19:29
VSCodeのcommitのhistoryからリリースされたっぽそうなやつを引っ張るやつ
seq 1 10| xargs -I{} gh api -X GET repos/microsoft/vscode/commits -f q='sha:master' -f per_page=100 -f page={} --jq '.[].sha'|xargs -I{} gh api -X GET repos/microsoft/vscode/commits/{}/check-runs -f app_id=9426 --jq '.check_runs[] | { sha: .head_sha, name: .name}'
<<EOF
{"name":"VS Code (Release Release Build)","sha":"a348d103d1256a06a2c9b3f9b406298a9fef6898"}
{"name":"VS Code (Release Release Build)","sha":"0123d26aaa393bccf99f31f1eac07df6c9e218ce"}
{"name":"VS Code (Release Release Build)","sha":"19cda32aafccb88db45622e7ae9be90cb71c9744"}
{"name":"VS Code (Release Release Build)","sha":"724172d1349f1bdf0289baa59204cb54128d78ae"}
{"name":"VS Code (Release Release Build)","sha":"5080d21c0b538b996c83fb7b14a746f656eaef15"}
{"name":"VS Code (Release Release Build)","sha":"633562da380f9161ea2fd783e561eed508cfbbea"}
{"name":"VS Code (Release Release Build)","sha":"0310f02dc5d834bb3a7cc421ea5374aec8d011f1"}
@yamachu
yamachu / slack-emoji-getter.ps
Created April 20, 2021 02:56
Slackのcustom emojiを全部ぶっこ抜いてくるやつ(Windows環境でもすぐ出来るようにPowerShellで書いたやつ、もちろんmacでも動く)
// ref: https://hush-in.hatenablog.com/entry/2019/03/24/112859
// ここにあるように https://(workspace).slack.com/customize/emoji からレスポンスぶっこ抜いてきて emojis.json みたいな名前でjsonを保存する
// 以下のスクリプトはすべて同一ディレクトリで行われるのであらかじめ汚れていいディレクトリで作業すること………
$jsonContent = (Get-Content -Path "emojis.json" -Encoding UTF8 -Raw | ConvertFrom-Json -AsHashtable).emoji
foreach ($key in $jsonContent.keys) {
// aliasとかがあるので、httpsに限定しておく
if (!$jsonContent[$key].StartsWith("https")) { continue }
Invoke-WebRequest $jsonContent[$key] -OutFile $key
}
@yamachu
yamachu / 書いた時の状況.md
Created February 12, 2021 13:42
ブルアカメモ

Lv26 6-1クリア済み 戦術対抗戦6692位 拠点防衛Cが☆3、Dは未挑戦

@yamachu
yamachu / function-target_commonjs.json
Created July 28, 2020 12:25
JavaScript + Webpack なファイルを Azure Functions で起動する時の function.json とwebpack.config.js の libraryTarget の対応
{
"entryPoint": "fooFunction"
}