Skip to content

Instantly share code, notes, and snippets.

View kumeS's full-sized avatar

skume kumeS

View GitHub Profile
@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.
@kumeS
kumeS / extract_and_decode_main_content.R
Created February 3, 2025 04:54
Extract Main Content and Decode Unicode Escapes from a Webpage
# Required packages
#library(httr)
#library(rvest)
#library(xml2)
#library(stringi)
#' Extract Main Content and Decode Unicode Escapes from a Webpage
#'
#' This function fetches the HTML content from the specified URL using a custom user agent,
#' selects the main container identified by the id "__nuxt", removes script and style elements,
@kumeS
kumeS / contemplative-llms.txt
Created January 12, 2025 11:28 — forked from Maharshi-Pandya/contemplative-llms.txt
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 1.
"X.gamma.Glu.Cys","X.gamma.Glu.2.aminobutyric.acid","X.gamma.Butyrobetaine","X.beta.Ala","X.Xanthosine","X.Xanthopterin","X.Xanthine","X.Val","X.UTP","X.Urocanic.acid","X.Uridine","X.Uric.acid","X.Urea","X.Uracil","X.UMP","X.UDP.N.acetylglucosamine","X.UDP.glucuronic.acid","X.UDP.glucose...UDP.galactose","X.UDP","X.Tyr.Glu","X.Tyramine","X.Tyr","X.Trp","X.Trimethylamine.N.oxide","X.Trigonelline","X.Triethanolamine","X.Trehalose.6.phosphate","X.trans.Glutaconic.acid...Itaconic.acid","X.threo.beta.Methylaspartic.acid","X.Threonic.acid","X.Thr.Asp","X.Thr","X.Thiaproline","X.Thiamine.phosphate","X.Thiamine","X.Theobromine","X.Taurocholic.acid","X.Taurine","X.Succinic.acid","X.Suberic.acid","X.Stachydrine","X.Spermine","X.Spermidine","X.Sorbitol.6.phosphate","X.S.Nitrosoglutathione","X.S.Methylmethionine","X.S.Lactoylglutathione","X.Serotonin","X.Ser.Glu","X.Ser","X.Sedoheptulose.7.phosphate","X.SDMA","X.Sarcosine","X.S.Adenosylmethionine","X.S.Adenosylhomocysteine","X.Saccharopine","X.Ribulose.5.phosphate","X.Ri
#' get_ftp_file_list function:
#' This function retrieves and returns a list of all files and directories at
#' a specified FTP URL.
#' download_ftp_files function:
#' This function downloads files and directories from a specified FTP URL to a
#' local directory. It supports recursive downloading, meaning it will enter
#' and download all contents within subdirectories as well.
# Install required packages
if (!requireNamespace("RCurl", quietly = TRUE)) {
READ.json <- function(file){
header = ''
positions = c()
genes = c()
is_header_line = TRUE
is_position_line = FALSE
is_gene_line = FALSE