Skip to content

Instantly share code, notes, and snippets.

@eyasuyuki
eyasuyuki / removeOneDrive.ps1
Created September 10, 2026 20:56
OneDriveを削除するPowerShellスクリプト
# ==========================================
# OneDrive 徹底削除スクリプト
# ==========================================
# 管理者権限のチェック
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Error "このスクリプトは管理者権限で実行する必要があります。PowerShellを管理者として再起動してください。"
exit 1
}
@eyasuyuki
eyasuyuki / folder2excel.ps1
Created August 18, 2026 23:53
フォルダに整理したスクリーンショットをExcelに貼り付ける
# ==============================================================================
# 設定
# ==============================================================================
$rootFolder = Get-Location
$excelPath = Join-Path $rootFolder "Result.xlsx"
Write-Host "処理開始..."
Write-Host "読み込み元: $rootFolder"
Write-Host "出力先: $excelPath"
@eyasuyuki
eyasuyuki / ImportImagesToExcel.ps1
Last active June 19, 2026 07:51
Excelに画像貼り付け
# ==============================================================================
# 設定
# ==============================================================================
$rootFolder = Get-Location
$excelPath = Join-Path $rootFolder "Result.xlsx"
Write-Host "処理開始..."
Write-Host "読み込み元: $rootFolder"
Write-Host "出力先: $excelPath"
@eyasuyuki
eyasuyuki / pickfile.py
Created March 25, 2026 06:14
ファイルパスとディレクトリパスが混在するテキストファイルを読み込んでファイルパスだけ抽出する
import os
input_file = 'list.txt'
output_file = 'files_only.txt'
with open(input_file, 'r', encoding='utf-8') as f:
paths = f.read().splitlines()
# 実際にファイルとして存在するものだけを抽出
files_only = [p for p in paths if os.path.isfile(p)]
@eyasuyuki
eyasuyuki / index.html
Created January 11, 2026 07:11
実質賃金と消費税率のグラフ
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>実質賃金と消費税率の推移</title>
<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script src="https://unpkg.com/recharts@2.5.0/dist/Recharts.js"></script>
@eyasuyuki
eyasuyuki / TestcodeVsMetrics.md
Created February 18, 2025 08:36
テストコードと定量的ソフトウエア品質測定手法の比較

1. テストコードと定量的測定の違い

項目 テストコード 定量的測定
動作の正しさを保証 ✅ できる ❌ できない
変更の安全性を確認 ✅ できる ❌ できない
ユーザーシナリオの検証 ✅ できる ❌ できない
迅速なフィードバック ✅ できる ⚠️ 一部可能だが手間がかかる
バグ修正コストの削減 ✅ できる ⚠️ バグ発生後の対応になる

2. テストコードが優れているポイント

@eyasuyuki
eyasuyuki / RestartNotify.ps1
Created February 14, 2025 03:40
Windows再起動時にメールする
$SMTPServer = "smtp.gmail.com"
$SMTPPort = 587
$Sender = "your-email@gmail.com"
$Recipient = "notify@example.com"
$Username = "your-email@gmail.com"
$Password = "アプリパスワード(16桁)" # 取得したアプリパスワードを入力
$Subject = "Windows再起動通知"
$Body = "PCが再起動されました。日時: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')"
@eyasuyuki
eyasuyuki / W11Taskbar.js
Last active February 6, 2025 01:32
Windows 11でタスクバーを上下左右に表示するJSCript
var WshShell = new ActiveXObject("WScript.Shell");
var FSO = new ActiveXObject("Scripting.FileSystemObject");
var regPath = "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\StuckRects3";
var backupFile = "backup.txt";
// タスクバーの位置を定義(分かりやすい名前)
var taskbarPositions = {
"LEFT": "00", // 左
"TOP": "01", // 上
"RIGHT": "02", // 右
@eyasuyuki
eyasuyuki / UpTaskbar.js
Created February 6, 2025 01:10
Windows 11でタスクバーを上に表示させるJScript
var WshShell = new ActiveXObject("WScript.Shell");
var regPath = "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\StuckRects3";
var value = "00000000 00000000 03000000 00ffffff ffffffff ffffffff 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000";
try {
// レジストリに新しい値を書き込む
WshShell.RegWrite(regPath, value, "REG_BINARY");
// エクスプローラーを再起動
WshShell.Run("taskkill /F /IM explorer.exe", 0, true);
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple/DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.javaopen.chime</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/afplay</string>
<string>/Users/yasuyuki/Music/Chime.m4a</string></array>