Skip to content

Instantly share code, notes, and snippets.

View book000's full-sized avatar
👀
record User(String nickName, String screenName, Location country){}

Tomachi book000

👀
record User(String nickName, String screenName, Location country){}
View GitHub Profile
@book000
book000 / mirakurun-vlc.php
Created January 1, 2022 11:17
Mirakurunを使いVLCでテレビを見れるようにプレイリストを作成するPHPスクリプト
<?php
$json = json_decode(file_get_contents("http://192.168.0.201:40772/api/channels?type=GR"), true);
print_r($json);
$list = [
"#EXTM3U",
"#EXTVLCOPT:network-caching=1000",
""
];
foreach ($json as $object) {
@book000
book000 / auto-download-gartic-phone-gif.js
Created January 5, 2022 13:31
Gartic Phoneダウンロード自動化?Chrome推奨
isFound = false;
setInterval(() => {
console.log("checking", isFound)
if(document.querySelector("i.download") !== null) {
console.log("found & click")
if(!isFound) document.querySelector("i.download").click();
isFound = true;
}else{
isFound = false
}
#!/bin/bash
send_message() {
token=""
channelId=""
curl \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bot $token" \
-d "{\"content\": \"$1\"}" \
"https://discord.com/api/channels/$channelId/messages"
@book000
book000 / reggae-one.user.js
Created February 27, 2022 10:38
Reggae One💢
// ==UserScript==
// @name Reggae One💢
// @namespace https://tomacheese.com
// @version 1.0.0
// @description The world is made up of ANGER.
// @author Tomachi
// @match http://*/*
// @match https://*/*
// @updateURL https://gist.github.com/book000/e84ca5eb8715686d3d077311d3363411/raw/reggae-one.user.js
// @icon https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/285/anger-symbol_1f4a2.png
@book000
book000 / create-kana-emojis.php
Last active February 27, 2022 11:26
あ~んをフォントを指定して絵文字画像を作成するPHPスクリプト (GD使用)
<?php
/*
あ~んをフォントを指定して絵文字画像を作成するPHPスクリプト (GD使用)
- Created by Tomachi https://gist.github.com/book000/16ff21e6916ae94033dfeba27a20eb90
PREFIX_images ディレクトリに50枚の画像が生成されます。
PREFIX_emojis.txt には絵文字の一覧を示すメッセージ用テキストが生成され出力されます。
stdout には50音表に並んだ絵文字表が出力されます。
*/
@book000
book000 / minecraft-plugin-manually-updater.php
Created March 11, 2022 19:26
手動でMinecraft(Spigot)プラグインをアップデートするのを助けるスクリプト
<?php
/*
plugins-oldディレクトリに古いプラグインjarをすべて入れて、実行するとplugin.ymlの内容をもとに関連サイトを開いたり、ダウンロード処理を行ったりする
*/
function getFiles($dir)
{
$files = scandir($dir);
$files = array_diff($files, array('.', '..'));
$files = array_filter($files, function ($file) use ($dir) {
@book000
book000 / depcheck-and-remove.sh
Created April 12, 2022 16:35
depcheckして、そのままRemoveする
npx depcheck --json | jq -r .dependencies[] | xargs yarn remove
npx depcheck --json | jq -r .devDependencies[] | xargs yarn remove
@book000
book000 / git-rm-merged-branch.bat
Created April 13, 2022 08:19
マージ済みローカルブランチを削除する (WSL利用)
@echo off
git fetch --all
git checkout master
git fetch --prune
bash -c "git branch --merged | egrep -v '\*|develop|main|master'| xargs git branch -d"
@book000
book000 / add-reviewer.yml
Last active April 16, 2022 10:01
プルリクがオープンされたときにbook000をレビュアーに追加する
# 自動的にbook000をレビュアーにする
# book000, renovate, github-actionsからのPull-Requestにはレビュアーを追加しない
# 次の設定が必要:
# Settings -> Actions -> General -> Fork pull request workflows from outside collaborators -> Require approval for first-time contributors who are new to GitHub
name: Add reviewer
on:
pull_request_target:
@book000
book000 / README.md
Last active January 26, 2025 11:50
manaba2moodle

manaba2moodle

manaba でエクスポートした mht ファイルを moodle の問題バンクにインポートできるように Moodle XML 形式に変換する簡易スクリプトです。

  • main.ts (yarn build): すべての問題を穴埋め問題(Cloze)で作成します。
    作成した問題は xml/cloze/ ディレクトリの下に国語(J)、数学(M)、英語(E)と教科ごとに作成されます。
  • main-new.ts (yarn build-new): 選択式問題をmultichoiceで対応、空所入力問題をshortanswerで作成します。
    作成した問題は xml/not-cloze/ ディレクトリの下に大問ごとにファイルを分けて作成されます。

ライセンスは一応 MIT License です。