Skip to content

Instantly share code, notes, and snippets.

@kumeS
kumeS / summaryWebScraping.R
Created November 5, 2025 15:50
Summarize Text via Web Scraping of Google Search
#' Summarize Text via Web Scraping of Google Search
#'
#' Scrape text information from Google Search and summarize it using LLM.
#' Uses OpenAI API key for execution. Translation to Japanese requires a Deepl API key.
#'
#' @title Text Summary via Web Scraping
#' @description Scrapes Google Search results for the provided query and summarizes the content.
#' @param query The search query. Default is "LLM".
#' @param t Time period for search. 'w' for last week, 'm' for last month, 'y' for last year.
#' Default is 'w'.
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
},
"XcodeBuildMCP": {
"command": "mise",
@kumeS
kumeS / DuplicateChecker.sh
Created May 21, 2025 14:57
DuplicateChecker: A script to detect and report code duplications in a codebase.
#!/usr/bin/env bash
set -euo pipefail
# DuplicateChecker.sh
# A script to detect and report code duplications in a codebase.
#
# Usage:
# DuplicateChecker.sh [-d] [-l MIN_LENGTH] [-t TOP_N] [-h] [directory]
#
# Arguments:
@kumeS
kumeS / verify_debug_v1.sh
Created May 20, 2025 17:34
iOS Project Verification Tool / iOS プロジェクト検証ツール
#!/usr/bin/env bash
# ============================================================
# verify_code_quality.sh (v36 – Homebrew パッケージインストール・互換性強化)
# - 重複コード検出 (jscpd:コンソール出力のみ)
# - コード整形 (swiftformat:デフォルト設定を使用)
# - 静的解析 (swiftlint:違反件数を警告表示、詳細オフ)
# - ファイル行数統計 (長いファイルの特定)
# - サイクロマティック複雑度 (swiftlint:複雑度チェックに代用) ※swift-complexityの代わり
# - 未使用コード解析 (periphery:使用されていないコードの検出)
# - IPAサイズチェック (基準値との比較)
@kumeS
kumeS / verify_debug_v2.sh
Created May 20, 2025 17:34
iOS Project Verification Tool / iOS プロジェクト検証ツール
#!/usr/bin/env bash
#
# verify_debug.sh - Code quality and repository sanity checks for Swift/SwiftUI (SwiftPM) projects
IFS=$'\n\t'
set -eo pipefail
# --- Argument parsing & directory setup -------------------
SILENT_MODE=0
AUTO_YES=0
UPDATE_DEPS=0
@kumeS
kumeS / prepare_mac_env.sh
Created May 13, 2025 03:57
Mac 環境に必要なパッケージを Homebrew で一括インストール - XcodeGen, swift-format, SwiftLint を準備
#!/usr/bin/env bash
set -euo pipefail
#===================================================
# prepare_mac_env.sh
# - Mac 環境に必要なパッケージを Homebrew で一括インストール
# - XcodeGen, swift-format, SwiftLint を準備
#===================================================
# 1) Homebrew がなければインストール
@kumeS
kumeS / init_ios_project_en.sh
Created May 13, 2025 03:56
A bash script automating iOS app setup via CLI: creates project folders, SwiftUI entrypoint & API key file, generates .xcodeproj with XcodeGen, builds, launches on simulator, and scaffolds config/docs.
#!/usr/bin/env bash
set -euo pipefail
#===================================================
# init_ios_project.sh
# - Takes a project name as argument and automates:
# 1. Directory structure & Sources/Config, Resources, Tests creation
# 2. Generating APIKeys.swift & SwiftUI entry point
# 3. project.yml + XcodeGen to produce .xcodeproj
# 4. Build → install → launch on simulator
@kumeS
kumeS / init_ios_project.sh
Created May 13, 2025 03:56
iOSアプリ開発をCLIで自動化するbashスクリプトです。プロジェクト構造の生成、SwiftUIエントリポイント&APIキー設定ファイル作成、XcodeGenによる.xcodeproj生成、ビルド→シミュレータ起動→インストール→起動、各種設定/ドキュメントファイルの雛形作成までを一括で行います。
#!/usr/bin/env bash
set -euo pipefail
#===================================================
# init_ios_project.sh
# - プロジェクト名を引数に、
# 1. フォルダ&Sources/・Sources/Config・Resources・Tests 作成
# 2. APIKeys.swift, SwiftUI エントリポイント生成
# 3. project.yml + XcodeGen で .xcodeproj 生成
# 4. ビルド → インストール → 起動
@kumeS
kumeS / DifyChat4R.R
Created February 23, 2025 03:36
This function sends a chat query to the Dify API using blocking mode. It returns the complete parsed JSON response from the API.
#' DifyChat4R Function (Blocking Mode Only)
#'
#' @description
#' This function sends a chat query to the Dify API using blocking mode.
#' It returns the complete parsed JSON response from the API.
#'
#' @param query A character string representing the user's input query.
#' @param user A character string representing the user identifier. Default is "abc-123".
#' @param api_key A character string for the Dify API secret key.
#' Defaults to the value of the environment variable "DIFY_API_KEY".
system_set = c("
You will be provided with a script from a video or URL. Summarize the content without altering the speaker's intention in Japanese. Create summaries in different lengths: 1 bullet point, 3 bullet points, 5 bullet points, 10 bullet points, and 20 bullet points.
日本語の場合には要約は「です」「ます」調で答えてください。
箇条書きは、1つずつ \n で改行してください。
# Steps
1. Review the provided a video script or URL carefully to understand the main ideas and key points.
2. Identify core messages and intentions conveyed by the speaker.