Skip to content

Instantly share code, notes, and snippets.

View Satyam's full-sized avatar

Daniel Barreiro Satyam

  • Sitges, Barcelona, Spain
View GitHub Profile
@Satyam
Satyam / sample.html
Created September 17, 2011 14:11
Processing data using JSON Schema and DataTypes
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>JSON Schema and DataTypes</title>
<style>
td , th , table {
border: thin solid silver;
}
td , th {
@Satyam
Satyam / gist:1498249
Created December 19, 2011 18:18
Patch for WidgetButtons
YUI.add('widget-buttons-patch', function (Y) {
"use strict";
var WB = Y.WidgetButtons,
WBp = WB.prototype,
BUTTON = 'button',
getCN = Y.ClassNameManager.getClassName,
DISABLED = getCN(BUTTON, 'disabled'),
DEFAULT = getCN(BUTTON, 'default');
@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)
*/
@Satyam
Satyam / gist:1605872
Created January 13, 2012 12:28
My Y.Button proposal
<!DOCTYPE html>
<html>
<head>
<!-- Better yet, see: https://gist.github.com/2044488 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Button test</title>
<script type="text/javascript" src="http://yui.yahooapis.com/3.5.0pr1/build/yui/yui.js"></script>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?3.5.0pr1/build/cssreset/reset-min.css&3.5.0pr1/build/cssfonts/fonts-min.css&3.5.0pr1/build/cssbase/base-min.css&3.5.0pr1/build/cssgrids/grids-min.css" />
@Satyam
Satyam / Y.Button
Created March 15, 2012 14:32
My Y.Button plugin proposal, without modifying Attribute
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Button test</title>
<script type="text/javascript" src="http://yui.yahooapis.com/3.5.0pr1/build/yui/yui.js"></script>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?3.5.0pr1/build/cssreset/reset-min.css&3.5.0pr1/build/cssfonts/fonts-min.css&3.5.0pr1/build/cssbase/base-min.css&3.5.0pr1/build/cssgrids/grids-min.css" />
<link rel="stylesheet" type="text/css" href="cssbutton.css" />
</head>
@Satyam
Satyam / gist:2601422
Created May 5, 2012 10:36
TreeView Editor patch
(function () {
var TV = YAHOO.widget.TreeView,
TVProt = TV.prototype,
Event = YAHOO.util.Event,
Dom = YAHOO.util.Dom;
TVProt.draw = TVProt.render = function () {
var html = this.root.getHtml(),
el = this.getEl(),
ed = TV.editorData;
@Satyam
Satyam / gist:2828145
Created May 29, 2012 12:28
ac.done patch
ac.done = (function (original) {
return function (data, opts) {
opts = opts || {};
var instance = ac.command.instance,
config = instance.config || {},
action = instance.action,
children = config.children,
params = ac.params.getAll(),
me = this,
childOpts = opts.children || {};
@Satyam
Satyam / gist:2828156
Created May 29, 2012 12:30
ac.done usage example
model.read(idPersona, function(err, rows) {
if (err) {
ac.error(err);
return;
}
ac.done({
debug:Y.JSON.stringify(rows),
persona:rows
}, {params:{route: {idDireccion:rows[0].idDireccion}}});
@Satyam
Satyam / gist:2988409
Created June 25, 2012 12:52
Person.View.js
YUI.add('personView',function(Y){
Y.PersonView = Y.Base.create(
'personView',
Y.View,
[],
{
initializer:function(){
this.model = this.get('model');
},
render:function(){
@Satyam
Satyam / gist:2989468
Created June 25, 2012 16:02
template server
var express = require('express'),
fs = require('fs'),
path = require('path'),
server = express.createServer(),
rexpTEMPLATE = /TEMPLATES\s*=\s*\{\s*\}/,
rexpJs = /\.js$/i,
rexpHtml = /\.html$/i,
VIEWS = '/scripts/views/',
MODELS = '/scripts/models/';