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 folderID = 55251; // ne la url del folder dice el id (internal id del folder) | |
| // genero mi JSON | |
| JSON_Result = { | |
| items: [], | |
| title: "", | |
| moreResults: "" | |
| } | |
| var file = nlapiCreateFile('FileName.json', 'PLAINTEXT', JSON.stringify(JSON_Result)); |
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
| distanceTo : function(point) { | |
| var self = this; | |
| var R = 6371; // mean radius of earth | |
| var location = self.origin.getPosition(); | |
| var lat1 = self.toRad_(location.lat()); | |
| var lon1 = self.toRad_(location.lng()); | |
| var lat2 = self.toRad_(point.lat); | |
| var lon2 = self.toRad_(point.lng); | |
| var dLat = lat2 - lat1; | |
| var dLon = lon2 - lon1; |
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
| <dict> | |
| <key>name</key> | |
| <string>Embedded source</string> | |
| <key>scope</key> | |
| <string>text source</string> | |
| <key>settings</key> | |
| <dict> | |
| <key>background</key> | |
| <string>#43443A</string> | |
| </dict> |
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
| jQuery('<div/>', { | |
| "class": "myClass", | |
| "html": "hi, this is the html content" | |
| }); |
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 t = window.performance.timing, | |
| interactive = t.domInteractive - t.domLoading, | |
| dcl = t.domContentLoadedEventStart - t.domLoading, | |
| complete = t.domComplete - t.domLoading; | |
| console.log('interactive: ', interactive + ' ms') | |
| console.log('docContentLoaded: ', dcl + ' ms') | |
| console.log('complete: ', complete + 'ms') |
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
| * { background-color: rgba(255,0,0,.2); } | |
| * * { background-color: rgba(0,255,0,.2); } | |
| * * * { background-color: rgba(0,0,255,.2); } | |
| * * * * { background-color: rgba(255,0,255,.2); } | |
| * * * * * { background-color: rgba(0,255,255,.2); } | |
| * * * * * * { background-color: rgba(255,255,0,.2); } |
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 setPrecision(number, precision) | |
| { | |
| var prec = Math.pow(10, precision); | |
| return Math.round(number * prec) / prec; | |
| } | |
| // Use: setPrecision(40.1 , 2).toFixed(2) |
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
| areDifferents: function (a, b) { | |
| return a.reduce(function(memo, value, index) { | |
| return memo && a[index] === b[index]; | |
| }, 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 preloadImages(srcs) { | |
| if (!preloadImages.cache) { | |
| preloadImages.cache = []; | |
| } | |
| var img; | |
| for (var i = 0; i < srcs.length; i++) { | |
| img = new Image(); | |
| img.src = srcs[i]; | |
| preloadImages.cache.push(img); | |
| } |
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
| require({ | |
| 'paths': { | |
| 'platform': 'path/to/platform' | |
| } | |
| }, | |
| ['platform'], function(platform) { | |
| console.log(platform.name); | |
| }); |
NewerOlder