This file contains 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 Animal { | |
constructor(public name) { } | |
move(meters) { | |
alert(this.name + " moved " + meters + "m."); | |
} | |
} | |
class Snake extends Animal { | |
move() { | |
alert("Slithering..."); |
This file contains 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 = function(a){ | |
var promise = new Promise(); | |
asyncAjaxFunction(a).done(function(){ | |
promise.resolve(); | |
}).fail(function(){ | |
promise.reject(); | |
}) | |
}; | |
foo.then(function(){ |
This file contains 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 util = require('util'), | |
EventEmitter = require('events').EventEmitter; | |
var Server = function() { | |
var self = this; | |
this.on('custom_event', function() { | |
self.logSomething('custom_event'); | |
}); |
This file contains 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 = require('fs'); | |
var esprima = require('esprima'); | |
var escodegen = require('escodegen'); | |
var estraverse = require('estraverse'); | |
fs.readFile('test_1.js', 'utf8', function(err, contents) { | |
var ast = esprima.parse(contents); | |
estraverse.replace(ast, { | |
enter : function (node, parent) { | |
if (node.type === 'Property' && node.key.name.indexOf('jota') != -1) { | |
this.remove(); |
This file contains 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
{ | |
"name": "resources-enme-war", | |
"version": "1.5.2", | |
"homepage": "https://github.com/encuestame/encuestame", | |
"authors": [ | |
"Juan Picado (@jotadeveloper) <[email protected]>" | |
], | |
"license": "APL2", | |
"ignore": [ | |
"**/.*", |
This file contains 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
intern: { | |
local_browser: { | |
options: { | |
runType: 'runner', | |
config: '<%= dirs.tests %>/intern_local_browser' | |
} | |
}, | |
remote_local: { | |
options: { | |
runType: 'runner', |
This file contains 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
less: { | |
development: { | |
options: { | |
compress: false, | |
yuicompress: false, | |
//sourceMap : true, | |
optimization: 1 | |
}, | |
files: { | |
"<%= dirs.css_src %>/tweetpoll.css": "<%= dirs.less_src %>/tweetpoll.less", |
This file contains 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
<plugin> | |
<groupId>com.github.eirslett</groupId> | |
<artifactId>frontend-maven-plugin</artifactId> | |
<version>0.0.23</version> | |
<configuration> | |
<workingDirectory>src/main/resources/resource</workingDirectory> | |
</configuration> | |
<executions> | |
<execution> | |
<id>install node and npm</id> |
This file contains 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 ast = esprima.parse("var a;"); |
This file contains 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
// esprima | |
var ast = esprima.parse("var foo = 'bar';"); | |
// acorn | |
var ast = acorn.parse('var a;', { | |
// collect ranges for each node | |
ranges: true | |
}); |