⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
# 在OmniAuth时触发异常被web server捕获直接返回500页面,如果想捕获并处理要做如下设置 | |
# config/initializers/omniauth.rb | |
OmniAuth.config.on_failure = AuthenticationsController.action(:failure) | |
# log 输出 | |
OmniAuth.config.logger = Rails.logger |
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
在GitHub里 Issue是我们的任务管理,代码跟踪,意见反馈的根源。通过对 Issue, 添加 Milestones进行进度管理; | |
及时调整Issue的状态,便于了解进度;添加Label,有助于区分Issue的性质。每次代码的提交最好都有对应的Issue, | |
便于浏览任务对应的代码,直接对每行代码评论,反馈。尤其是对程序员永远的沟通能力和思维定式,减少了沟通中的上下文。 | |
这样一套下了,会减少很多沟通成本。 | |
建议每个提交代码的人先在GihHub 添加或找到一个 Issue,充分利用这套系统带给我们的便利。 | |
提交代码,从 New Issue 开始!!! |
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
# 来自wooyun的白帽子安全 http://www.wooyun.org/bugs/subtype-65/page/1 | |
# 通过params[:continue] 的安全url进行跳转 | |
def safe_continue_redirect(continue = params[:continue]) | |
if continue | |
redirect_to safe_continue_url(continue) | |
else | |
redirect_to(root_path) | |
end | |
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
# git 命令自动提示 blog: | |
http://code-worrier.com/blog/autocomplete-git/ | |
# 安装git命令自动提示后很爽,但是删除后的branch由于缓存,仍然提示出来,导致提示过多且混乱。通过查看 | |
$ git remote show origin | |
* remote origin | |
Fetch URL: git@github.com/sandyxu/xx.git | |
Push URL: git@github.com/sandyxu/xx.git | |
HEAD branch (remote HEAD is ambiguous, may be one of the following): | |
master | |
next |
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
[user] | |
name = sandyxu | |
email = jyosuper@gmail.com | |
[core] | |
quotepath = false | |
[color] | |
interactive = auto | |
diff = auto | |
status = auto | |
branch = auto |
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
cd `brew --prefix` | |
rm -rf Cellar | |
brew prune | |
rm `git ls-files` | |
rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions | |
rm -rf .git | |
rm -rf ~/Library/Caches/Homebrew |
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
# All models should be organized using the following format. | |
class MyModel < ActiveRecord::Base | |
# extends ... | |
# includes .. | |
# security (i.e. attr_accessible) ...... | |
# relationships .... | |
# validations .. | |
# callbacks | |
# scopes | |
# additional config |
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
%a 星期的缩写,如Wed | |
%A 星期的全称,如Wednesday | |
%U 本星期在全年中所属的周数 | |
%W | |
%H 小时(24小时制) | |
%M 分钟 | |
%S 秒 | |
%I 小时(12小时制) | |
%p PM 或 AM | |
%b 月份的缩写,如 Jan |
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
[client] | |
port = 3306 | |
socket = /tmp/mysql.sock | |
default-character-set = utf8 | |
[mysqld] | |
collation-server = utf8_unicode_ci | |
character-set-server = utf8 | |
init-connect ='SET NAMES utf8' | |
max_allowed_packet = 64M |
OlderNewer