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 A = function() {}; | |
| A.prototype.over = function() {}; | |
| var B = function() { | |
| this.where_am_i = 'at work'; | |
| A.call(this); | |
| }; | |
| var _fn = 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
| class Base | |
| constructor: (type) -> | |
| @type: type | |
| class Tower extends Base | |
| constructor: (material) -> | |
| super 'tower' | |
| @material: material |
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 test(arg, arg2) {}; | |
| // This | |
| test.apply(test, [1, 2]); | |
| // Is the same as | |
| test.call(test, 1, 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
| hookIO.addListener('JsonrpcRequest', function(request, response) { | |
| try { | |
| var requestData = JSON.parse(request.body); | |
| hookIO.emit('JsonrpcResponse', response, | |
| hookIO.api[requestData.method].apply(hookIO.api, requestData.params)); | |
| } catch (error) { | |
| hookIO.emit('Jsonrpc404Response', response, error); | |
| } | |
| }); |
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 class literal, including optional superclass and constructor. | |
| exports.ClassNode: class ClassNode extends BaseNode | |
| type: 'Class' | |
| constructor: (variable, parent, props) -> | |
| @children: compact flatten [@variable: variable, @parent: parent, @properties: props or []] | |
| compile_node: (o) -> | |
| extension: @parent and new ExtendsNode(@variable, @parent) | |
| constructor: null |
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
| http: require 'http' | |
| body: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"' + | |
| ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' + | |
| '<html>' + | |
| ' <head>' + | |
| ' <meta http-equiv="Content-type" content="text/html; charset=utf-8" />' + | |
| ' <title>Page Title</title>' + | |
| ' <script type="text/javascript" charset="utf-8">' + | |
| ' document.addEventListener("DOMContentLoaded", function(ev) {' + |
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
| http: require 'http' | |
| body: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"' + | |
| ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' + | |
| '<html>' + | |
| ' <head>' + | |
| ' <meta http-equiv="Content-type" content="text/html; charset=utf-8" />' + | |
| ' <title>Page Title</title>' + | |
| ' </head>' + | |
| ' <body>' + |
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
| Connection.prototype.query = function (sql, callback) { | |
| if (!this._queries) this._queries = []; | |
| this._queries.push([sql, callback]); | |
| this.maybeDispatchQuery(); | |
| }; |
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 fs, path; | |
| fs = require('fs'); | |
| path = require('path'); | |
| process.mixin(global, require('sys')); | |
| exports.directoryWalker = function directoryWalker(dir, callback, maxLevels, currentLevel, fromRoot) { | |
| maxLevels = 'number' === typeof maxLevels ? maxLevels : 0; | |
| currentLevel = 'number' === typeof currentLevel ? currentLevel : 1; | |
| fromRoot = 'string' === typeof fromRoot ? fromRoot : ''; | |
| return fs.readdir(dir, function(error, files) { | |
| if (error) { |
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 Animal = (function () { | |
| var youCantSeeMe = 123; | |
| return function () { | |
| this.butIcan = 2 * youCantSeeMe; | |
| }; | |
| })(); | |
| Animal.prototype.test = function() { | |
| return this.butIcan; | |
| }; |