Skip to content

Instantly share code, notes, and snippets.

View ericf's full-sized avatar

Eric Ferraiuolo ericf

View GitHub Profile
@tivac
tivac / gist:1068126
Created July 6, 2011 19:30
YUI 3.3.0 -> 3.4.0 HEAD Notes
@lsmith
lsmith / gist:1097943
Created July 21, 2011 19:07
Make Y.DataTable instantiable, and an extension point for feature extension classes
// Right now, Y.DataTable is only a namespace. But I want to be able to say new Y.DataTable({...});
// We can do it. We have the technology.
// Step 1. Capture all the properties of the Y.DataTable namespace
// Y.merge creates a shallow copy of an object, and since Y.DataTable is just a namespace object,
// this works like a champ. You could now say new Stuff.Base({...}) to create a DataTable.Base
// instance.
var Stuff = Y.merge(Y.DataTable);
// Step 2. Replace the Y.DataTable namespace with a working DataTable.Base subclass
RED="\[\033[1;31m\]"
YELLOW="\[\033[1;33m\]"
GREEN="\[\033[1;32m\]"
BLUE="\[\033[1;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[1;37m\]"
COLOR_NONE="\[\e[0m\]"
@sdesai
sdesai / gist:1386836
Created November 22, 2011 20:28
WidgetStringRenderer

USE CASES

  • Render widgets on NodeJS, where DOM is absent.
  • Optimize rendering of Widgets at scale (1000s of TreeViewNodes).

GOAL

  • Avoid all Node references from Widget through the end of renderUI().
  • bindUI()/syncUI() will still have Node references (to bind events and incrementally update DOM).
@Satyam
Satyam / gist:1547708
Created January 1, 2012 16:28
App plugin
/*
App plugins can be loaded over an instance of App by setting a route with a wildcard path
such as:
{
path:'/:app/*',
callback: 'dispatchApp'
}
where the app param is the module name of the plugin,
which should have its entry in the YUI config file (unless loaded by some other means)
*/
@rgrove
rgrove / app.js
Created February 24, 2012 20:57
Simple Handlebars view engine for Express
var express = require('express'),
app = express.createServer();
app.configure(function () {
// Use our custom Handlebars-based view engine as the default.
app.register('.handlebars', require('./view'));
app.set('view engine', 'handlebars');
// ...
});
@rgrove
rgrove / .jshint.json
Created March 7, 2012 19:09
JSHint build file for SublimeText 2
{
// enforcing options (true means potentially more warnings)
"adsafe": false, // true if ADsafe rules should be enforced. See http://www.ADsafe.org/
"bitwise": true, // true if bitwise operators should not be allowed
"curly": true, // true if curly braces should be required around blocks in loops and conditionals
"eqeqeq": true, // true if === should be required (for ALL equality comparisons)
"forin": false, // true if unfiltered 'for in' statements should be forbidden
"immed": true, // true if immediate function invocations must be wrapped in parens
"newcap": true, // true if Initial Caps must be used with constructor functions
{
"name": "YUIDoc",
"description": "YUIDoc documentation tool written in Javascript",
"version": "0.1.0",
"url": "http://yuilibrary.com/projects/yuidoc",
"options": {
"external": {
"data": "http://yuilibrary.com/yui/docs/api/data.json"
},
"linkNatives": "true",
@lsmith
lsmith / gist:2375130
Created April 13, 2012 08:37
Ye Olde brainstorm about IO API

Data normalization API proposal

Data API normalization/centralization in three layers

  1. transport layer

  2. transaction layer

  3. encapsulated configuration layer (aka Resource/DataSource)

  4. Transport layer

@tivac
tivac / _README.md
Last active October 4, 2015 11:38
Parent/Child Y.View extension

Parent/Child Y.Views

As I worked with Y.App it became clear that while Y.View is a great abstraction it would be easy to overwhelm a single instance with way too much functionality. This is my attempt to solve that issue by allowing multiple child views to be attached to a single parent view via an extension.

Usage

The extension is mixed into the parent view like any other extension using Y.Base.create.

var Parent = Y.Base.create("view", Y.View, [