var Person = Backbone.Model.extend();
This file contains hidden or 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
$brew doctor | |
$brew install postgreSql | |
#初始化数据库 | |
$ initdb /usr/local/var/postgres -E utf8 | |
#Success. You can now start the database server using: | |
# postgres -D /usr/local/var/postgres | |
#or | |
# pg_ctl -D /usr/local/var/postgres -l logfile start |
This file contains hidden or 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
zz - move current line to the middle of the screen | |
zt - move current line to the top of the screen | |
zb - move current line to the bottom of the screen | |
Ctrl-e Moves screen up one line | |
Ctrl-y Moves screen down one line | |
Ctrl-u Moves screen up ½ page | |
Ctrl-d Moves screen down ½ page | |
Ctrl-b Moves screen up one page | |
Ctrl-f Moves screen down one page |
This file contains hidden or 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
1. brew安装mysql | |
$ brew install mysql | |
2. 创建或修改/usr/local/etc/my.cnf | |
https://gist.github.com/sandyxu/6317492 | |
3. 初始化 init database | |
$ unset TMPDIR | |
$ mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp |
This file contains hidden or 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 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 = [email protected] | |
[core] | |
quotepath = false | |
[color] | |
interactive = auto | |
diff = auto | |
status = auto | |
branch = auto |
This file contains hidden or 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: [email protected]/sandyxu/xx.git | |
Push URL: [email protected]/sandyxu/xx.git | |
HEAD branch (remote HEAD is ambiguous, may be one of the following): | |
master | |
next |