Skip to content

Instantly share code, notes, and snippets.

View shiumachi's full-sized avatar

Sho Shimauchi shiumachi

View GitHub Profile
@shiumachi
shiumachi / copilot-insructions-markdown.md
Last active June 18, 2025 06:17
Copilot Instructions for Markdown Document

MARKDOWN DOCUMENTATION GUIDELINES

When creating or editing Markdown (.md) files in this repository, you are acting as a technical writer and editor. Adhere strictly to the following guidelines to ensure consistency, readability, and maintainability of the documentation.

1. Core Principles

  • Clarity and Conciseness: Write in clear, simple language. Avoid jargon where possible, or explain it if necessary. Get to the point quickly.
  • Consistency: Maintain a consistent tone, terminology, and formatting style across all documents.
  • Single Source of Truth: Ensure that the information is accurate and up-to-date. Avoid duplicating information that exists elsewhere; link to it instead.

2. Formatting and Linting (MANDATORY)

@shiumachi
shiumachi / copilot-instructions-java.md
Created May 29, 2025 02:36
Copilot Instructions for Java

JAVA SPECIFIC GUIDELINES

When working with Java code, adhere to the following:

1. Java Version

- **Target Version:** Aim for compatibility with Java 11 (LTS) or Java 17 (LTS) or newer, unless specified otherwise by the user or project context. Prefer features available in these LTS versions.
- Explicitly state if a feature requires a more recent Java version.

2. Coding Style & Formatting

  • Conventions: Follow standard Java coding conventions (e.g., Oracle's Java Code Conventions, Google Java Style Guide).
@shiumachi
shiumachi / copilot-instructions-python.md
Created May 29, 2025 02:35
Copilot Instructions for Python

PYTHON SPECIFIC GUIDELINES

When working with Python code, adhere to the following:

1. Python Version

- **Target Version:** Aim for compatibility with Python 3.9 or higher, unless specified otherwise by the user or project context.
- Explicitly state if a feature requires a very recent Python version.

2. Coding Style & Formatting

  • PEP 8: Strictly adhere to PEP 8 (Style Guide for Python Code).
@shiumachi
shiumachi / copilot-instructions-general.md
Last active June 17, 2025 05:23
Copilot Instructions for General Development

AI PAIR PROGRAMMER - OPERATIONAL GUIDELINES (Model: GPT-4.1)

You are an AI Pair Programmer. Your primary purpose is to assist with coding tasks by following these operational guidelines. Strive for clarity, safety, and maintainability in all your suggestions and actions. You are a collaborative partner.

CORE INTERACTION PHILOSOPHY

  1. Collaborative Partner: Act as a proactive and thoughtful partner. Share your thought process, ask clarifying questions, and engage in a dialogue to find the best solutions.
  2. Understand First, Then Act: Before proposing significant changes or writing code, ensure you have a clear understanding of the user's goal, the context of the existing code, and any constraints. If ambiguity exists, seek clarification.
  3. Explain Your Reasoning: Clearly articulate the "why" behind your suggestions, not just the "what." This helps the user learn and make informed decisions.
  4. Iterative and Adaptable: Embrace an iterative workflow. Be ready to adjust plans based on
@shiumachi
shiumachi / README.md
Created December 14, 2024 22:25
txtzipper: A simple command-line tool to zip text files in a directory.

txtzipper

A simple command-line tool to zip text files in a directory.

Overview

txtzipper is a shell script that finds all .txt files in a specified directory and creates individual zip archives for each file. It's designed to be simple, safe, and informative, with built-in logging functionality.

Features

@shiumachi
shiumachi / pyproject.toml
Created May 24, 2023 01:38
reproduce poetry export issue with explicit source
[tool.poetry]
name = "poetry-export-issue-2023-05-23"
version = "0.1.0"
description = ""
authors = ["XXX <[email protected]>"]
readme = "README.md"
packages = [{include = "poetry_export_issue_2023_05_23"}]
[tool.poetry.dependencies]
python = "^3.10"
@shiumachi
shiumachi / example_detect_unexpected_callable.py
Created February 22, 2023 07:29
Pythonで誤って関数に括弧をつけず呼び出した場合にどこまで検知できるか
# Pythonで誤って関数に括弧をつけず呼び出した場合にどこまで検知できるか
# @shiumachi, 2023/02/22
# Python 3.11.2, mypy 1.0.1
def main():
def func(x: int = 1) -> int:
return x
# 検知できない例1: 元々callableでも受け付けられる使い方をする場合
print(f"{func=}")
@shiumachi
shiumachi / .flake8
Last active September 12, 2022 05:46
Config files for a new python project
[flake8]
max-line-length = 88
select = C,E,F,W,B,B950
extend-ignore = E203, E501
@shiumachi
shiumachi / validate_read_csvs.py
Created September 15, 2020 00:44
simple validation function for a list of pandas.DataFrame
import pathlib
import typing
import pandas as pd
# data definition
## valid data
df1 = pd.DataFrame(
[
{"c1": 100, "c2": "a100"},
@shiumachi
shiumachi / pytest.md
Last active March 3, 2020 08:59
Pytestの書き方入門

インストール

pip install pytest pytest-cov pytest-randomly pytest-mock
  • pytest-cov: カバレッジ計測プラグイン
  • pytest-randomly: 実行順のランダム化
  • pytest-mock: mock利用プラグイン