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
insertNodeAtSelection : function(win, insertNode, _container, _pos) | |
{ | |
// get current selection | |
var sel = this._getSelection(); var doc = this._getDoc(); | |
// get the first range of the selection (there's almost always only | |
// one range) | |
var range = sel.getRangeAt(0); | |
// deselect everything |
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
- simple | |
- public over private | |
- personal vanity | |
- internet is global | |
- permalinks | |
- one important item per page | |
- don't break the browser | |
- don't wanker in technology | |
- a medium is not a grande | |
- break convention for your users |
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
exports.example = function(a, b) { | |
['This is a function foo which is supposed to do something.\n\ | |
But the best thing is that it has nice documentation in it.\ | |
@param {String} a first argument\ | |
@param {String} b second argument\ | |
@returns {String} Concatinated string literal'] | |
return [a, b].join(" "); | |
}; |
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
/** | |
* Converts relative UTF8 characters (C-style) to | |
* JavaScript friendly utf chars | |
**/ | |
var str = ""; | |
var relativeTo = 0x300; | |
[0x90,0x99,0xaa,0xaf,0xb9,0xca,0x7e,0x87, | |
0x84,0xc4,0xbe,0xad,0xb6,0x85,0xb5,0x8a, | |
0xc2,0xb8,0xbb,0xb3,0xbd,0xba,0xc7,0xcb, |
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
YUI({ debug: true, | |
filter: 'debug', | |
logInclude: { event: true, attribute: true }, | |
timeout: 10000 }).use("node", "attribute", "dd-drag", "dd-drop", "dd-constrain", function(Y) { | |
Y.Node.prototype.toString = function() { … } // This works | |
Y.DOM.hasClass = function(node, className) { … } // This doesn't | |
// Here goes my own code |
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
function Test(cfg) { | |
Test.superclass.constructor.apply(this, arguments); | |
this.initializer(cfg); | |
}; | |
Y.extend(Test, Y.Base, { | |
initializer: function(config) { | |
this.addAttrs({ | |
items: { | |
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
var hex2rgb = function(color) { | |
var r = color.match(/^#(([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2}))$/i); | |
if (!r) return [0, 0, 0, 255]; | |
return [parseInt(r[2], 16), | |
parseInt(r[3], 16), | |
parseInt(r[4], 16), 255]; | |
} |
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 Class1 = function() { | |
Class1.superclass.constructor.call(this, config); | |
} | |
Class1.NAME = "class1"; | |
Class1.ATTRS = { | |
//Several Attributes here | |
} | |
Y.extend(Class1, Y.Base, { |
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
/* | |
AST tree generated from parsing the following Design By Numbers program: | |
paper 30 | |
repeat A 0 300 | |
{ | |
pen 50 | |
line 0 55 100 55 |
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
YUI({ | |
debug: true, | |
groups: { | |
app: { | |
combine: false, | |
base: "src/", | |
modules: { | |
module1: { | |
path: "module1.js", | |
requires: ["module2"] |
OlderNewer