Skip to content

Instantly share code, notes, and snippets.

git diff で差分があるかどうかだけ知りたい

$ git diff --exit-code --quiet
$ echo $?

--exit-code で差分があれば 1, なければ 0.

--quiet で何も表示しない.

@tkhk
tkhk / rails_booting_process.md
Created April 8, 2022 10:42
Rails の起動プロセスの順番

Rails の起動プロセスの順番

毎回忘れるのでメモ

  # == Booting process
  #
  # The application is also responsible for setting up and executing the booting
  # process. From the moment you require "config/application.rb" in your app,

Docker で Cloud Pub/Sub エミュレーター

Cloud Pub/Sub エミュレーターの起動

基本的に docker-compose で使うと思うので、以下 docker-compose.yml のサンプル。

version: "3.8"

services:
@tkhk
tkhk / github-actions-cache.md
Created November 1, 2022 15:07
github actions キャッシュメモ

github actions のキャッシュメモ

2022-11-02 現在

容量と削除

  • リポジトリ全体で最大 10 GB
    • キャッシュ数に制限はない
  • 7 日間アクセスがないキャッシュは削除される
  • 10GB を超えると古いものから削除される
#!/bin/bash
set -euo pipefail
select_option() {
local prompt_message=$1
shift
local options=("$@")
PS3="$prompt_message"
select opt in "${options[@]}"; do