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
#!/bin/bash
cd "$(dirname "$0")" || exit
progress() {
local message=$1
local space
space=$(printf '%*s' $(( $(tput cols) - ${#message} )) ' ')
echo -ne "$message$space\r"
}
@book000
book000 / rdp-connect.bat
Created January 27, 2023 01:11
imniko/SetDPI でWindowsディスプレイの拡大率設定を 100% にしたうえで RDP する bat
@echo off
echo [INFO] SetDPI 100
SetDPI.exe 1 100
echo [INFO] Connect RDP
start C:\Windows\System32\mstsc.exe "C:\Users\Tomachi\ICHIGO-MULTI-REMOTE.rdp"
timeout /T 10 /NOBREAK
:check
#!/bin/bash
if [[ $# -ne 2 ]]; then
echo "Error: 2つの引数が必要です。1つ目にscreenの名前、2つ目にURLを指定してください。"
exit 1
fi
SCREEN_NAME=$1
shift
# shellcheck disable=SC2068
screen -dmS "${SCREEN_NAME}" /usr/bin/yt-dlp -o "/mnt/hdd/yt-dlp-live/%(title)s.%(ext)s" --hls-use-mpegts --wait-for-video 10 $@
import json
def json2csv(username: str):
with open("data/" + username + ".json") as f:
items = json.load(f)
rows = []
for item in items:
for result in item["results"]:
@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 / 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 / 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 / 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 / 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 / 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