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
// Helper method for Prototype to loop over a collection of elements | |
// and run a method on existing elements within the dom | |
Object.extend(Array.prototype, { | |
each_element_invoke: function(method) { | |
var args = $A(arguments).slice(1); | |
return this.map(function(element) { | |
return element && element[method].apply(element, args); | |
}); | |
} | |
}); |
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
alias battery='ioreg -w0 -l | grep Capacity | cut -d " " -f 17-50' |
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
alias svnaddall='svn status | grep "^\?" | awk "{print \$2}" | xargs svn add' |
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
alias flushdns="dscacheutil -flushcache" |
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
# environment variables | |
export PATH=/usr/local/bin:$PATH | |
export PATH="$HOME/bin:$PATH" | |
export PATH=/usr/local/git/bin:$PATH | |
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH" | |
export MANPATH=/usr/local/git/man:$MANPATH | |
export EDITOR="mate -w" | |
export SVN_EDITOR="mate -w" | |
# aliases |
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).ajaxSend(function(event, request, settings) { | |
// pass authenticity token with requests | |
// requires global AUTH_TOKEN var to be set by Rails: | |
// <%= javascript_tag "var AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %> | |
settings.data = (settings.data ? settings.data + "&" : "") + "authenticity_token=" + encodeURIComponent( AUTH_TOKEN ); | |
// make respond_to jump to the js block | |
if ( settings.dataType == 'html' ) request.setRequestHeader("Accept", "text/javascript"); | |
}); |
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
Element.Methods.update_old = Element.Methods.update; | |
Element.Methods.update = function() { | |
Element.Methods.update_old.apply(this, arguments); | |
$.livequery.run(); | |
}; | |
Ajax.Responders.register({ | |
onComplete: function() { $.livequery.run(); } | |
}); |
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
// requires nightly version of jQuery b/c it uses the add special event hook | |
// more about special event hooks: http://brandonaaron.net/blog/2009/06/4/jquery-edge-new-special-event-hooks | |
(function( $ ) { | |
$.event.special.hashchange = { | |
setup: function( data, namespaces ) { | |
if ( 'onhashchange' in window ) { | |
// sweet, native support... short-circuit | |
return false; | |
} | |
// onhashchange is not natively supported ... work around it :( |
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
/* | |
* Sugar for type detection working across frames and browsers ;) | |
* | |
* Detected types | |
* | |
* 'arguments', 'array', 'boolean', 'date', 'document', 'element', 'error', 'fragment', | |
* 'function', 'nodelist', 'null', 'number', 'object', 'regexp', 'string', 'textnode', | |
* 'undefined', 'window' | |
* | |
* Copyright (c) 2009 Daniel Steigerwald (http://daniel.steigerwald.cz), Mit Style License |
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
/* | |
* Sugar for type detection working across frames and browsers ;) | |
* | |
* Detected types | |
* | |
* 'arguments', 'array', 'boolean', 'date', 'document', 'element', 'error', 'fragment', | |
* 'function', 'nodelist', 'null', 'number', 'object', 'regexp', 'string', 'textnode', | |
* 'undefined', 'window' | |
* | |
* Copyright (c) 2009 Daniel Steigerwald (http://daniel.steigerwald.cz), Mit Style License |
OlderNewer