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
// quick copy paste jQuery starter embed | |
<script src="http://code.jquery.com/jquery-latest.js"></script> | |
<script> | |
$(document).ready(function(){ | |
// jQuery Code Here | |
}); | |
</script> |
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
// Value swap (usually for search fields) | |
// whenever you have a search field and you want it to defaultly display a value “search…” | |
// and have that value empty out on focus, well this is how to do this with jQuery 1.4. | |
swap_val = []; | |
$(".swap").each(function(i){ | |
swap_val[i] = $(this).val(); | |
$(this).focusin(function(){ | |
if ($(this).val() == swap_val[i]) { | |
$(this).val(""); |
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
// max height for columns using jQuery | |
// Unfortunately css does not support this natively, sometimes when creating column based | |
// layouts it looks so much better if the columns aligned by height, so here is the easy way | |
// of doing this. | |
var max_height = 0; | |
$("div.col").each(function(){ | |
if ($(this).height() > max_height) { max_height = $(this).height(); } | |
}); |
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
// On Hover add and Remove a class | |
$('.onhover').hover( | |
function(){ $(this).addClass('hover_style_class') }, | |
function(){ $(this).removeClass('hover_style_class') } | |
) |
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
// ==UserScript== | |
// @name Plone Show All | |
// @namespace http://plone.org | |
// @description Forces folder_contents view to always show all content as opposed to batching. | |
// @include http://*advancedaquarist.com/* | |
// @include http://*reefs.org/* | |
// @include http://*aquaristcourses.org/* | |
// ==/UserScript== | |
h = window.location.href; |
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
// Reddit Bookmarklet to Add URLs to Links in Pages Before Printing | |
// Add to your bookmark bar and click on it on any Reddit page and hyperlinks will have their | |
// URLs added right below the link. Nice for printing! | |
javascript:var x=$(".content").find("div.md a").each(function(){var href= (this).attr("href");$(this).after("<br \/>"+href);}); |
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
<!-- You'll need to call get_disqus_num_replies() every time you alter the content (ex - ajax) --> | |
<script type="text/javascript"> | |
//<![CDATA[ | |
var get_disqus_num_replies = function() { | |
var links = document.getElementsByTagName('a'); | |
var query = '?'; | |
for(var i = 0; i < links.length; i++) { | |
if(links[i].href.indexOf('#disqus_thread') >= 0) { | |
query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&'; | |
} |
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
$0=200.000 (x, step/mm) | |
$1=4250.000 (y, step/mm) | |
$2=200.000 (z, step/mm) | |
$3=30 (step pulse, usec) | |
$4=200.000 (default feed, mm/min) | |
$5=200.000 (default seek, mm/min) | |
$6=255 (step port invert mask, int:11111111) | |
$7=200 (step idle delay, msec) | |
$8=25.000 (acceleration, mm/sec^2) | |
$9=0.050 (junction deviation, mm) |
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
Sub ScalePictures40() | |
Dim i As Long | |
With ActiveDocument | |
For i = 1 To .InlineShapes.Count | |
With .InlineShapes(i) | |
.ScaleHeight = 40 | |
.ScaleWidth = 40 | |
End With | |
Next i | |
End With |