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
| let json = `{"timestamp":2837513946597,"zone_id":123456,"zone_plan":1,"http":{"protocol":2,"status":200,"host_status":503,"up_status":520,"method":1,"content_type":"text/html","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36","referer":"https://www.cloudflare.com/","request_uri":"/cdn-cgi/trace"},"origin":{"ip":"1.2.3.4","port":8000,"hostname":"www.example.com","protocol":2},"country":238,"cache_status":3,"server_ip":"192.168.1.1","server_name":"metal.cloudflare.com","remote_ip":"10.1.2.3","bytes_dlv":123456,"ray_id":"10c73629cce30078-LAX"}`; | |
| let data = JSON.parse(json); | |
| const bytes = json.length; | |
| const maxIterations = 500000; | |
| function bench(iter) { | |
| let iterations = maxIterations; | |
| const start = Date.now(); | |
| let totalNanos = 0; |
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
| sys = require 'sys' | |
| {exec} = require 'child_process' | |
| fsevents = require 'fsevents' | |
| ################################### | |
| compiling = false | |
| compiler = null | |
| notify = (message, type = 'info') -> |
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: -> | |
| @config() | |
| config: -> | |
| magic = (options) => | |
| @config = {} if typeof @config is 'function' | |
| @config[option] = value for option, value of options | |
| return magic |
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
| # get a single result | |
| @processOne requiredStringArgument, requiredNumberArgument, id, (result) -> | |
| # single result of processOne method | |
| console.log result | |
| @processOne.interative @, requiredStringArgument, requiredNumberArgument, arrayWithIds, (results) -> | |
| # multiple results of processOne method in an array, with order of arrayWithIds preserved | |
| console.log results |