Skip to content

Instantly share code, notes, and snippets.

View derek's full-sized avatar

Derek Gathright derek

View GitHub Profile
@derek
derek / dabblet.css
Created March 2, 2012 01:59
cssbutton.css
/* cssbutton.css */
.yui3-button {
-moz-transition: -moz-box-shadow 0.1s linear 0s;
-moz-user-select: none;
background-color: #E6E6E6;
background-image: -moz-linear-gradient(center top , rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.15) 40%, transparent);
border: medium none;
border-radius: 4px 4px 4px 4px;
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25) inset, 0 2px 0 rgba(255, 255, 255, 0.3) inset, 0 1px 2px rgba(0, 0, 0, 0.15);
color: rgba(0, 0, 0, 0.8);
@derek
derek / gist:1599415
Created January 12, 2012 08:28
YUI Open Hours - Jan 12th, 2012

YUI Open Hours for Jan 12th, 2012

Buttonpalooza!

stupid lolcat .
.
.
.
.
.

@derek
derek / gist:1597168
Created January 11, 2012 22:30
Y.ButtonGroup

Y.ButtonGroup

Problem

I have multiple Y.Button instances that are logically associated and need to be managed as a group.

For example, you may need a radio group, so when one button becomes selected, the others are unselected. Or a checkbox group, which allows you to select multiple buttons and at some point you need to obtain the values of all selected buttons.

Note: A push group is really just a checkbox group, but with Y.Button instances whose types are push as opposed to toggle.

Methods

@derek
derek / gist:1500415
Created December 20, 2011 05:35
YUI ScrollView w/ Mousewheel support
diff --git a/src/scrollview/js/scrollview-base.js b/src/scrollview/js/scrollview-base.js
index 394a75d..e967c97 100644
--- a/src/scrollview/js/scrollview-base.js
+++ b/src/scrollview/js/scrollview-base.js
@@ -15,6 +15,7 @@ var getClassName = Y.ClassNameManager.getClassName,
FLICK = EV_SCROLL_FLICK,
DRAG = "drag",
+ MOUSEWHEEL = "mousewheel",
@derek
derek / index.html
Created December 20, 2011 00:57
scrollview-mousewheel plugin
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<style>
#scrollableParent {
background:#ccc;
}
</style>
@derek
derek / dabblet.css
Created December 16, 2011 00:26 — forked from anonymous/dabblet.css
Untitled
.yui3-button {
/* Structure */
display: inline-block;
*display: inline;
zoom: 1;
font-size: 100%;
margin: 0;
padding: 0 1em;
line-height: normal;
line-height: 2.0;
@derek
derek / gist:1389403
Created November 23, 2011 18:09
YUI 3 Button Proposal

YUI Button

Goal

To introduce a new Button component for YUI 3 that addresses the following user stories

  • "I want buttons on my site to look consistent & attractive."
  • "I want to be able to programmatically control buttons in my application."
  • "I want to my buttons to be intelligent and interact with one another in groups."
  • "I want my application to be able to dynamically generate buttons."
@derek
derek / gist:1017507
Created June 9, 2011 19:24
Beautified Google Doodle for 06/09/11 - Les Paul
(function() {
var g = null,
h;
try {
if (!google.doodle) google.doodle = {};
var j,
m,
o,
p,
r,
@derek
derek / gist:977487
Created May 17, 2011 21:52
jslinux beautified
/*
PC Emulator
Copyright (c) 2011 Fabrice Bellard
Redistribution or commercial use is prohibited without the author's
permission.
*/
"use strict";
var aa;
var ba = [1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1];
var ca = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 1, 2, 3, 4, 5, 6, 7
@derek
derek / gist:967018
Created May 11, 2011 18:34
Beautified Google Doodle for 5/11/11
(function() {
try {
if (!google.doodle) google.doodle = {};
var d = [[307, 48, 88, 89], [307, 48, 89, 89], [307, 48, 91, 89], [305, 49, 93, 89], [305, 50, 93, 88], [305, 50, 93, 88], [306, 52, 92, 86], [305, 53, 93, 84], [305, 54, 94, 83], [306, 54, 93, 83], [307, 54, 92, 83], [307, 54, 92, 83], [308, 54, 90, 83], [308, 54, 90, 83], [306, 53, 91, 84], [306, 53, 91, 84], [308, 53, 90, 84], [308, 53, 90, 84], [305, 53, 92, 84], [305, 52, 92, 85], [306, 52, 91, 85], [308, 51, 88, 87, 1], [308, 50, 88, 88], [308, 49, 88, 88], [307, 49, 89, 88], [307, 50, 89, 87], [308, 51, 89, 86], [307, 54, 90, 83], [307, 57, 90, 80], [306, 58, 92, 79], [306, 58, 92, 79], [305, 60, 92, 77], [302, 61, 95, 76], [302, 63, 95, 74], [302, 51, 96, 86], [302, 66, 98, 71], [304, 67, 96, 69], [301, 63, 96, 74], [301, 58, 93, 79], [291, 52, 94, 85], [288, 50, 71, 88], [285, 43, 76, 95], [285, 37, 70, 101], [281, 29, 55, 109], [278, 20, 58, 119], [278, 20, 55, 119, 1], [277, 12, 121, 127], [271, 2, 122, 138], [267, 1,