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
| ### Created by Thomas Aylott - http://subtleGradient.com | |
| # Requires you to have Parallels or VMWare with Coherence or whatever | |
| # Rename your explorer.app (or whatever) to "Internet Explorer 6.app" | |
| osascript -e 'activate application "Internet Explorer 6"' -e 'tell application "System Events" to key code 96 -- F5 key' -e 'delay 1' &>/dev/null | |
| echo "Internet Explorer 6 Refreshing…" |
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
| /* | |
| JavaScript Function.prototype.remember | |
| Copyright (c) 2009 Thomas Aylott (SubtleGradient.com) | |
| MIT License | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is |
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
| Number.prototype.divideToArray = function(divideBy,forceInt){ | |
| var array = []; | |
| var remainder = this % divideBy; | |
| var result = this / divideBy; | |
| if (forceInt) | |
| result = (this - remainder) / divideBy; | |
| for (var i = divideBy; i; i--) | |
| array.push(result); |
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
| Function.safeTry = (function(){ | |
| var currentHandler; | |
| var dispatchFakeEvent; | |
| var currentHandlerResult; | |
| if (document.addEventListener){ | |
| document.addEventListener("fakeEvents", function(){ | |
| currentHandler(); // execute the callback | |
| }, false); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| // -*- Mode: Javascript; tab-width: 4; -*- | |
| /* | |
| --- | |
| privides: [String.bound, String.prototype.bind] | |
| description: Lets you bind to a method that doesn't exist yet, and then swap out methods without re-wiring all your codez | |
| author: Thomas Aylott <subtlegradient.com> | |
| copyright: 2009 Thomas Aylott | |
| license: MIT Style | |
| ... | |
| */ |
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
| // -*- Mode: MooTools Javascript; tab-width: 4; -*- | |
| /* | |
| --- | |
| provides: delayUnless | |
| author: Thomas Aylott <subtlegradient.com> | |
| copyright: 2009 Thomas Aylott | |
| license: MIT Style | |
| requires: [MooTools, Element, Events] | |
| ... | |
| */ |
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
| // Basic closure, assumes window === this | |
| (function(){ | |
| // require stuff here | |
| })(); | |
| // Custom closure, this === anything you want | |
| (function(){ | |
| // require stuff here |
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
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | |
| <title>Benchmark prototype Method vs Object Property Fn</title> | |
| <script type="text/javascript" src="JSLitmus.js"></script> | |
| <script type="text/javascript"> |
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
| var MyClass = new Class({ | |
| initialize: function(){ | |
| this.foo = /*<b compat=1.2>*/'123' && /*</b>*/'345'; | |
| /*<b compat=1.2>*/this.foo = '123';/*</b>*/ | |
| this.foo = '345'; | |
| }, | |
| //<b fix=ie6> | |
| method: function(/*<b compat=1.2>*/arg12, /*</b>*/arg20){ | |