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 mapValue(value, fromMin, toMin, fromMax, toMax) { | |
| return (value - fromMin) / (toMin - fromMin) * (toMax - fromMax) + fromMax; | |
| } |
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
| processManagement: | |
| fork: true | |
| pidFilePath: /var/run/mongodb/mongod.pid | |
| net: | |
| bindIp: 127.0.0.1 | |
| port: 27017 | |
| storage: | |
| dbPath: /var/lib/mongo | |
| journal: | |
| enabled: true |
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 page = require('webpage').create(), | |
| system = require('system'), | |
| args = system.args, | |
| siteName; | |
| function takeScreenshot() { | |
| if (args.length === 1) { | |
| console.log('Please specify a URL to screenshot.'); |
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 hideErrors() { | |
| window.onerror = function () { | |
| return true; | |
| } | |
| } |
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 getUrlParam(name) { | |
| name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); | |
| var regexS = "[\\?&]" + name + "=([^&#]*)"; | |
| var regex = new RegExp(regexS); | |
| var results = regex.exec(window.location.href); | |
| if (results == null) { | |
| return ""; | |
| } else { |
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 getScrollY() { | |
| var currentY = 0; | |
| if (typeof( window.pageYOffset ) == 'number') { | |
| currentY = window.pageYOffset; | |
| } else if (document.body && ( document.body.scrollLeft || document.body.scrollTop )) { | |
| currentY = document.body.scrollTop; | |
| } else if (document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop )) { | |
| currentY = document.documentElement.scrollTop; | |
| } |
NewerOlder