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
| /* | |
| # With vertical | |
| ┐ | |
| ├ Node Title ┐ | |
| │ ├ Node Title, 1000 ms | |
| │────────────┘ | |
| ┘ | |
| # Without vertical and optional line number |
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 log(var_) { | |
| console.log(var_); | |
| return var_; | |
| } | |
| function istype(test, Ctor) { | |
| if (Ctor == void 0 && test == void 0) return true; | |
| return log(test.constructor == Ctor || test instanceof Ctor); | |
| } |
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
| //** Compat 1.2 | |
| Array.implement({ | |
| }); | |
| //**/ | |
| (If compat is unnecessary... strip the first '/' and let the rest of the build process continues, the rest of the code (comment) is automatically deleted by builder(s) or the JS skips the code since it's a comment.) | |
| /** Compat 1.2 | |
| Array.implement({ |
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
| $ python sexp.py test.js | |
| (SCRIPT | |
| (VAR (INITVAR a (FUNCTION (_ __ ___) (SCRIPT | |
| (DEF-FUNCTION (b) (SCRIPT)))))) | |
| (VAR (INITVAR c 'hello world'))) |
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
| /** | |
| * Explanation: before compression, remove any first '/' for matched: ^[ \t]*\/\/\*\* *(Compat|Fix)\:?(\w)* | |
| * That are not necessary for the build. E.g. if the build is for 1.3 with no compat, then all Compat | |
| * matches will lose the first '/' and therefore all of that code becomes commented. Similarly for browser | |
| * fixes. | |
| * | |
| * During compression, the user can optionally remove the comments and thereby removing the rest of the code. | |
| * | |
| * Otherwise, there is not JavaScript performance loss due to commenting. Parser will just skip. | |
| * |
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
| 'protected mutator method'.replace(/(\w*) +(?!(\w*)^)/g, function(m) { | |
| console.log(m); | |
| return ''; | |
| }); |
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
| // original (1.99dev) | |
| String.implement({ | |
| contains: function(string, separator){ | |
| return ((separator) ? (separator + this + separator).indexOf(separator + string + separator) : this.indexOf(string)) > -1; | |
| } | |
| }); | |
| // new |
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
| // horrible(?) attempt at minimizing global pollution and other tricks made by Jaml. | |
| HAML('simple'). | |
| div().adopt(). | |
| h1('Some title'). | |
| p('Some exciting paragraph text'). | |
| br(). | |
| ul().adopt(). | |
| li('First item'). | |
| li('Second 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
| <html> | |
| <head> | |
| <title>Demo Title</title> | |
| <meta name="description">Demo Description</meta> | |
| <style class="shell css"> | |
| /* Demo CSS */ | |
| </style> | |
| <script src="deps.js" title="Authors can generate a deps.js, or include from a temp (.gitignored) file."></script> | |
| <script class="shell js requires" src="../Source/MyPlugin.js" title="'requires' help builders"></script> |
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.compose = function(){ | |
| var fn, i = 0, fns = arguments, results = []; | |
| return function(){ | |
| while(fn = fns[i]) results[i++] = fn.apply(this, arguments); | |
| return results; | |
| }; | |
| }; | |
| /* | |
| Usage: |