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
/* | |
The function* declaration (function keyword followed by an asterisk) defines a generator function, which returns a Generator object. | |
You can also define generator functions using the GeneratorFunction constructor and a function* expression. | |
*/ | |
// Syntax | |
function* name([param[, param[, ... param]]]) { | |
statements | |
} |
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
/* on an iOS device, when you click the link having :hover css and navigate away to the next page and then hit the browsers’ back button, when you come back on this screen, you will see the above link is still in hover state */ | |
// use Modernizr, the no-touch class will be added to the root html element for non-touch devices. Then you can do this | |
a.myclass { | |
color:#999; | |
} | |
.no-touch a.myclass:hover, | |
a.myclass:active { |
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
// Node.js CheatSheet. | |
// Download the Node.js source code or a pre-built installer for your platform, and start developing today. | |
// Download: http://nodejs.org/download/ | |
// More: http://nodejs.org/api/all.html | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html | |
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
run curl -L https://www.npmjs.com/install.sh | sh |
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
add attribute overflow="visible" to <svg> | |
/* aslo add to sprint file if using that */ |
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() { | |
if(/iP(hone|ad)/.test(window.navigator.userAgent)) { | |
document.body.addEventListener('touchstart', function() {}, false); | |
} | |
}; | |
/* or add ontouchstart="" in element attributes */ |
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
.flex-container { | |
height: 100%; | |
display: -webkit-box; | |
display: -moz-box; | |
display: -ms-flexbox; | |
display: -webkit-flex; | |
display: flex; | |
-webkit-box-direction: normal; | |
-moz-box-direction: normal; |
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
/* using svg as a background-image */ | |
.my-element { | |
background-image: url(image.svg); | |
} | |
.no-svg .my-element { | |
background-image: url(image.png); | |
} | |
.my-element { | |
background-image: url(fallback.png); |
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
[].forEach.call($$("*"),function(a){ | |
a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16) | |
}) | |
// from https://gist.github.com/addyosmani/fd3999ea7fce242756b1 |