Skip to content

Instantly share code, notes, and snippets.

View syshen's full-sized avatar

Steven Shen syshen

View GitHub Profile
load 'capistrano/cap_notify'
set :notify_emails, ["allmembers@yourcompany.com", "myself@gmail.com"]
#pragma mark - Storyboard
- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"segue_name"]) {
ChildViewController *child = [segue destinationViewController];
[detail setChildName:@"David"];
}
}
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';
{
"dependencies": {
"commander": {
"version": "0.5.2"
},
"connect": {
"version": "1.8.5",
"dependencies": {
"qs": {
"version": "0.4.2"
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) {
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);
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);
function MyClass() {
this.x = 123;
this.y = 456;
};
MyClass.prototype.show = function() {
console.log(this);
};
function MyFunc() {
console.log(this);
}
MyFunc();
function test1() {
this.name = "test1";
this.print = function() {
console.log(this.name);
}
}
function test2() {
this.name = "test2";
}