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
ssh-keygen -t dsa; cat ~/.ssh/id_dsa.pub | ssh -l REMOTE_USER REMOTE_SERVER 'cat >> ~/.ssh/authorized_keys' |
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
#!/usr/bin/env bash | |
# | |
# simple recursive search and replace string in files | |
# setup: alias replace='~/replace.sh' | |
# notes: you will need to escape special chars! eg: replace '\/dir1' '\/dir2' . | |
# usage: replace <oldstring> <newstring> <path> <depth> | |
# examples: | |
# replace "([^\s]+.php)" "\/\1" . | |
# replace "\"\/([^\/]+.php)" "\"\/dir\/\1" . |
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
// jQuery UI - Extending the base widget class | |
// create new base widget class | |
$.widget('ui.chunk'); | |
// class definition | |
$.extend($.ui.chunk.prototype, { | |
// | |
}); |
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
$.fn.exists = function( func ){ | |
return ( this.length && func && func.apply( this ) ) ? this : ( !func ? this.length : this ); | |
}; |
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
.ui-ellipsis { | |
white-space: nowrap; | |
overflow: hidden; | |
} |
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
/* | |
* jQuery UI Ellipsis | |
* | |
* @Author Richard Willis | |
* @Url http://github.com/badsyntax/jquery-plugins/tree/master/ellipsis/ | |
* @Depends | |
* jquery.ui.core.js | |
* jquery.ui.widget.js | |
* | |
*/ |
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
if ( $('#myelement').exists() ) { | |
alert('element exists!'); | |
} |
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
// delegate a list item mouseenter event to a list | |
function mouseenter( event ){ | |
$( event.target ).addClass( 'mouseenter' ); | |
} | |
$('ul').delegate( 'li', 'mouseenter', mouseenter ); | |
// trigger the first list items delegated event | |
$('ul').find('li:first').each(function(){ |
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
// usage: var size = $.size( selectorOrObject ); | |
// code borrowed from: http://stackoverflow.com/questions/5223/length-of-javascript-associative-array | |
$.size = function(obj){ | |
if ( typeof obj === 'object' ) { | |
var size = 0, key; | |
for (key in obj) { |
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
IFS=$'\n';for f in $(find ~/Library/Application\ Support/Firefox/Profiles|grep userContent);do echo '#recommended_users {display:none !important;}'>>$(dirname $f)/userContent.css;done;echo Restart firefox |