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
# 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") {
# GitHubリポジトリをクローンするPowerShellスクリプト
# 関数: GitHubリポジトリのURLが有効かどうかを確認する
function Test-GitHubRepositoryURL {
param (
[string]$URL
)
if ($URL -notmatch '^https:\/\/github\.com\/.+\/.+') {
Write-Host "エラー: 正しいGitHubリポジトリのURLを入力してください。" -ForegroundColor Red
#!/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
@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
@book000
book000 / Zoom100CursorA1NormalView.vb
Created January 5, 2024 05:36
すべてのシートを「倍率100%」「アクティブセルA1」「標準ビュー」にする
Sub Zoom100CursorA1NormalView()
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
End Sub
@book000
book000 / compose.yaml
Last active July 17, 2023 11:56
Dockerfile / Docker Compose file for logspout & logstash, config files
services:
logspout:
image: gliderlabs/logspout:v3.2.14
command: syslog://logstash:5000
environment:
- RETRY_COUNT=100
depends_on:
logstash:
condition: service_healthy
volumes:
@book000
book000 / bitwarden-full-width.user.css
Last active May 19, 2023 07:23
Bitwardenでフルサイズ表示する(プレミアムへの広告も消す)
/* ==UserStyle==
@name Full size display on Bitwarden
@namespace tomacheese.com
@version 1.0.1
@updateURL https://gist.github.com/book000/894207763314aefc0ac0e7f6ed3dc857/raw/bitwarden-full-width.user.css
@description Bitwardenでフルサイズ表示する(プレミアムへの広告も消す)
@author Tomachi (book000)
==/UserStyle== */
@-moz-document domain("vault.bitwarden.com") {
.container {
@book000
book000 / compose.yaml
Last active May 10, 2023 02:17
Docker Compose file for elasticsearch & kibana
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.13.1
environment:
- discovery.type=single-node
- LOGSPOUT=ignore
- bootstrap.memory_lock=true
- xpack.security.enabled=false
- xpack.monitoring.enabled=false
- xpack.watcher.enabled=false
@book000
book000 / pixiv-full-image.user.js
Last active May 14, 2023 11:53
Replace square images displayed on pixiv.net with full-size images
// ==UserScript==
// @name pixiv replace full image
// @namespace https://tomacheese.com
// @version 1.0.1
// @description Replace square images displayed on pixiv.net with full-size images
// @author Tomachi
// @match https://www.pixiv.net/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=pixiv.net
// @updateURL https://gist.github.com/book000/0326c9b0635d99b7c4ab891ccb5e67be/raw/pixiv-full-image.user.js
// @downloadURL https://gist.github.com/book000/0326c9b0635d99b7c4ab891ccb5e67be/raw/pixiv-full-image.user.js
@book000
book000 / mitmproxy-all-write-file.py
Last active May 3, 2023 12:10
mitmproxyですべての通信をファイルに書き出すアドオン
import json
from pprint import pprint
from mitmproxy import addonmanager, http
from mitmproxy import tls
from urllib.parse import urlparse
from mitmproxy import ctx
import os
from datetime import datetime