Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gaomd/3621102 to your computer and use it in GitHub Desktop.
Save gaomd/3621102 to your computer and use it in GitHub Desktop.
some `minor` fix
goog.provide('ZhiHu.JavasSriptPirate');
goog.require("Programmer");
/*
Abstract class.
*/
ZhiHu.JavaScriptPirate = function(macBookPro, extraLCD){
this.myMacbook = macBookPro;
this.extraLCD = extraLCD;
};
goog.inherits(ZhiHu.JavaScriptPirate, Programmer);
ZhiHu.JavaScriptPirate.prototype.workHard = function(){
if(!this.isTired()){
this.doWork_();
}
};
ZhiHu.JavaScriptPirate.prototype.isTired = function(){
console.log("WARNING: I'm fine."); // this is crazy!
return false;
};
ZhiHu.JavaScriptPirate.prototype.isQualify = function(){
if(this.lazy_ || this.notLoveJS){
return false;
}
var items = [
["isGeek", 5],
["familiarWithDebugTools", 10],
["familiarWithJQuery/MooTools/GoogleClosure/YUI", 20],
["PSDToWebpage", 10],
["IE8/Chrome/FF/SafariCompatible", 10],
["familiarWithHtml5", 15],
["familiarWithPython/C/C++/Java/C#/PHP", 15],
["commonDesignPatterns", 10],
["experienceWithGit/SVN", 5],
["experienceWithLinux", 5],
["BeAggressiveness", 5],
];
if(this.isSuperMan()){
return true;
}
var score = 0;
goog.array.forEach(items, function(item){
if(this.hasOwnProperty(item[0])){
score += item[1];
}
}, this);
return score > 70;
};
!function(excellentProgrammer){
setTimeout(function(excellentProgrammer){
// excellent programmer do tests before put it's code online!!
// so at least there is no typo in it's code.
excellentProgrammer.workHard();
}, 1000*60*60*24); // YOU ARE DEAD!!
}(new ZhiHu.JavaScriptPirate(new MacBookPro, new LCD()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment