把 Caps Lock 變成智慧的 Control 以及 Escape :
- 單獨輕按一下就是 Escape 。
- 若按下時同時按著其他鍵,就會是 Control 。
這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)
- Send Escape if you tap Caps Lock alone.
class UrlValidator < ActiveModel::EachValidator | |
def validate_each(record, attribute, value) | |
valid = begin | |
URI.parse(value).kind_of?(URI::HTTP) | |
rescue URI::InvalidURIError | |
false | |
end | |
unless valid | |
record.errors[attribute] << (options[:message] || "is an invalid URL") |
;; NeoTree can be opened (toggled) at projectile project root | |
(defun neotree-project-dir () | |
"Open NeoTree using the git root." | |
(interactive) | |
(let ((project-dir (projectile-project-root)) | |
(file-name (buffer-file-name))) | |
(neotree-toggle) | |
(if project-dir | |
(if (neo-global--window-exists-p) | |
(progn |
rails stats:controllers # Show basic controller usage stats
rails stats:models # Show basic model usage stats
rails stats:trends # show frequency trends for a date column; MODEL=x COLUMN=y
rails stats:unroutable # Find routes that will raise a routing error when requested
rails stats:users # Show basic details of users