Skip to content

Instantly share code, notes, and snippets.

View rgrove's full-sized avatar
🥧

Ryan Grove rgrove

🥧
View GitHub Profile
@davglass
davglass / gist:1606825
Created January 13, 2012 15:02
YUI 3.3.0 FF 9 Duplicate Script Loading Patch
(function() {
/*
* This patch fixes an issue with Y.Get in 3.2.0 & 3.3.0
* where it fails to know when a CSS file is loaded in FF 9+.
* Since it fails to know when the load of the CSS file
* has completed, it creates a race condition that
* forces the scripts to be attached again.
*/
@rgrove
rgrove / gist:1603932
Created January 13, 2012 00:09
Decode HTML entities
var utils = {},
decodeEl;
/**
* Returns a version of the specified string with all HTML entities
* decoded. DO NOT use the output of this function with innerHTML if you're
* working with user-supplied content!
*
* @method decodeEntities
* @param {String} string string to decode
@okuryu
okuryu / gist:1367067
Created November 15, 2011 13:26
YUIConf 2011
@alkema
alkema / elasticsearch.sh
Created August 11, 2011 16:49
install elasticsearch on ubuntu
sudo apt-get install unzip
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.17.4.zip
unzip elasticsearch-0.17.4.zip
sudo apt-get install python-software-properties
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin
sudo mv elasticsearch-0.17.4 /usr/local/share
cd elasticsearch-servicewrapper
sudo mv service /usr/local/share/elasticsearch-0.17.4/bin
@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
@rgrove
rgrove / gist:1072877
Created July 8, 2011 21:35
How to load the latest combohandled YUI 3 source from git
<script src="http://fuji.jetpants.com/yui/combo/yui3?build/yui/yui-min.js"></script>
<script>
var Y = YUI({
comboBase: 'http://fuji.jetpants.com/yui/combo/yui3?',
combine : true,
root : 'build/'
}).use('node', function (Y) {
// YUI will now automatically load modules from the custom fuji.jetpants.com
// combohandler, which pulls the latest YUI 3 code from git master every 15
// minutes.
@rbscott
rbscott / elasticsearch.conf
Created June 28, 2011 19:46
upstart job for elastic search
# ElasticSearch Service
description "ElasticSearch"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
@rgrove
rgrove / multi-yui.js
Created May 16, 2011 17:52
Loads different versions of YUI in sandboxed iframes for testing
/**
Loads different versions of YUI in sandboxed iframes and makes them available
for use in the parent frame by exposing them as properties on a `Y.Multi`
instance.
The included `sandbox.html` file must be present at a URL with the same origin
as the current page, or the universe will explode.
This is primarily intended to be used for testing. You probably shouldn't use it
for anything real.
@brettstimmerman
brettstimmerman / gist:943498
Created April 27, 2011 00:38
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.
@scottbw
scottbw / Loader.js
Created March 2, 2011 09:26
This is a wrapper for Ryan Grove's LazyLoad enabling dynamic binding and exporting
/**
* Loader is a wrapper around LazyLoad that resolves a requested library, loads it, and then when loaded it
* fires a callback with the object exported by the library.
*
* Copyright (c) 2011 Scott Wilson <scott.bradley.wilson@gmail.com>
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: