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
NodeList.prototype.__proto__ = Array.prototype; | |
// Use any array methods on NodeLists | |
$$('.cards').map(card => card.textContent); // ['card 1', 'card 2'] |
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 to handle error | |
function handleError(fn) { | |
return function(...params) { | |
return fn(...params).catch(function (err) { | |
// do something with the error | |
console.error(`Oops!`, err); | |
}); | |
} | |
} |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
body { | |
font: font-style font-variant font-weight font-size/line-height font-family; | |
} | |
body { | |
font: italic small-caps normal 13px/150% Arial, Helvetica, sans-serif; | |
} |
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
ul li { | |
float: left; | |
margin-left: 5px; | |
*display: inline; /*IE7 and below*/ | |
_display: inline; /*IE6 and below*/ | |
} | |
/* this example fixes double left margin bug */ |
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
@font-face { | |
font-family: 'MyFontFamily'; | |
src: url('myfont-webfont.eot?#iefix') format('embedded-opentype'), | |
url('myfont-webfont.woff') format('woff'), | |
url('myfont-webfont.ttf') format('truetype'), | |
url('myfont-webfont.svg#svgFontName') format('svg'); | |
} |
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
textarea{ | |
overflow:auto; | |
} |
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
.transparent_class { | |
/* IE 8 */ | |
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; | |
/* IE 5-7 */ | |
filter: alpha(opacity=50); | |
/* Netscape */ | |
-moz-opacity: 0.5; | |
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
::selection { | |
color: white; | |
background-color: #ef8629; | |
} | |
::-moz-selection { | |
color: white; | |
background: #ef8629; | |
} |
NewerOlder