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
| console.log [ | |
| foo: 1 | |
| , | |
| bar: 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
| for f, index in files | |
| extname = path.extname f | |
| fs.lstat f, (err, stats) -> | |
| if !stats.isDirectory() and extname is '.coffee' | |
| fs.readFile f, 'utf8', compileCallback | |
| else if stats.isDirectory() | |
| readDirAfterThisOne = -> | |
| if index is files.length - 1 then clearInterval(h) and processDir(f) | |
| h = setInterval readDirAfterThisOne, 50 |
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
| if a | |
| ### | |
| b | |
| ### | |
| else | |
| c |
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
| this.set({status: status}); | |
| this.trigger("change:status", this, status); |
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 Utilities | |
| @findPos: (obj) -> | |
| obj = obj.get(0) if obj.html? | |
| left = top = 0 | |
| measure = -> | |
| left += obj.offsetLeft | |
| top += obj.offsetTop | |
| measure() | |
| measure() while obj = obj.offsetParent |
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
| getstyles -> | |
| result = {} | |
| for key in arguments | |
| result[key] = this.getStyle(key) | |
| return 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
| package_assets: on # (on, off, always) | |
| embed_assets: on # (on, off, datauri) | |
| compress_assets: on # (on, off) | |
| gzip_assets: on # (on, off) | |
| template_function: _.template # (defaults to the built-in micro-templating) | |
| package_path: packages # (defaults to assets) | |
| javascript_compressor: closure # (yui, closure) | |
| compressor_options: | |
| compilation_level: ADVANCED_OPTIMIZATIONS |
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
| assert.deepEqual item, { | |
| x: 1 | |
| y: 2 | |
| } | |
| # Or: | |
| assert.deepEqual item, |
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 ViewModel | |
| firstName: ko.observable 'Bob' | |
| lastName: ko.observable 'Smith' | |
| constructor: | |
| names = -> @firstName() + ' ' + @lastName() | |
| @fullName = ko.dependentObservable names, this |