This file contains 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
// weird Chrome, Y.browser bug with position been saved | |
// browser jumps to hash id and then jumps to last scrolled position | |
$(window).on('load', function(){ | |
setTimeout(function(){ | |
var initialUrlHash = getInitialUrlHash(); | |
if (initialUrlHash) { | |
document.body.scrollTop = $(initialUrlHash).offset().top; | |
} | |
},0); | |
}); |
This file contains 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 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 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 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 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 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 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 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 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) { |
OlderNewer