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
// Partial credit for this goes to the broken script I found at http://www.sitepoint.com/jquery-convert-rgb-hex-color/ | |
function rgb2hex(rgb){ | |
rgb = rgb.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*(\d*)\.?(\d*)\s*)?\)$/); | |
return "#" + | |
("0" + parseInt(rgb[1],10).toString(16)).slice(-2) + | |
("0" + parseInt(rgb[2],10).toString(16)).slice(-2) + | |
("0" + parseInt(rgb[3],10).toString(16)).slice(-2); | |
} |
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
Show hidden characters
[ | |
{ "keys": ["ctrl+tab"], "command": "next_view" }, | |
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" } | |
] |
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
javascript:window.location="http://thegamesdb.net/game/"+Math.floor(Math.random()*18000); |
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 checkjQuery() { | |
if (window.jQuery) { | |
$(function() { | |
//your code here | |
}); | |
} else { | |
window.setTimeout(checkjQuery, 100); | |
} | |
} | |
checkjQuery(); |
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
$.fn.equalheight = function( remove ) { | |
// Reset heights from the last viewport resize so that values do not get wacky-large. | |
this.height('auto'); | |
// if remove is true, just reset the heights and return | |
if ( remove ) { | |
return; | |
} |
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
$.fn.equalheight = function( remove ){ | |
if( remove == false ){ | |
$.each( this, function(){ | |
this.css('height','auto'); | |
}); | |
return; | |
} | |
// Reset heights from the last viewport resize so that values do not get wacky-large. |
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
$.fn.equalheight = function(){ | |
var $selection = this; | |
var $groups = []; | |
while( $selection.length > 1 ){// If $selection.length is greater than 1, then it must be 2, meaning there are at least 2 equal-height divs left. This will prevent an infinite loop if there is an equal-height div without a partner equal-height div. | |
// Find an equal-height group. | |
$groups.push( $selection.eq(0).siblings('.equal-height').addBack() ); | |
// Reduce selection by the latest equal-height group. | |
$selection = $selection.not( $groups[ $groups.length - 1 ] ); | |
// Drop groups that only have 1 element - it doesn't make any sense to have a lone equal-height element. |
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
// https://github.com/mikebranski/jquery-nospam | |
// implementation | |
$(function(){ | |
function reverse(s){ | |
return s.split("").reverse().join(""); | |
} | |
var tld = addr.substring( addr.lastIndexOf('.') + 1 ); |
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
.DS_Store | |
Thumbs.db | |
dwsync.xm | |
_notes/ | |
*.svn | |
*.swo | |
*.swp | |
~ | |
*~ | |
~* |
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
/* put the current year in the footer of your website */ | |
$("#footer .year").text(" " + ( new Date() ).getFullYear() ); | |
/* ^ this space will come after the copyright symbol before the year. Notice how the HTML is laid out in mytemplate.html. */ |