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 speak (message) { | |
var msg = new SpeechSynthesisUtterance(message) | |
var voices = window.speechSynthesis.getVoices() | |
msg.voice = voices[0] | |
window.speechSynthesis.speak(msg) | |
} | |
speak('hello'); |
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
angular.element('body').animate({ | |
scrollTop: 0 | |
}, 800); | |
// OR | |
$('body').animate({ | |
scrollTop: 0 | |
}, 800); |
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
@mixin fontFace($family,$src,$style: normal,$weight: normal) { | |
@font-face { | |
font-family: $family; | |
src: url('#{$src}.eot'); // IE9 compat | |
src: url('#{$src}.eot?#iefix') format('embedded-opentype'), // IE8 and below | |
url('#{$src}.woff') format('woff'), // standards | |
url('#{$src}.ttf') format('truetype'), // Safari, Android, iOS | |
url('#{$src}.svg##{$family}') format('svg'); // legacy iOS | |
font-style: $style; |
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 LodashFactory($window) { | |
if(!$window._){ | |
// If lodash is not available you can now provide a | |
// mock service, try to load it from somewhere else, | |
// redirect the user to a dedicated error page, ... | |
} | |
return $window._; | |
} | |
// Define dependencies |
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
<style> | |
/* Media query for displaying content in mobile email clients */ | |
@media only screen and (max-device-width: 480px) { | |
.hide { max-height: none !important; font-size: 12px !important; display: block !important; } | |
} | |
... | |
/* CSS for hiding content in desktop/webmail clients */ | |
.hide { max-height: 0px; font-size: 0; display: none; } |
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
{ | |
"preset": "jquery", | |
"requireEarlyReturn": true, | |
"requireSpacesInsideParentheses": { | |
"all": true, | |
"ignoreParenthesizedExpression": true, | |
"except": [ "{", "}", "[", "]", "function", "\"" ] | |
}, | |
"disallowSpacesInsideParentheses": { | |
"only": [ "{", "}", "[", "]", "function" ] |
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
IE6 Only | |
================== | |
_selector {...} | |
IE6 & IE7 | |
================== | |
*html or { _property: } | |
IE7 Only | |
================== |
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
//iPhone 5 + 5s specific selector | |
@mixin iPhone-5-and-5s-portrait-query { | |
@media screen and (device-aspect-ratio: 40/71) { | |
@content; | |
} | |
} | |
@include iPhone-5-and-5s-portrait-query { | |
//style goes here | |
} |
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
@media only screen and (device-width: 768px) { | |
/* For general iPad layouts */ | |
} | |
@media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait) { | |
/* For portrait layouts only */ | |
} | |
@media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape) { | |
/* For landscape layouts only */ |
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
//IE FIX!!! | |
if (!window.location.origin) { | |
window.location.origin = | |
window.location.protocol + "//" | |
+ window.location.hostname + (window.location.port ? ':' + window.location.port : ''); | |
} |