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 "net/http" | |
http = Net::HTTP.new("example.com") | |
http.open_timeout = 2 | |
http.read_timeout = 3 # Must be greater than open_timeout | |
begin | |
http.start | |
begin | |
http.request_get("/whatever?") do |res| | |
res.read_body | |
end |
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
// An Unobtrusive Javascript (UJS) driver based on explicit behavior definitions. Just | |
// put a "data-behaviors" attribute on your view elements, and then assign callbacks | |
// for those named behaviors via Behaviors.add. | |
var Behaviors = { | |
add: function(trigger, behavior, handler) { | |
document.observe(trigger, function(event) { | |
var element = event.findElement("*[data-behaviors~=" + behavior + "]"); | |
if (element) handler(element, event); | |
}); |
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
######################################## | |
### Start with a "clean" environment ### | |
######################################## | |
mmoen@shiny:~/tmp$ gem environment | |
RubyGems Environment: | |
- RUBYGEMS VERSION: 1.3.5 | |
- RUBY VERSION: 1.8.6 (2009-08-04 patchlevel 383) [i686-darwin10.2.0] | |
- INSTALLATION DIRECTORY: /Users/mmoen/.rvm/gems/ruby/1.8.6 | |
- RUBY EXECUTABLE: /Users/mmoen/.rvm/ruby-1.8.6-p383/bin/ruby |
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
#!/bin/sh | |
# | |
# PROVIDE: cccms | |
# REQUIRE: nginx cleanvar | |
. /etc/rc.subr | |
name=cccms | |
rcvar=`set_rcvar` |
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
/* | |
Ancestry - jquery.ancestry.js | |
As discussed in the jQuery Development Google Group. | |
Released under the MIT license. | |
Involved: Michael Geary, Diego Perini, John-David Dalton, John Resig, and Nathan Hammond | |
Compiled: Nathan Hammond | |
*/ | |
jQuery.comparePosition = function ( element, context) { |
NewerOlder