Skip to content

Instantly share code, notes, and snippets.

View yamaton's full-sized avatar

yamato matsuoka yamaton

View GitHub Profile
@yamaton
yamaton / instructions_chat_and_language_feedback.txt
Last active September 26, 2025 12:46
Chat + Language Feedback 2025-09-26
You are an AI assistant with two required functions for every response.
### 1. Primary Function: Conversational AI
Follow a default conversational style: clear, accurate, and helpful. This is your main role in every response.
### 2. Secondary Function: Language Feedback
After completing the primary response, add a separate section labeled **Language Feedback**. In this section, analyze the user’s most recent message for issues in American English.
@yamaton
yamaton / gist:46ab4ef2be5f2ce94874b82968c86bdc
Last active August 30, 2025 14:19
Radical Candor Learning Protocol
You have two core functions. Your primary function is to be a direct, intellectually honest assistant. Your secondary function is to provide feedback on my use of American English.
Apply the following communication protocol to all responses:
- Get straight to the point. Skip pleasantries, flattery, and apologies.
- Deliver all feedback—both on the substance of my ideas and on my language—directly and without softening language or "compliment sandwiches."
- Keep responses concise unless the complexity of the topic requires a detailed explanation.
### Primary Function: Intellectual Engagement
When responding to the content of my message, adhere to these principles:
- Point out flaws, inconsistencies, or errors in my reasoning.
@yamaton
yamaton / test_micromamba_run.py
Last active September 20, 2022 17:52
Test `micromamba run` with various characters as filename input
"""
Test `micromamba run` with filenames of various characters
## Prerequisites
- Get mamba ready
- Run following to create a conda environment beforehand
mamba create -c conda-forge -n cat cat
- Get micromamba binary
- Set the Config below ⬇️ to set MICROMAMBA_BIN and PREFIX paths
@yamaton
yamaton / checker.py
Created January 25, 2022 22:31
Try to detect typos by computing Levenshtein distances of neighbors
import argparse
import itertools
def levenshtein(s1: str, s2: str) -> int:
"""Calculate Levenshetein distance of two strings
Direct copy from https://rosettacode.org/wiki/Levenshtein_distance#Iterative_2
"""
if len(s1) > len(s2):
@yamaton
yamaton / get_unique_names.py
Created January 25, 2022 22:21
Get unique names (genus and species) from two files
import argparse
import logging
def remove_symbols(text: str) -> str:
"""Remove non-alphaneumeric letters '<', '>', '|'"""
return text.replace("<", "").replace(">", "").replace("|", "")
def get_genus_species(filename: str) -> set[str]:
@yamaton
yamaton / scraper.py
Last active January 26, 2022 01:51
Scrape fishbase
#!/usr/bin/env python
import bs4
import urllib.parse
import urllib.request
import pickle
URL = "https://fishbase.se/Summary/SpeciesSummary.php"
#!/usr/bin/env python
"""
SSH先の conda 環境を activate / deactivate するスクリプト
## つかいかた
condassh activate <env-name>
condassh deactivate
## セットアップ: パスの通ったところに condassh を置く
wget [[URL to this raw gist]] -O condassh
# hello-world イメージからコンテナつくる&実行(イメージ無いので勝手にダウンロードが始まる)
docker run hello-world
# ubuntu イメージからコンテナつくって、中のシェルにアクセスする
#  (オプション -it でシェルアクセス)
docker run -it ubuntu bash
# (Ctrl+d キーでコンテナを終わらせる)
# イメージの一覧
@yamaton
yamaton / covid-19-countries-stat.ipynb
Last active April 2, 2020 19:24
covid-19-countries-stat.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yamaton
yamaton / number_series_with_sympy.ipynb
Created December 3, 2019 22:14
Printing from 1 to 100 without a loop
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.