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
// ensure your application uses this YUI instance! | |
var Y = YUI().use(function (Y) { | |
var thirdPartyModules, moduleTest, win, cfg; | |
function emptyFunction() {} | |
function addMatches(match) { // match looks like ",facebook," | |
var module = match.substring(1, match.length - 1); // e.g. "facebook" | |
YUI.add(module, emptyFunction); | |
} |
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>Can you replicate this using <object />?</title> | |
<style> | |
#image { | |
background-image: url(scalable-image.svg); | |
background-position: center top; | |
background-repeat: no-repeat; | |
background-size: contain; | |
height: 100%; |
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
/*global YUI*/ | |
(function () { | |
var LOADED = ":loaded", | |
FAILED = " failed to load", | |
CUSTOM = ["event-custom"]; | |
YUI().Array.each([ | |
{ | |
loading: false, | |
name: "facebook", |
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
@implementation MyAppDelegate | |
/** | |
* Generates a Universally Unique Identifier based on the time and | |
* hardware details of a device. CFUUIDCreate is the recommended | |
* way by Apple to generate an ID now that UIDevice-uniqueIdentifier | |
* is deprecated. | |
* | |
* Props: http://www.cocoabuilder.com/archive/cocoa/217665-how-to-create-guid.html#217668 | |
*/ |
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
// | |
// NFLURLConnectionLoader.h | |
// | |
// Created by Cannon, Ryan on 10/13/11. | |
// | |
#import <Foundation/Foundation.h> | |
@interface NFLURLConnectionLoader : NSObject { | |
} |
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
(function (dataTableExt) { | |
var TIME_RE = /^(\d+:)*(\d+.\d+)$/, | |
timeToSeconds = function (sTime) { | |
for (var i = aDaysHoursMin.length, | |
n = 1, | |
mDaysHoursMin = sTime.match(TIME_RE), | |
sDaysHoursMin = mDaysHoursMin[1], | |
aDaysHoursMin = sDaysHoursMin.substr(0, sDaysHoursMin.length - 1).split(":"), | |
nTime = parseFloat(mDaysHoursMin[2], 10); |
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
/*global YUI*/ | |
YUI.add("widget-functions", function (Y) { | |
"use strict"; | |
var ADD = "addClass" | |
, REM = "removeClass" | |
, BBX = "boundingBox" | |
, GCN = "getClassName" | |
, NV = "newVal" | |
, PV = "prevVal" | |
, AN = "attrName" |
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
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { | |
NSInteger orientation; | |
switch (interfaceOrientation) { | |
case UIInterfaceOrientationPortraitUpsideDown: | |
orientation = 180; | |
break; | |
case UIInterfaceOrientationLandscapeLeft: | |
orientation = -90; |
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
YUI().use("singleton-class", function (Y) { | |
var instance1 = new Y.SingletonClass(), | |
instance2 = new Y.SingletonClass(); | |
Y.log(instance1 === instance2); // true! | |
window.instance1 = instance1; | |
}); | |
YUI().use("singleton-class", function (Y) { |
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
YUI({ | |
modules: { /* define modules here */} | |
}).use("node", function (Y) { | |
function lazyLoadedCallback() { | |
// this is where you do the work after your modules are loaded | |
} | |
Y.once("click", function (event) { |