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() { | |
var controlPanel = (<r><![CDATA[ | |
<div id='controlpanel'> | |
<h1>First</h1> | |
<ul> | |
<li>HappyPath</li> | |
</ul> | |
<h1>Second</h1> |
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
// | |
// Define this.constructor.name so we can introspect an object for it's constructor's name | |
// (equivalent to the 'Class' name if there were classes...) | |
// This is necessary because IE does not define this constructor property but FF does. | |
// | |
Function.prototype.getName = function() { | |
var matches = this.toString().match(/function\s+([\w\$]+)\s*\(/); | |
return matches ? matches[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
IO.read("testfile") # reads testfile in as a string | |
IO.readlines("testfile") # reads testfile in as an array |
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
IO.read("testfile") # reads testfile in as a string | |
IO.readlines("testfile") # reads testfile in as an array |
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
String.prototype.reverse = function() { | |
return this.split("").reverse().join(""); | |
} | |
Number.prototype.formatAsCurrency = function() { | |
return this.toString() | |
.replace(/^(\d)$/, "00$1") // pad 1 digit | |
.replace(/^(\d{2})$/, "0$1") // pad 2 digits | |
.reverse() | |
.replace(/(\d{2}(?=\d))/, "$1.") // place decimal point |
NewerOlder