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
/*! | |
* clock | |
* Copyright (c) 2012 hitsujiwool <[email protected]> | |
* MIT Licensed | |
*/ | |
;(function(exports) { | |
function Clock(speed) { |
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
/* | |
* IBM Model 1 | |
*/ | |
(function(exports) { | |
function train(sentencePairs, iteration) { | |
iteration = iteration || 100; | |
var count, |
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 foo = {}; | |
foo.__defineGetter__('bar', function() { | |
return require('./bar'); | |
}); | |
foo.bar(); |
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
<a href="javascript:void(0);">click</a> | |
<div id="log"></div> |
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
// module pattern 1 | |
(function(exports) { | |
var ns = {}; | |
ns.method = function() {}; | |
exports.ns = ns; | |
}(this)); | |
// module pattern 2 | |
var ns = (function(exports) { | |
exports.method = function() {}; |
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 foo = { | |
bar: function() { | |
console.log('this is ' + this.toString()); | |
} | |
}; | |
var baz = foo.bar; | |
foo.bar(); // thisはfoo | |
baz(); // thisはwindow |
NewerOlder