adsf
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
| console.time("start") | |
| var FINGER_SIZE_PX = 48; | |
| // var checkOverlapBetweenFingers = false | |
| // var scoreBasedOnOverlapArea = true | |
| /** | |
| * Merge client rects together and remove small ones. This may result in a larger overall |
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 FINGER_SIZE_PX = 48; | |
| var checkOverlapBetweenFingers = false | |
| var scoreBasedOnOverlapArea = true | |
| function simplifyBCRs(bcrs) { | |
| bcrs = bcrs.filter(bcr => { |
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 request = require("request"); | |
| app.get("/weather/:cityId", (req, res) => { | |
| request("http://weatherapithing.com/" + req.params.cityId, function( | |
| error, | |
| response, | |
| body | |
| ) { | |
| console.log("error:", error); // Print the error if one occurred | |
| res.header("Access-Control-Allow-Origin", "*"); |
Ran a test where I have a location in some minified code, then prettify that code and want to know the new location:
1154.107ms prettier formatWithCursor
299.370ms pretty-fast (initial)
25.215ms pretty-fast (cached source map)
Downsides of pretty-fast:
- doesn't seem to support column-level mapping
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 getLevelIndentation(level){ | |
| return level * 20 + "px"; | |
| } | |
| window.devtoolsFormatters = [{ | |
| header: function(obj, config){ | |
| if (config && config.backboneModelFormatter){ | |
| return ["div", {}, config.key] | |
| } | |
| if (!(obj instanceof Backbone.Model)){ |
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 REPEATS = 1000; | |
| var _add = function (n1, n2) { | |
| return n1 + n2; | |
| } | |
| a = 4; | |
| b = 5; | |
| var alternatives = [ | |
| { |
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
| --- Raw source --- | |
| function add(a, b){ | |
| return a + b; | |
| } | |
| print(add(15, 19)); | |
| for (var i=0;i<1000;i++){ | |
| add(i, 22); | |
| } |