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 / Zoom100CursorA1NormalView.vb
Last active March 22, 2024 09:16
すべてのシートを「倍率100%」「アクティブセルA1」「標準ビュー」にする
Sub Zoom100CursorA1NormalView()
' ScreenUpdatingを切るとA1セルがアクティブにはなるが、表示範囲が変わらない
Dim sheet As Object
For Each sheet In ActiveWorkbook.Sheets
sheet.Activate
ActiveSheet.Range("A1").Select
ActiveWindow.Zoom = 100
ActiveWindow.View = xlNormalView
Next sheet
Sheets(1).Select
#!/bin/bash
function devopen() {
local workspace_folder="$(readlink -f "$1")"
if [ -d "$workspace_folder" ]; then
local wsl_path="$(wslpath -w "$workspace_folder")"
local path_id=$(printf "%s" "$wsl_path" | xxd -ps -c 256)
code --folder-uri "vscode-remote://dev-container%2B${path_id}/workspaces/$(basename "$workspace_folder")"
else
# GitHubリポジトリをクローンするPowerShellスクリプト
# 関数: GitHubリポジトリのURLが有効かどうかを確認する
function Test-GitHubRepositoryURL {
param (
[string]$URL
)
if ($URL -notmatch '^https:\/\/github\.com\/.+\/.+') {
Write-Host "エラー: 正しいGitHubリポジトリのURLを入力してください。" -ForegroundColor Red
# package.jsonが無ければエラーを表示して終了する
if (-not (Test-Path .\package.json)) {
Write-Host "Error: package.json not found." -ForegroundColor Red
exit 1
}
# package.jsonのeslintがv9以上だったら、v9では動作しないことを表示して終了する
$package_json = Get-Content -Path package.json -Raw | ConvertFrom-Json -AsHashtable
$eslint_version = $package_json.devDependencies.eslint
if ($eslint_version -ge "9.0.0") {
@book000
book000 / DxdiagParser.js
Last active December 5, 2025 05:44
dxdiag.txtをパースするJavaScriptクラス
class DxdiagParser {
constructor(dxdiag) {
this.dxdiag = dxdiag;
this.isDebug = false;
this.parsableSections = [
"System Information",
"DxDiag Notes",
"DirectX Debug Levels",
"Display Devices",
@book000
book000 / toggleAllRestrict.js
Created August 11, 2024 14:08
toggling all bookmarks to public or private
/*
This script is for toggling all bookmarks on pixiv to public or private.
Open your own pixiv user page, switch to the bookmarks tab, and then run this script in the browser console.
(e.g., https://www.pixiv.net/users/{userId}/bookmarks/artworks)
*/
/**
* Wait for an element to appear in the DOM and resolve with it.
*
@book000
book000 / no_concurrent_exec.sh
Last active November 10, 2024 22:59
Bashにおけるロック管理による同時実行の禁止制御
#!/bin/bash
cd "$(dirname "$0")" || exit 1
# ロックファイルのパス
LOCKFILE="$(realpath "$0").lock"
# ファイルディスクリプタ9でロックを取得 (エラーメッセージを無視)
exec 9>"$LOCKFILE" 2>/dev/null
if [ $? -ne 0 ]; then
echo "Failed to open lockfile $LOCKFILE. It seems to be already running."
@book000
book000 / ListSheetNames.vb
Last active October 28, 2024 06:42
シート「シート名一覧」にシート名一覧を記載する
Sub ListSheetNames()
Dim ws As Worksheet
Dim sheetNames() As String
Dim i As Integer
Dim listSheet As Worksheet
' 画面更新と自動計算を一時停止
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
@book000
book000 / get_instance_videos_from_vrcx.py
Last active November 18, 2024 20:27
VRCX のデータベースから、インスタンスごとの動画情報をまとめてJSONに書き出す
import json
import sqlite3
import pandas as pd
import os
appdata_path = os.getenv('APPDATA')
dbpath = os.path.join(appdata_path, 'VRCX', 'VRCX.sqlite3')
print("DB Path: " + dbpath)
conn = sqlite3.connect(dbpath)
@book000
book000 / vrcx-instance-videos.sql
Last active November 28, 2024 16:07
VRCX.sqlite3 からインスタンスごとの再生動画情報を抽出する
SELECT
gl.rowid AS join_id,
gl.created_at AS world_created_at,
gl.location AS instance_id,
gl.world_id AS world_id,
gl.world_name AS world_name,
gl.time AS instance_elapsed_time,
gl.group_name AS instance_group_name,
gvp.created_at AS video_created_at,
gvp.video_url AS video_url,