把 Caps Lock 變成智慧的 Control 以及 Escape :
- 單獨輕按一下就是 Escape 。
- 若按下時同時按著其他鍵,就會是 Control 。
這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)
- Send Escape if you tap Caps Lock alone.
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
#!/usr/bin/env bash | |
if [[ -n $1 ]] | |
then | |
RAKE_PATH=`bundle show rake` | |
ruby -I"lib:test:${KATELLO_PATH}/test:${KATELLO_PATH}/spec" -I"${RAKE_PATH}/lib" \ | |
"${RAKE_PATH}/lib/rake/rake_test_loader.rb" $@ ${KATELLO_PATH}/test/katello_test_runner.rb | |
else | |
bundle exec rake test:katello | |
fi |
#!/usr/bin/env bash | |
set -e | |
if [[ -z $1 ]]; then | |
tmux switch-client -l | |
else | |
tmux switch-client -t "$1" | |
fi |
/** | |
* Convert From/To Binary/Decimal/Hexadecimal in JavaScript | |
* https://gist.github.com/faisalman | |
* | |
* Copyright 2012-2015, Faisalman <[email protected]> | |
* Licensed under The MIT License | |
* http://www.opensource.org/licenses/mit-license | |
*/ | |
(function(){ |
jQuery -> | |
$('[id^="best_in_place_your_object_"],[id$="address"]').on 'best_in_place:update', (event) -> | |
$address = $(event.target) | |
$address.data('bestInPlaceEditor').original_content = $address.html() | |
$address.html $address.html().replace(/[\n\r]+/g, '<br>') |
# ~/.osx — http://mths.be/osx | |
############################################################################### | |
# General UI/UX # | |
############################################################################### | |
# Set computer name (as done via System Preferences → Sharing) | |
scutil --set ComputerName "MacBookPro" | |
scutil --set HostName "MacBookPro" | |
scutil --set LocalHostName "MacBookPro" |
# When testing a rails website on my local development machine, I found my | |
# Parallel's VM wouldn't load 0.0.0.0:3000, 127.0.0.1, or localhost:3000. | |
# | |
# So I tried using my computers IP address and voila. I thought I'd hone | |
# my bash chops a little and extract the IP address with the port number | |
# concatenated to it. This command puts that on the clipboard so I can just | |
# paste it into IE so I could browser test. | |
# | |
# NOTE: the pbcopy command is Mac specific. | |
# |