This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Does nginx support the Retry-After header with a 503 error. | |
Specifically, I want nginx to try connecting to the upstream after the time specified | |
in the Retry-After header instead of its default time. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app$ irb | |
/usr/bin/irb | |
>> require "extlib" | |
=> true | |
>> require "merb-core" | |
=> true | |
>> Merb::Plugins.config[:merb_helpers] | |
=> {} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Screw.Mock = { | |
confirmWith: function(val) { | |
Screw.Mock.confirmText = null; | |
iframeWindow.confirm = function(str) { | |
Screw.Mock.confirmText = str; | |
return val; | |
}; | |
} | |
}; | |
Screw.XHR = function() {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$.parseXml = function( xml ) { | |
if( window.ActiveXObject && window.GetObject ) { | |
var dom = new ActiveXObject( 'Microsoft.XMLDOM' ); | |
dom.loadXML( xml ); | |
return $(dom); | |
} | |
if( window.DOMParser ) | |
return $(new DOMParser().parseFromString( xml, 'text/xml' )); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def start_transaction | |
Merb.logger.warn! "Parent pid: #{Process.pid}" | |
reader, writer = nil, nil | |
loop do | |
reader, writer = IO.pipe | |
pid = Kernel.fork | |
# pid means we're in the parent; only stay in the loop in that case | |
break unless pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- foo do | |
Hello | |
Goodbye | |
would get compiled into: | |
_tmp = "" | |
@output << foo do | |
_tmp << "Hello" | |
_tmp << "Goodbye" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mongrel' | |
require 'merb-core/rack/handler/mongrel' | |
module Merb | |
module Rack | |
class Mongrel < Merb::Rack::ForkingAdapter | |
def self.stop | |
@server.stop(true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ Started request handling: Thu Sep 25 11:37:46 -0700 2008 | |
~ Params: {"action"=>"fiveohthree", "controller"=>"bench"} | |
~ {:before_filters_time=>2.7e-05, :dispatch_time=>0.004589, :after_filters_time=>1.6e-05, :action_time=>0.001009} | |
~ | |
~ localhost - - [25/Sep/2008:11:37:46 PDT] "GET /bench/string HTTP/1.1" 200 17 | |
~ - -> /bench/string | |
~ localhost - - [25/Sep/2008:11:37:46 PDT] "GET /favicon.ico HTTP/1.1" 404 14 | |
~ http://localhost:4000/bench/string -> /favicon.ico | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.autocomplete = function(opts) { | |
opts.list = opts.list || function(arr) { | |
ret = "<ul class='complete'><li>"; | |
ret += arr.join("</li><li>"); | |
return ret + "</li></ul>"; | |
}; | |
opts.match = opts.match || function(element, typed) { | |
return element.match(new RegExp(typed, "i")); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
merb: worker (port 4001) ~ Starting Mongrel at port 4001 | |
merb: worker (port 4001) ~ Successfully bound to port 4001 | |
merb: worker (port 4000) ~ Starting Mongrel at port 4000 | |
merb: worker (port 4000) ~ Successfully bound to port 4000 | |
merb: worker (port 4002) ~ Starting Mongrel at port 4002 | |
merb: worker (port 4002) ~ Successfully bound to port 4002 | |
merb: worker (port 4003) ~ Starting Mongrel at port 4003 | |
merb: worker (port 4003) ~ Successfully bound to port 4003 | |
merb: worker (port 4000) ~ Exiting port 4000 | |
merb: worker (port 4000) ~ Starting Mongrel at port 4000 |