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
/* | |
var p = CObject.init().setLeft(100); | |
p.left; // undefined | |
p.getLeft(); 100 | |
*/ | |
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
var serializeElements = (function(){ | |
function isSuccessful(element) { | |
// http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2 | |
return ( | |
!element.disabled && // should not be disabled | |
element.name && // should have a name | |
!'^file|reset$'.test(element.type) && // should not be of `file` or `reset` types | |
Element.getValue(element) != null // should have a non-null value | |
); |
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
Class.Methods.createAccessors = function() { | |
var accessors = $A(arguments), proto = this.prototype; | |
if (!accessors.length) { | |
accessors = Object.keys(proto).reject(function(prop) { | |
return Object.isFunction(proto[prop]); | |
}); | |
}; | |
accessors.each(function(prop){ | |
proto['get' + prop.capitalize()] = function(){ | |
return this[prop]; |
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
;jQuery.fn.extend({ | |
// Andrea Giammarchi - Mit Style Licence - V0.2 | |
If: (jQuery.fn.ElseIf = function(fn){ | |
var __If__ = this.__If__ || this, | |
$ = __If__.filter(fn); | |
$.__If__ = __If__.filter(function(){return !~$.index(this)}); | |
return $; | |
}), | |
Else:function(){ | |
return this.__If__; |
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
var sourceIndex = (function(){ | |
var root = document.documentElement, | |
indexOf = Array.prototype.indexOf; | |
if ('sourceIndex' in root) { | |
if (root.sourceIndex === 0) { // Opera | |
return function(e) { | |
return e.sourceIndex + 1; | |
} | |
} | |
else if (root.sourceIndex === 1) { // IE |
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
// Only one closure is created here - i.e. when one of these functions is returned from within anonymous-outer one. | |
// That returned function will be part of the closure and have access to [[Scope]] of anonymous-outer one. | |
// The returned function is the only Function object that's being created. | |
// Function expressions from other blocks are never reached and so are never created | |
var globalEval = (function(){ | |
if (window.eval) { | |
return function(s){ window.eval(s) } | |
} | |
else if (window.execScript) { |
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
~/dev/tshirts$ rake | |
(in /Users/juriy/dev/tshirts) | |
config.gem: Unpacked gem pg-0.7.9.2008.10.13 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this. | |
config.gem: Unpacked gem rake-0.8.3 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this. | |
config.gem: Unpacked gem sqlite3-ruby-1.2.2 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this. | |
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -Ilib:test "/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb" "test/functional/assets_controller_test.rb" "test/functional/items_controller_test.rb" "test/functional/pages_controller_test.rb" "test/functional/sessions_controller_test.rb" "test/functional/users_controller_test.rb" | |
config.gem: Unpacked gem pg-0.7.9.2008.10.13 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this. | |
config.gem: Unpacked gem rake-0.8.3 in vendor/gems has no specification file. Run 'rake |
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
var isNumber = (function(){ | |
var toString = Object.prototype.toString; | |
return function(o) { | |
return toString.call(o) === '[object Number]'; | |
} | |
})(); | |
function isNumber2(o) { | |
try { | |
return typeof (o && o.valueOf()) == 'number'; |
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
var wsp = '(\\u0020|\\u0009|\\u000D|\\u000A)'; | |
var digit = '\\d'; | |
var digit_sequence = '(' + digit + '+' + ')'; | |
var sign = '[-+]'; | |
var exponent = '[eE]' + sign + '?' + digit_sequence; | |
var fractional_constant = | |
'(' + | |
digit_sequence + '?' + '\\.' + digit_sequence + | |
'|' + |
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
/* | |
transform-list: | |
wsp* transforms? wsp* | |
transforms: | |
transform | |
| transform comma-wsp+ transforms | |
transform: | |
matrix | |
| translate | |
| scale |