Created
April 21, 2012 06:31
-
-
Save jeffhung/2434806 to your computer and use it in GitHub Desktop.
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 fn_akamai() {}; | |
| fn_akamai.prototype.tmexpr = function() { | |
| return "sid=`mist-session` && mist-source $sid -m calc.in | mist-decode -l"; | |
| }; | |
| function fn_count(s) { this.s = s; } | |
| fn_count.prototype.tmexpr = function() { | |
| return this.s.tmexpr() + " | " + " count-lines "; | |
| }; | |
| function fn_filter(s, f, v) { this.s = s; this.f = f; this.v = v; } | |
| fn_filter.prototype.tmexpr = function() { | |
| return this.s.tmexpr() + " | grep '" + this.f + "=" + this.v + "' "; | |
| }; | |
| var evaluate = function(formula, sheetname, cellcoord) { | |
| var AKAMAI = function() { | |
| console.log("AKAMAI"); | |
| return new fn_akamai(); | |
| }; | |
| var COUNT = function(source) { | |
| console.log("COUNT"); | |
| return new fn_count(source); | |
| }; | |
| var FILTER = function(source, field, value) { | |
| console.log("FILTER"); | |
| return new fn_filter(source, field, value); | |
| }; | |
| return eval(formula).tmexpr() + " | update-sheet " + URL_BASE + "/_/" + sheetname + " " + cellcoord; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment