Skip to content

Instantly share code, notes, and snippets.

Object.defineProperty(Object.prototype, "extend", {value: function (obj) {
obj.__proto__ = this;
return obj;
}});
Object.defineProperty(Object.prototype, "new", {value: function () {
var obj = Object.create(this);
if (obj.initialize) obj.initialize.apply(obj, arguments);
return obj;
}});
// Blog post: http://brandonaaron.net/blog/2010/03/4/event-delegation-with-jquery
// Try this instead of the above (didn't test)
$('#container').delegate('a.top', 'click', function(e) {
log( $(this).text() + ' clicked1');
return false;
});
.selector {
/* styles that change how the element acts/positons */
position: relative; top: 0; left: 0; display: block; float: left; z-index: 1; overflow: hidden;
/* styles that change its dimensions */
margin: 0; border: 1px solid #000; padding: 0; width: 0; height: 0;
/* sstyles that change its appearance */
background: #777 url(/images/image.png) 0 0 no-repeat; color: #000;
/*
* 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
/*
* 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
// 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 :(
# 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