Skip to content

Instantly share code, notes, and snippets.

View shrkw's full-sized avatar

Hiroyuki Shirakawa shrkw

  • Nagano, Japan
View GitHub Profile
@shrkw
shrkw / commit_types.txt
Created September 5, 2023 04:53
Conventional Commit types
build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
chore: Other changes that don't modify src or test files
ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
docs: Documentation only changes
feat: A new feature
fix: A bug fix
perf: A code change that improves performance
refactor: A code change that neither fixes a bug nor adds a feature
style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
test: Adding missing tests or correcting existing tests
# ==== Emojis ====
# 🐛 :bug: バグ修正
# ♻️ :recycle: リファクタリング
# 🎨 :art: コードフォーマット
# 📝 :memo: ドキュメンテーション
# 💄 :lipstick: UI, スタイルファイルの変更
# 💬 :speech_balloon: テキスト、文字列の変更
# 🔥 :fire: コード、ファイルの削除
@shrkw
shrkw / deepEquals.ts
Created February 15, 2021 05:29
check equality depp
function is(x: unknown, y: unknown): boolean {
if (x === y) {
return x !== 0 || y !== 0 || 1 / x === 1 / y;
} else {
return x !== x && y !== y;
}
}
export function deepEquals<T>(objA: T, objB: T): boolean {
if (is(objA, objB)) return true;
@shrkw
shrkw / api.ts
Last active August 19, 2020 10:45
// tslint:disable
/**
* test
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@shrkw
shrkw / pyenv_pipenv_mac.md
Last active December 19, 2019 04:33
Install pyenv, specific version pythons and pipenv on macOS

Install pyenv, specific version pythons and pipenv on macOS

pyenv and pythons

VERSION=3.8.0
@shrkw
shrkw / image1.jpg
Last active September 20, 2019 10:15
Kingdomino 日本語ルール
image1.jpg
@shrkw
shrkw / los_banditos_rules.ja.md
Last active September 12, 2019 16:30
Los Banditos 日本語ルール

Los Banditos 日本語ルール

準備

お宝チップを10枚、裏にして積み重ね、そのうちの4枚を二人のプレイヤーのあいだに並べる。ダイスをすべて袋に入れる。

setup

ゴール

お宝チップを奪い合い、さきに10点以上を獲得したプレイヤーの勝利。

手順

def quick_sort(src):
print(f"**: {src}")
if len(src) <= 1:
return src
pivot = src[0]
left = list()
right = list()
for n in src[1:]:
if n < pivot:

AZUL ゲームルール

ポルトガル王マヌエル1世は、アルハンブラ宮殿のタイルの美しさに心を打たれ、自分の宮殿を同様のタイルで装飾するよう命じました。プレイヤーはタイル・アーティストとなります。

プレイヤーボードの上方は得点ボードです。中央のタイル工房からタイルを持って来てプレイヤーボード左の図案ラインに並べ、タイルが揃ったらボード右の壁にタイルを貼ります。貼るたびに得点があり、ゲーム終了時にも出来上がった壁のデザインによって得点が入ります。

ゲームの準備

プレイヤーボードはカラフルな面を使います。プレイヤーボードの得点0のところに黒いキューブを置きます。 丸い皿を、2人プレイでは5枚、3人プレイでは7枚、4人プレイでは9枚用意します。2n+1です。これがタイル工房の展示ボードです。それらを円周状に並べます。円周の中央はあとでタイルを置けるように空けておきます。

スタートプレイヤーはスタートプレイヤータイル(1と書いてあります)を持ちます。スタートプレイヤーは袋の中にタイルを全部入れ、そこからランダムに引いて丸い皿に4枚ずつ載せていきます。

@shrkw
shrkw / merge_sort.py
Created September 4, 2019 23:23
merge_sort
from typing import List
import sys
def merge(src1: List, src2: List) -> List:
a = src1[0]
b = src2[0]
res = list()
while len(src1) != 0 or len(src2) != 0:
if a <= b: