!!! This Gist Moved Here !!!
##Thread-safe JRuby on Rails HOW-TO
###With the help of Warbler, Apache Tomcat and JNDI Connection Pool
###Read those posts before anything else otherwise you'll find yourself in a very lonely place:
class HaveWant | |
attr_reader :answers | |
def initialize(*have, want) | |
@have = have[0] | |
@args = have[1..-1] | |
@want = want | |
find_matches |
class JourneyCoffeeGenerator < Journey::Visitors::Visitor | |
def accept node | |
@requirements = [[]] | |
super.gsub('" + "', '') | |
end | |
private | |
def visit_GROUP node | |
@requirements << [] |
# Returns all inflections matching rules for plural form | |
plural_inflections = ActiveSupport::Inflector.inflections.instance_variable_get("@singulars").map { |i| i[0] }.concat(ActiveSupport::Inflector.inflections.instance_variable_get("@uncountables")) |
##Thread-safe JRuby on Rails HOW-TO
###With the help of Warbler, Apache Tomcat and JNDI Connection Pool
###Read those posts before anything else otherwise you'll find yourself in a very lonely place:
# Extend jQuery objects with Underscore collection methods. | |
# | |
# Each collection method comes in two flavors: one prefixed | |
# with _, which yields a bare DOM element, and one prefixed | |
# with $, which yields a jQuery-wrapped element. | |
# | |
# So if `this` is a jQuery object, instead of: | |
# | |
# _.max @, (el) -> $(el).height() | |
# |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Object#tap in JavaScript</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> | |
<script type="text/javascript" src="http://sugarjs.com/javascripts/sugar-0.9.5.min.js"></script> | |
<script type="text/javascript"> | |
jQuery.noConflict(); | |
(function($) { |
// ==UserScript== | |
// @name Pimp my Drop Down List | |
// @description Instant auto-completion for any drop down lists (<select>) on any page | |
// @author Nowhere Man | |
// @version 0.2.9dev | |
// @homepage https://gist.github.com/954934/#file_readme.md | |
// @updateURL https://raw.github.com/gist/954934/combo.user.js | |
// @include https://* | |
// @include http://* | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js |
(function(window,undefined){ | |
// Load Helpers | |
var | |
intervalScript, intervalJquery, | |
loadScript = function(scriptUrl){ | |
var e = document.createElement('script'); | |
e.setAttribute('src',scriptUrl); | |
window.document.body.appendChild(e); | |
return e; |
// To transform jsTree Search plugin (http://www.jstree.com/documentation/search) | |
// Into a live Filter/Search system, like http://ejohn.org/blog/jquery-livesearch | |
// TODO Add a QuickSilver/LiquidMetal support, maybe with the help of jsTree sort plugin | |
//$("div.jstree li").show(); // Clear search | |
$("div.jstree li").hide(); | |
$("div.jstree li a[class=jstree-search]").parents("div.jstree li").show(); |