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
#!/usr/bin/env node | |
var sys = require('sys'), | |
YUI = require('yui3').YUI; | |
YUI().use('node',function(Y){ | |
Y.one('body').append('<div id="ala">ala ma kota</div>'); | |
var ala = Y.one('#ala'); | |
Y.log(ala); | |
document = Y.Browser.document; | |
ala = document.getElementById('ala'); |
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
var async = require('async'); | |
var mongo = require('mongodb'); | |
var Db = mongo.Db, | |
Server = mongo.Server, | |
Connection = mongo.Connection; | |
var db = new Db('local', new Server('127.0.0.1', Connection.DEFAULT_PORT, {})); | |
var collections = ['names', 'fruits']; | |
var retData = {}; |
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
var JSV = require('jsv').JSV; | |
var json, schema; | |
var env = JSV.createEnvironment(); | |
var report = env.validate( | |
json = [{a:1}, {b:1}], | |
schema = {type:'array',items:{type:'object', properties:{a:{type:'number'}}, additionalProperties: false}} | |
); | |
console.log(JSON.stringify(json, null, 4) + JSON.stringify(schema, null, 4)); | |
if (report.errors.length === 0) { | |
console.log("success"); |
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
var express = require('express'), | |
exphbs = require('express3-handlebars'), | |
expyui = require('express-yui'), | |
app = express(); | |
expyui.extend(app); | |
// register file extension | |
app.engine('hbs', exphbs()); | |
app.set('view engine', 'hbs'); |
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
[ | |
{ | |
"settings": [ "master" ], | |
"appPort": "8666", | |
"yui": { | |
"config": { | |
"filter": "raw" | |
} | |
}, | |
"specs": { |
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
var exphbs = require('express3-handlebars'), | |
hbs = exphbs.create(); | |
var context = {data: 'Some girls wander by mistake'}; | |
hbs.loadTemplate('test.hbs', function(err, compile) { | |
if (err) { | |
return console.error(err); | |
} | |
var compiled = compile(context); | |
console.log(compiled); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>YUI Event example</title> | |
<script src="http://yui.yahooapis.com/3.15.0/build/yui/yui-min.js"></script> | |
<style typr="text/css"> | |
#clickable { | |
cursor: pointer; | |
background: #cdcdcd; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>YUI3.16.0/getStyle('background-image') bug - IE8/Firefox 29.0.1</title> | |
<meta charset="utf-8" /> | |
<style type="text/css"> | |
.pick div { | |
background-image: url(rect.png); | |
width: 41px; | |
height: 41px; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Simple widget</title> | |
<meta charset="utf-8" /> | |
<style type="text/css"> | |
</style> | |
</head> | |
<body> | |
<button id="back"><<</button> |