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
| window.onload = function(){ | |
| var iframeholder = document.getElementById('iframeholder'); | |
| var test = document.createElement('iframe'); | |
| var base = document.createElement('base'); | |
| base.setAttribute('target', '_parent') | |
| test.onload = function(){ | |
| var y = (test.contentWindow || test.contentDocument); | |
| if (y.document)y = y.document; |
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 distance between two geo coordinates in kilometers | |
| function distanceInKilometers(lat1, lon1, lat2, lon2) { | |
| var rlat1 = Math.PI * lat1/180 | |
| var rlat2 = Math.PI * lat2/180 | |
| var rlon1 = Math.PI * lon1/180 | |
| var rlon2 = Math.PI * lon2/180 | |
| var theta = lon1-lon2 | |
| var rtheta = Math.PI * theta/180 | |
| var dist = Math.sin(rlat1) * Math.sin(rlat2) + Math.cos(rlat1) * Math.cos(rlat2) * Math.cos(rtheta); | |
| dist = Math.acos(dist) |
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
| //this is data // noprotect | |
| var context = { | |
| keys:[0,1,2,3,null], | |
| key:"<b>test</b>" | |
| }; | |
| //this is template | |
| function _template(){ | |
| for (var i=0; i < context.keys.length; i++) { | |
| div.b; |
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 fs = require('vow-fs'), | |
| vow = require('vow'); | |
| /** | |
| * @param {String} path | |
| * @returns {Promise} representing css | |
| */ | |
| module.exports = function processNode(path) { | |
| return fs.isDir(path) | |
| .then(function(isDir) { |
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
| /** | |
| * Prevent modern browsers from displaying `audio` without controls. | |
| * Remove excess height in iOS 5 devices. | |
| */ | |
| audio:not([controls]) { display: none; height: 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
| /* | |
| ** http://jsfiddle.net/hEDEK/1/ | |
| ** | |
| ** http://www.w3.org/TR/CSS21/box.html#collapsing-margins | |
| */ | |
| .child { | |
| background: red; | |
| width: 30px; | |
| height: 30px; | |
| margin: 10px; |
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 Test(a, b){ // noprotect | |
| assert(typeOf({a:a}, 'string'), function(m){ throw m }); | |
| assert(typeOf({b:b}, 'string'), function(m){ throw m }); | |
| var result = a + b; | |
| result = null; | |
| assert(notNullOrUndefined({result:result}), function(m){ throw m }); | |
| assert(equal({result:result}, 'ac'), function(m){ throw m }); | |
| return 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
| /* you can see it in action here http://jsbin.com/joxinizo/4/edit */ | |
| html, body { | |
| width: 100%; | |
| height: 100%; | |
| margin: 0; | |
| padding: 0; | |
| } | |
| .bgd { |
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
| //chunk | |
| function chunk(arr, n) { | |
| var result = []; | |
| while(arr.length) { | |
| result.push(arr.splice(0,n)) | |
| } | |
| return result; | |
| } | |
| //chunk - obfuscated (72 chars) |
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 tag(tagName) { | |
| return function() { | |
| var args = arguments; | |
| return function () { | |
| return '<' + tagName + '>' + evalContent(args) + '</' + tagName + '>'; | |
| }; | |
| }; | |
| } | |
| function evalContent(args) { |