This file contains hidden or 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 today = new Date(); | |
var dd = today.getDate(); | |
var mm = today.getMonth()+1; //January is 0! | |
var yyyy = today.getFullYear(); | |
if(dd<10){dd='0'+dd} if(mm<10){mm='0'+mm} today = dd+'/'+mm+'/'+yyyy; | |
document.write(today); |
This file contains hidden or 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
.wrapper { | |
/* set the height of the element which contains what you want to center */ | |
height: 100%; | |
/* these styles are optional, to set width horizontally center the page */ | |
max-width: 500px; | |
margin: 0 auto; | |
} | |
.wrapper:before, .container { | |
/* these are the important styles for the centered element: */ | |
display: inline-block; |
This file contains hidden or 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
/* Assuming this HTML structure: | |
<div class="clear"> | |
<div class="floated"></div> | |
<div class="floated"></div> | |
<div class="floated"></div> | |
</div> | |
*/ | |
.clear:before, .clear:after { |
This file contains hidden or 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 url = "http://www.mypage.com/index.php?"+new Date().getTime(); |
This file contains hidden or 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 highestCol = Math.max($('#element1').height(),$('#element2').height()); | |
$('.elements').height(highestCol); |
This file contains hidden or 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 preventUnloadPrompt; | |
var messageBeforeUnload = "my message here - Are you sure you want to leave this page?"; | |
$(document).live('click','a', function() { preventUnloadPrompt = true; }); | |
$(document).on('submit','form', function() { preventUnloadPrompt = true; }); | |
$(window).bind("beforeunload", function(e) { | |
var rval; | |
if(preventUnloadPrompt) { | |
return; | |
} else { |
This file contains hidden or 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 stopBrowser() { | |
if (window.stop !== undefined) { | |
window.stop(); | |
} | |
else if (document.execCommand !== undefined) { | |
document.execCommand("Stop", false); | |
} | |
} |
This file contains hidden or 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 bytesToSize(bytes, precision) { | |
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB']; | |
var posttxt = 0; | |
if (bytes == 0) return 'n/a'; | |
while( bytes >= 1024 ) { | |
posttxt++; | |
bytes = bytes / 1024; | |
} | |
return bytes.toFixed(precision) + " " + sizes[posttxt]; | |
} |
This file contains hidden or 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> | |
<p>Some Text</p> | |
</li> | |
<li> | |
<p>A bit more text that goes on 2 lines</p> | |
</li> | |
<li> | |
<p>Even more text that demonstrates how lines can span multiple lines</p> | |
</li> |
This file contains hidden or 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 result; | |
result = (function() { | |
try { | |
return readFromCache(); | |
} catch (_error) { | |
return generate(); | |
} | |
})(); |
NewerOlder