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
| load 'capistrano/cap_notify' | |
| set :notify_emails, ["allmembers@yourcompany.com", "myself@gmail.com"] |
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
| #pragma mark - Storyboard | |
| - (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender | |
| { | |
| if ([segue.identifier isEqualToString:@"segue_name"]) { | |
| ChildViewController *child = [segue destinationViewController]; | |
| [detail setChildName:@"David"]; | |
| } | |
| } |
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 page = new WebPage(); | |
| function googleSearch() | |
| { | |
| console.log('Load http://www.google.com'); | |
| page.render('google.png'); | |
| console.log('render complete'); | |
| page.next = searchResult; | |
| page.evaluate(function() { | |
| document.querySelector('input[name=q]').value = 'syshen'; |
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
| { | |
| "dependencies": { | |
| "commander": { | |
| "version": "0.5.2" | |
| }, | |
| "connect": { | |
| "version": "1.8.5", | |
| "dependencies": { | |
| "qs": { | |
| "version": "0.4.2" |
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 vows = require('vows'), | |
| assert = require('assert'), | |
| ATM = require('./atm').ATM; | |
| vows.describe("Sufficient cash").addBatch({ | |
| "When user owns 100 dollars in the bank": { | |
| "and user wants to withdraw 20 dollars from ATM": { | |
| topic: function() { var atm = new ATM(); atm.deposit(100); return atm.withdraw(20);}, | |
| "should get 20 dollars from ATM and leave 80 dollars in the account.": function(result) { |
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
| describe('Strategy in round robin', function() { | |
| describe("without proxy setting", function() { | |
| // initiate your testing target, or create your mock objects | |
| var proxy = new lbProxy.LoadBalancingProxy(basic_options); | |
| var strategy = new strategies.RoundRobinStrategy(proxy.proxies, basic_options); | |
| it("should return null", function() { | |
| var proxy = strategy.next(); | |
| should.not.exist(proxy); |
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
| describe('Strategy in round robin', function() { | |
| describe("with one proxy setting", function() { | |
| basic_options["backends"] = [ | |
| { | |
| host: "127.0.0.1", | |
| port: 8001, | |
| https: false | |
| } | |
| ]; | |
| var proxy = new lbProxy.LoadBalancingProxy(basic_options); |
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 MyClass() { | |
| this.x = 123; | |
| this.y = 456; | |
| }; | |
| MyClass.prototype.show = function() { | |
| console.log(this); | |
| }; | |
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 MyFunc() { | |
| console.log(this); | |
| } | |
| MyFunc(); |
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 test1() { | |
| this.name = "test1"; | |
| this.print = function() { | |
| console.log(this.name); | |
| } | |
| } | |
| function test2() { | |
| this.name = "test2"; | |
| } |