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
/* For a Firefox only: */ | |
@-moz-document url-prefix() { | |
fieldset { | |
display: table-cell; | |
} | |
} | |
/* For a Webkit browsers: */ | |
fieldset { | |
min-width: 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
var QueryString = function () { | |
var query_string = {}, | |
query = window.location.search.substring(1), | |
vars = query.split("&"); | |
for (var i=0, j = vars.length; i < vars.length; i++) { | |
var pair = vars[i].split("="); | |
// If first entry with this name | |
if (typeof query_string[pair[0]] === "undefined") { |
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
// Boring | |
if (isThisAwesome) { | |
alert('yes'); // it's not | |
} | |
// Awesome | |
isThisAwesome && alert('yes'); | |
// Also cool for guarding your code | |
var aCoolFunction = undefined; |
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
<img alt="" src="http://img.youtube.com/vi/zmPzbZVUp3g/1.jpg" /> | |
<img alt="" src="http://img.youtube.com/vi/zmPzbZVUp3g/2.jpg" /> | |
<img alt="" src="http://img.youtube.com/vi/zmPzbZVUp3g/3.jpg" /> |
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
::-moz-selection { | |
text-shadow: 1px 1px 0 #000; | |
background: #999; | |
color: #fff; | |
} | |
::selection { | |
text-shadow: 1px 1px 0 #000; | |
background: #999; | |
color: #fff; | |
} |
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 videoWidth = containerOfVideo.width(), | |
videoHeight = Math.round(videoWidth * 0.5625); |
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
// Reset a Video players - iframes from YouTube or Vimeo, etc. | |
var resetIframeVideoPlayer = function () { | |
var $videoPlayer = $(this), videoIframeSrc; | |
// Store the src of iframe with video | |
videoIframeSrc = $player.attr('src'); | |
// Clear src attribute from an iframe | |
$videoPlayer.attr('src', ''); | |
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 mySelfExecutedFunction() { | |
// | |
})(); |
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 ($) { | |
'use strict' | |
var handler = function() { | |
// | |
} | |
$('.btn-class').on('click', handler); |
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 beforeActionMessage = 'Are you sure you want to perform this action?', | |
confirmWindow = window.confirm(beforeActionMessage); | |
if (confirmWindow) { | |
// Do some action here | |
} else { | |
return false; | |
} |