These instructions install ruby and rubygems from source, not from RPMs. For instructions on installing from RPMs, look at something like http://wiki.opscode.com/display/chef/Installation+on+RHEL+and+CentOS+5+with+RPMs or http://mykestubbs.com/blog/2010/03/chef-installation-on-centos-54.html
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
| // 糟糕 | |
| function initVar($myVar) { | |
| if(!$myVar) { | |
| $myVar = $('#selector'); | |
| } | |
| } | |
| // 建议 |
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
| <?php | |
| class fakeString | |
| { | |
| private $str; | |
| function __construct() | |
| { | |
| $this->str = ""; | |
| } | |
| function addA() |
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
| // 糟糕 | |
| var first = $('#first'); | |
| var second = $('#second'); | |
| var value = $first.val(); | |
| // 建议 - 在jQuery对象前加$前缀 | |
| var $first = $('#first'); | |
| var $second = $('#second'), |
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
| // 糟糕 | |
| h = $('#element').height(); | |
| $('#element').css('height',h-20); | |
| // 建议 | |
| $element = $('#element'); | |
| h = $element.height(); | |
| $element.css('height',h-20); |
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
| #!/bin/sh | |
| #author: God Tao | |
| multi_blank() { | |
| for filename in `ls -A $1` | |
| do | |
| if [ -d "$1/$filename" ] | |
| then | |
| multi_blank "$1/$filename" | |
| else | |
| cat -s "$1/$filename" > "$1/$filename.cat" |
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
| # -*- coding: utf-8 -*- | |
| #author: pantaovay@gmail.com | |
| #date: 2013/10/4 | |
| import qiniu.conf | |
| import qiniu.rs | |
| import qiniu.rsf | |
| import sys.stderr | |
| qiniu.conf.ACCESS_KEY = "<YOUR_APP_ACCESS_KEY>" |
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
| # First install tmux | |
| brew install tmux | |
| # For mouse support (for switching panes and windows) | |
| # Only needed if you are using Terminal.app (iTerm has mouse support) | |
| Install http://www.culater.net/software/SIMBL/SIMBL.php | |
| Then install https://bitheap.org/mouseterm/ | |
| # More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |
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
| <IfModule mod_headers.c> | |
| Header set Access-Control-Allow-Origin "http://mozilla.github.com" | |
| </IfModule> |