- TODO を追加するには alt + shift + return を使う。
- TODO -> DONE -> 何もなし でローテーションさせるには C-c C-t を使う。
- 複数ファイルを横断して TODO を見つけることができる。
- org-agenda-files 変数にスキャンしたいファイルパスを与える。
- org-todo-list でスキャンを実行する。
- todo list のバッファで t を叩くとステータスをローテーションできる。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_working_job_argument_size | |
workers = Sidekiq::Workers.new | |
workers.filter_map do |_process_id, _thread_id, work| | |
payload = work.to_a[1] | |
job_class = payload[1]['args'][0]["job_class"] | |
arguments = payload[1]['args'][0]["arguments"] | |
if arguments && arguments.length > 1 | |
result = [job_class] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
Query = Struct.new(:type, :raw_sql, :model_name, :duration, keyword_init: true) do | |
def abstract_sql | |
raw_sql.gsub(/\d+/, 'N') | |
end | |
def unknown? | |
type.nil? && model_name.nil? | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 🐛 fix: | |
# ✨ feat: | |
# ♻️ refactor: | |
# ✅ test: | |
# 📝 docs: | |
# 📦 package: | |
# ⚡️ perf: | |
# 💚 ci: | |
# ⚠️ wip とか workaround に使う | |
# 👮 rubocop とかに使うかも |
grep よりも5倍くらい早い検索コマンド。
- 普段から
git grep
でこと足りてるなら問題ないが、巨大なプロジェクトを横断的に検索する場合にはインストールしたほうがいい。 - インストール方法を調べると
brew install ripgrep
と書いてあったりするのだが、これは c のコンパイラから始まって boost ライブラリや rust をインストールすることになるので死ぬほど遅い。マシンの性能や通信の速さによるが、自分は半日くらいかかった。 rust の開発環境が欲しいのでなければバイナリをインストールするべき。 バイナリはここからとってくる。 - 無視したいファイルは ~/.rgignore に書き込む。
モデルに enum 宣言した属性は、定義していない値をセットした時点 ArgumentError になる。このエラーは save や validation する前に発生するので注意が必要。モデルを更新するインターフェース(たとえばCSV)によっては不正な値を受け取る可能性を排除できない。したがってそのようなインターフェースを使う場合には値のチェック、もしくは ArgumentError のエラーハンドリングを行う。このメッセージはバリデーションエラーではないので、簡単に i18n ローカライズすることができないことに注意。
- http://soccer1356abc.hatenablog.com/entry/2018/12/22/150516
- https://stackoverflow.com/questions/37177893/rails-enum-validation-not-working-but-raise-argumenterror
モデルの名称と属性の名称をローカライズするには、下記のような翻訳データを用意する。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/philc/vimium/blob/master/README.md | |
unmap b | |
map h previousTab | |
map l nextTab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#==== Emojis ==== | |
# 🆕 新規実装 | |
# 🏥 バグ修正 | |
# 🤘 機能改善 | |
# ✨ 部分的な機能追加 | |
# 🎉 盛大に祝うべき大きな機能追加 | |
# ♻️ リファクタリング | |
# 👮 アラート等の修正 | |
# 🚿 不要な機能・使われなくなった機能の削除 | |
# 💚 テストやCIの修正・改善 |