Skip to content

Instantly share code, notes, and snippets.

var MS = function(config) {
// Since you won't be mixing in Y.ModelSync.REST
// as a separate extensions
Y.ModelSync.REST.apply(this, arguments);
};
Y.mix(MS, Y.ModelSync.REST); // Mainly to pull over ModelSync.REST.ATTRS, but maybe other stuff also.
Y.mix(MS.prototype, Y.ModelSync.REST.prototype);
var MS = function(config) {
/* Whatever constructor stuff you wanted.
No point chaining, since there's no inheritance,
and Y.ModelSync.REST's constructor and initializer
will get called by the infrastructure
*/
};
YUI.add("transaction-integration-tests", function(Y, module) {
var WAIT_TIMEOUT = Y.BridgeIntegrationTests.WAIT_TIMEOUT,
DB_HANDLE_ID,
DB_INSTANCE;
Y.BridgeIntegrationTests.add(new Y.Test.Case({
id : module,
var EmptyWidget = Y.Base.create('emptyWidget', Y.Widget, [], {
_fakeProperty: null, // Not actually required, but since you had it in your orig. code.
_fakeObject: null, // Not actually required, but since you had it in your orig. code.
initializer : function() {
this._fakeProperty = {};
this._fakeObject = {};
},
@sdesai
sdesai / gist:3021149
Created June 29, 2012 22:38
Simple Query Syntax To Try and Normalize SQL/noSQL selection criteria

EXPRESSIONS

  1. key : primitive ({name:"foobar"})

  2. key : regex ({name:/^foo.*?/"})

  3. key : { condition : primitive } ({age: {gt: 21}})

  4. key : function(key, val) { returns true/false } (would need to be post-process?)

  5. key : condition(val) ({a:gt(10)})

    • Occurred to me this might be better than 3. above.
    • Looks nicer/More Flexible/Customizable
@sdesai
sdesai / gist:2956069
Created June 19, 2012 19:32
Inlining Mixes
See: https://github.com/sdesai/yui3/commit/29f63996f8b69a7bb6d2e27f4d350c320998c0b2#commitcomment-1474176
Mixes Not-Inlined
-----------------
Chrome 19:
Finished.
new Base() x 8,147 ops/sec ±2.72% (40 runs sampled)
Fire With Payload - 10 listeners x 65,711 ops/sec ±0.37% (57 runs sampled)
@sdesai
sdesai / gist:2879339
Created June 6, 2012 01:40
20 Attribute sets
suite.add('MyBase with 20 varied attributes, all firing events', function () {
var b = new MyBase20();
b.set("attr1", "Bar");
b.set("attr2", "Foo");
b.set("attr3", "Foo");
b.set("attr4", "Foo");
b.set("attr5", "Foo");
b.set("attr6", "Foo");
b.set("attr7", "Foo");
b.set("attr8", "Foo");
@sdesai
sdesai / gist:2222506
Created March 28, 2012 00:53
Y properties, for bug 2532027
Y: Object
Array: function
Env: Object
Features: Object
Get: Object
Intl: Object
Lang: Object
Loader: function
Object: function
Queue: function
@sdesai
sdesai / gist:1453325
Created December 9, 2011 21:15
SV Roadmap

Lingering Cleanup

a) Clean up multi-axis support [ being able to scroll horizontally and vertically at the same time ]. It's currently supported, but doesn't hold up cleanly all the way through the API.

b) Clean up scrollbar implementation - right now the scrollbar is 3 separate elements. I remember looking into it and thinking we could do it with just 1 piece.

c) Just a general high level pass of the API.

d) Clean up the ScrollView-List plugin - it doesn't really solve the real problem it was mean to solve - laying out horizontal LIs. It's API could also use some cleanup.

@sdesai
sdesai / gist:1436402
Created December 6, 2011 02:19
Tree Example with WidgetHTMLRenderer
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script src="../../../../build/yui/yui.js"></script>
<script src="../../../../build/widget-htmlrenderer/widget-htmlrenderer.js"></script>
<style>
.yui3-parentwidget {
border:1px solid black;