Skip to content

Instantly share code, notes, and snippets.

View triptych's full-sized avatar
💭
Making web things

Andrew Wooldridge triptych

💭
Making web things
View GitHub Profile
@triptych
triptych / desc.txt
Created April 21, 2011 16:50
demo for friend
this is a demo
<#-- This is a FreeMarker template -->
<#-- You can change the contents of the license inserted into
# each template by opening Tools | Templates and editing
# Licenses | Default License -->
<#assign licenseFirst = "/* ">
<#assign licensePrefix = " * ">
<#assign licenseLast = " */">
<#include "../Licenses/license-${project.license}.txt">
/**
@triptych
triptych / draggable-background.js
Created April 28, 2011 09:06 — forked from eculver/draggable-background.js
draggable-background.js YUI widget
/**
* Draggable Background Widget
*
* A widget that will use a specified image and dimensions to
* produce a draggable, window-like view of an image.
*
* Example usage:
*
* YUI.use('widget-draggable-background', function(Y) {
* var widget = new Y.WD.Widget.DraggableBackground({
@triptych
triptych / jquery-yui-widget.md
Created April 28, 2011 09:07
A comparison of the jQuery UI Widget Factory and the YUI 3 Widget class.

jQuery

Widget foo.js

(function($, undefined){
    
    $.widget('ui.foo', {
        
@triptych
triptych / jquery-yui-widget.md
Created April 29, 2011 17:58 — forked from apipkin/jquery-yui-widget.md
A comparison of the jQuery UI Widget Factory and the YUI 3 Widget class.

jQuery

Widget foo.js

(function($, undefined){
    
    $.widget('ui.foo', {
        
        options: {
@triptych
triptych / basic.html
Created April 29, 2011 22:22
Base YUI Widget
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/yui/3.3.0/build/yui/yui.js"></script>
</head>
<body>
<script>
YUI({
modules: {
@triptych
triptych / gist:954411
Created May 3, 2011 22:32 — forked from brettstimmerman/gist:943498
Load a YUI Gallery module locally for testing.
/**
* Load a YUI Gallery module locally for testing.
*
* Assumes you've built your module with ant and have a local copy of the
* yui3-gallery repo.
*
* This will override Loader's Gallery configuration. Existing Gallery modules
* will load locally, and your new module should load locally as well.
*
* Props to Caridy for helping piece this together.
@triptych
triptych / js_sandbox.js
Created May 3, 2011 22:43
load a version of YUI independent of whatever js is loaded in a page without having conflicts.
(function(d){
var iframe = d.body.appendChild(d.createElement('iframe')),
doc = iframe.contentWindow.document;
iframe.src = 'javascript:false;';
iframe.style.cssText = "position:absolute;width:1px;height:1px;left:-9999px;";
doc.open().write('<body onload="YUI_config={win:window.parent,doc:window.parent.document};var d=document;d.getElementsByTagName(\'head\')[0].appendChild(d.createElement(\'script\')).src=\'some.js\'">');
doc.close();
@triptych
triptych / lipsum.html
Created May 5, 2011 18:25 — forked from apipkin/lipsum.html
Generic HTML layout for quick starts to development.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Lorem Ipsum Dolor Sit</title>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.2.0/build/cssreset/reset-min.css">
</head>
<body>
<div id="pageWrapper"><div id="page">
_styleIframe: function () {
var optimizedName = 'setAttribute',
iframe = this.get('iframe'); // TODO: this have to be in a lang bundle
Y.each (['border', 'frameBorder', 'marginWidth', 'marginHeight', 'leftMargin', 'topMargin'], function (name) {
iframe[optimizedName](name, 0);
});
// this is equivalent to: iframe.setAttribute('foo', 'bar').setAttribute('more', 'chaining'); but
// since we don't have setAttributes, we do this crazy stuff to gain some bytes with the compressor.
iframe[optimizedName]('allowTransparency', "true");
}