Skip to content

Instantly share code, notes, and snippets.

View ericf's full-sized avatar

Eric Ferraiuolo ericf

View GitHub Profile
diff --git a/src/jsonp/js/jsonp.js b/src/jsonp/js/jsonp.js
index f6f6b44..91d2634 100644
--- a/src/jsonp/js/jsonp.js
+++ b/src/jsonp/js/jsonp.js
@@ -122,6 +122,9 @@ JSONPRequest.prototype = {
// In case additional requests are issued before the current reques
// returns, don't remove the proxy.
self._requests++;
+ if (!('_timeouts' in self)) {
+ self._timeouts = 0;
@lsmith
lsmith / iOS_details_arrow.css
Created March 6, 2011 07:56
The CSS to create an iOS details call-to-action arrow
/* assumes .details is position: relative */
.details::after {
content: '';
position: absolute;
border-top: 3px solid #7f7f7f;
border-right: 3px solid #7f7f7f;
height: 6px;
width: 6px;
top: 50%;
right: 12px;
@lsmith
lsmith / gist:895834
Created March 31, 2011 04:49
Thoughts on adding HTML_PARSER support to Plugin.addHostAttr sugar for Plugins.
Y.Plugin.addHostAttr = function (name, host, plugin) {
host.ATTRS[name] = {
setter: function (val) {
var config = isObject(val) ? val : {},
method = (val) ? 'plug' : 'unplug',
widgetProto = Widget.prototype;
this[method](plugin, config);
if (val && (host.prototype === widgetProto || widgetProto.isPrototypeOf(host.prototype))) {
// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
var metas = document.getElementsByTagName('meta');
var i;
if (navigator.userAgent.match(/iPhone/i)) {
for (i=0; i<metas.length; i++) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
}
}
@ericf
ericf / gist:961730
Created May 8, 2011 22:12
A simple, small, and powerful CSS Grid System (based on YUI 3 CSS Grids)
/* Based on YUI 3 CSS Grids: http://developer.yahoo.com/yui/3/cssgrids/ */
.layout {
letter-spacing: -0.31em; /* webkit: collapse white-space between units */
*letter-spacing: normal; /* reset IE < 8 */
word-spacing: -0.43em; /* IE < 8 && gecko: collapse white-space between units */
}
.layout > *,
.layout .unit {
display: inline-block;
zoom: 1; *display: inline; /* IE < 8: fake inline-block */
@kylebarrow
kylebarrow / example.html
Created June 23, 2011 06:30
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>
@tivac
tivac / gist:1068126
Created July 6, 2011 19:30
YUI 3.3.0 -> 3.4.0 HEAD Notes
@lsmith
lsmith / gist:1097943
Created July 21, 2011 19:07
Make Y.DataTable instantiable, and an extension point for feature extension classes
// Right now, Y.DataTable is only a namespace. But I want to be able to say new Y.DataTable({...});
// We can do it. We have the technology.
// Step 1. Capture all the properties of the Y.DataTable namespace
// Y.merge creates a shallow copy of an object, and since Y.DataTable is just a namespace object,
// this works like a champ. You could now say new Stuff.Base({...}) to create a DataTable.Base
// instance.
var Stuff = Y.merge(Y.DataTable);
// Step 2. Replace the Y.DataTable namespace with a working DataTable.Base subclass
@rgrove
rgrove / delete-tags.sh
Created August 7, 2011 21:42
Shell script to delete useless build tags from GitHub forks of YUI 3
#!/bin/bash
# This script will delete *all* local and remote tags from any git repo you run
# it in, unless they begin with "v". Please use it to remove the hundreds of
# build tags from your YUI 3 fork.
#
# This script will not delete branches; just tags.
set -e
RED="\[\033[1;31m\]"
YELLOW="\[\033[1;33m\]"
GREEN="\[\033[1;32m\]"
BLUE="\[\033[1;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[1;37m\]"
COLOR_NONE="\[\e[0m\]"