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[maxlength]").keydown( function(e) { | |
var key = e.which; // backspace = 8, delete = 46, arrows = 37,38,39,40 | |
if ( ( key >= 37 && key <= 40 ) || key == 8 || key == 46 ) return; | |
return $(this).val().length < $(this).attr( "maxlength" ); | |
}); |
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
curl -u username:password http://example.com |
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
<!-- bookmark on Delicious --> | |
<a rel="nofollow" href="http://delicious.com/post?url=<?php the_permalink(); ?>&title=<?php echo urlencode(get_the_title($id)); ?>" title="Bookmark this post at Delicious">Bookmark at Delicious</a> | |
<!-- submit to Digg --> | |
<a rel="nofollow" href="http://digg.com/submit?phase=2&url=<?php the_permalink(); ?>" title="Submit this post to Digg">Digg this!</a> | |
<!-- tweet on Twitter --> | |
<a rel="nofollow" href="http://twitter.com/home?status=<?php echo urlencode("Currently reading: "); ?><?php the_permalink(); ?>" title="Share this article with your Twitter followers">Tweet this!</a> | |
<!-- submit to StumbleUpon --> |
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 is_empty(obj) { | |
"use strict"; | |
// Assume if it has a length property with a non-zero value | |
// that that property is correct. | |
if (obj.length && obj.length > 0){ return false; } | |
if (obj.length && obj.length === 0){return true; } | |
for (var key in obj) { | |
if (Object.prototype.hasOwnProperty.call(obj, key)) { return false; } | |
} |
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
// Find out if a single checkbox is checked or not. | |
// The function will returns true or false: | |
$('#checkBox').attr('checked'); |
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
$(document).ready(function() { | |
$('form').submit(function() { | |
if(typeof jQuery.data(this, "disabledOnSubmit") == 'undefined') { | |
jQuery.data(this, "disabledOnSubmit", { submited: true }); | |
$('input[type=submit], input[type=button]', this).each(function() { | |
$(this).attr("disabled", "disabled"); | |
}); | |
return true; | |
} | |
else |
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
$("#form").keypress(function(e) { | |
if (e.which == 13) { | |
return false; | |
} | |
}); |
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
$(document).ready(function() { | |
$("a.topLink").click(function() { | |
$("html, body").animate({ | |
scrollTop: $($(this).attr("href")).offset().top + "px" | |
}, { | |
duration: 500, | |
easing: "swing" | |
}); | |
return false; | |
}); |
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
<cfscript> | |
writeOutput("You are on server: " & cgi.local_host & "<br/>"); | |
if( structKeyExists(url, "action") ) { | |
if ( url.action eq "new" ) { | |
createSessionTest(); | |
} | |
} else { | |
if( not structKeyExists(session, "test") ){ | |
writeOutput("Sorry, but there is no session test"); | |
} |
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
if (jQuery) { | |
// jQuery is loaded | |
} else { | |
// jQuery is not loaded | |
} | |
if (typeof jQuery == 'undefined') { | |
// jQuery is not loaded | |
} else { | |
// jQuery is loaded |