Skip to content

Instantly share code, notes, and snippets.

# YUI 3 Cookbook Table of Contents
## YUI BASICS
### Put YUI on the Page
* Load YUI
* Load debug builds
* Load locally hosted builds
* Load a YUI 2 widget
goer@lowerbicycle-lm /tmp/yeti $ git init
Initialized empty Git repository in /private/tmp/yeti/.git/
goer@lowerbicycle-lm /tmp/yeti $ git pull git://github.com/reid/yeti
remote: Counting objects: 1399, done.
remote: Compressing objects: 100% (643/643), done.
remote: Total 1399 (delta 813), reused 1253 (delta 720)
Receiving objects: 100% (1399/1399), 279.36 KiB | 208 KiB/s, done.
Resolving deltas: 100% (813/813), done.
From git://github.com/reid/yeti
* branch HEAD -> FETCH_HEAD
@evangoer
evangoer / gist:1161628
Created August 22, 2011 03:58 — forked from juandopazo/gist:1161269
YUI Boilerplate - more minimal
<!DOCTYPE html>
<title>My App</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/combo?3.4.0/build/cssreset/cssreset-min.css&
3.4.0/build/cssfonts/cssfonts-min.css&3.4.0/build/cssgrids/cssgrids-min.css">
<link rel="stylesheet" href="styles.css">
<script src="http://yui.yahooapis.com/3.4.0/build/yui/yui-min.js"></script>
<script>
YUI().use("event-base", function (Y) {
// specify "node-base", "event-base", or whichever modules your app requires
@evangoer
evangoer / gist:1250052
Created September 29, 2011 05:37
A more sugary way to create Y.Base derived objects.
/* What do we really care about when creating a Base-derived object?
1. the object we are deriving from
2. string name
3. properties and methods
4. attributes
Goals: simpler method with fewer args & less nesting. Simplify
adding attributes. No need for empty [] hack as with Y.Base.create() */
Y.Example = Y.Model.derive('example-model', {
// prototype methods and properties here
hello: function () {
@evangoer
evangoer / gist:1389107
Created November 23, 2011 16:21
A dirt-simple, least-common-denominator web service used for the Y.io() examples in the YUI 3 Cookbook.
<?php
header('Content-type: application/json');
$response = array();
if (isset($_GET['library']) && $_GET['library'] === 'YUI') {
$response['advice'] = 'YES';
$response['reason'] = "YUI doesn't eat your soul from the inside.";
}
else {
$response['advice'] = 'NO';
@evangoer
evangoer / gist:3174385
Created July 25, 2012 04:24
Feedback for Open Tech School: JS Beginners Day 1

Page 1

The language of the material is friendly and low-key -- this is great.

Open the console

For students who don't even yet know HTML or CSS, I like your general approach a lot:

Improvements to New YUI Blog Theme

Objective

  • Wrong copyright. Should be: "© 2012 Yahoo! Inc." not: "© 2012 YUI Blog"
  • Search page is unusable: http://cl.ly/IiYS
  • Linen texture should only be at the lowest layer of the design (I don't care that iOS uses it for the notification sheets, they did it wrong :)
  • Home page's heading alignments are off:
@evangoer
evangoer / gist:3383213
Created August 17, 2012 22:16
Rough draft YUI Getting Started Guide

Getting Started with YUI

Welcome to the YUI library! This tutorial contains everything you need to get up and running quickly with YUI. If you've never used YUI before, but you perhaps have a little experience with plain JavaScript or JavaScript frameworks, read onward.

Note that if you have experience with jQuery, it is a great idea to read or at least skim through the JS Rosetta Stone, which demonstrates how common jQuery and YUI idioms map to each other. The good news is that in the areas where YUI and jQuery overlap, you'll find that it is not too difficult to translate back and forth between the two.

Loading SimpleYUI

The easiest way to get started with YUI is to use SimpleYUI, a convenient package for working with DOM nodes, events, UI effects, and AJAX.

I wrote this for a colleague at work, but I thought I'd share it here for those that are confused as to the role of a build tool. To those that have not spent years working with various build tools, it may be tempting to find one that is written in the language you are using (i.e. Phing, Ant, Rake, and Grunt come to mind) or perhaps you are easily persuaded by things that have a lot of features (Gradle immediately comes to mind).

To be honest, build tools are just glorified shell script wrappers. Some more complex than others. At the end of the day, a build tool should do four things to be useful and not get in the way:

  1. Run your scripting tasks (where less abstraction layers are better than more).
  2. Allow you to define dependencies (like, always run the task to delete all of the build artifacts before running the task that generates code coverage).
  3. Give you a simple way (preferably without needing to install a fancy GUI/IDE) to look at what build steps will be run without running them.
  4. Issue a s
@evangoer
evangoer / readme.md
Last active December 15, 2015 06:19 — forked from max-mapper/readme.md