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 | |
| scrot -s -b -q 1 -e 'mv $f ~/桌面/' |
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
| # You can test whether an object is compliant with the ActiveModel API by | |
| # including ActiveModel::Lint::Tests in your TestCase. It will included | |
| # tests that tell you whether your object is fully compliant, or if not, | |
| # which aspects of the API are not implemented. | |
| # | |
| # These tests do not attempt to determine the semantic correctness of the | |
| # returned values. For instance, you could implement valid? to always | |
| # return true, and the tests would pass. It is up to you to ensure that | |
| # the values are semantically meaningful. | |
| # |
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
| Subject: Re: 列出所有好友的手机号 [flyerhzm/rfetion GH-7] | |
| 你可以调用下面的方法 | |
| <pre><code> | |
| fetion = Fetion.new | |
| fetion.logger_level = level | |
| fetion.mobile_no = mobile_no | |
| fetion.password = password | |
| fetion.login | |
| fetion.register |
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
| Subject: Re: 列出所有好友的手机号 [flyerhzm/rfetion GH-7] | |
| 你可以调用下面的方法 | |
| <pre><code> | |
| fetion = Fetion.new | |
| fetion.logger_level = level | |
| fetion.mobile_no = mobile_no | |
| fetion.password = password | |
| fetion.login | |
| fetion.register |
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
| ^Q50,3 | |
| ^W100 | |
| ^H10 | |
| ^P1 | |
| ^S4 | |
| ^AT | |
| ^C1 | |
| ^R0 | |
| ~Q+0 | |
| ^O0 |
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
| run "rm public/index.html" | |
| generate(:nifty_layout, "application") | |
| generate(:nifty_config, "") | |
| generate(:nifty_authentication, "") | |
| generate(:nifty_scaffold, "post title:string body:text") | |
| route "map.root :controller => :posts" | |
| rake("db:migrate") | |
| git :init | |
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
| # new git resp | |
| 1. | |
| vi gitosis.conf | |
| git ci -m "add new xxx" | |
| git push | |
| 2. | |
| git init |
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
| class Person | |
| attr_reader :name | |
| def initialize(name = nil) | |
| @name = name | |
| end | |
| def loud_name | |
| @name.upcase | |
| end |
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
| # state.rb 状态模式 | |
| class Connection | |
| attr_accessor :state | |
| def initialize | |
| @state = TCPClose.new | |
| end | |
| def reset | |
| @state = TCPClose.new | |
| end |
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
| require 'test/unit' | |
| class TestStatePattern < Test::Unit::TestCase | |
| def test_1 | |
| c = Connection.new | |
| assert_equal "根本就没连上", c.disconnect | |
| assert_equal "正在连接", c.connect | |
| assert_equal "已经连着了, 不用再连", c.connect | |
| assert_equal "正在断开", c.disconnect |