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
Some weird stuff about NetHTTP, the timeout is twice what it should be. | |
To test things out: | |
$> gem install sinatra | |
$> ruby server.rb | |
$> ruby client.rb |
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
$(document).ready(function() { | |
console.log("document loaded."); | |
$(document).ajaxStart(function() { | |
console.log(".ajaxStart fired!"); | |
}); | |
$(document).ajaxComplete(function() { | |
console.log(".ajaxComplete fired!"); | |
}); | |
}); |
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
module EventMachine | |
module Middleware | |
require 'digest' | |
require 'securerandom' | |
require 'cgi' | |
class DigestAuth | |
def initialize(opts = {}) | |
@nonce_count = -1 | |
@opts = {} |
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 method_missing(method, *args, &block) | |
begin | |
super | |
rescue NoMethodError => e | |
warn("Warning: Unknown field or method #{method} for object #{self.inspect}\nBacktrace:\n#{e.backtrace.join("\n")}") | |
end | |
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
class Band | |
include Mongoid::Document | |
store_in collection: "artists", database: "music", session: "secondary" | |
end | |
class BandsController < ApplicationController | |
before_filter :switch_database | |
after_filter :reset_database | |
private |
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
# Setup step | |
stub(Version.just_updated).paginate(:page => nil, :per_page => 50){ [@version_2, @version_3, @version_4] } | |
stub(Version.just_updated).paginate(:page => 2, :per_page => 50){ [@version_4, @version_3, @version_2] } | |
stub(Version.just_updated).paginate do |args| | |
raise args.inspect | |
end | |
# Test | |
should "raise an exception" do | |
pp Version.just_updated.paginate(:page => 3, :per_page => 50) #=> [] |
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
# from java1 | |
cluster.name: dimelo | |
network.bind_host: 0.0.0.0 | |
network.publish_host: 10.10.4.8 | |
discovery.zen.ping.multicast.enabled: false | |
discovery.zen.ping.unicast.hosts: ["java1.dimelo:9200", "java2.dimelo:9200"] |
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
jenkins@ci [ideas_feature_remove-iconv] > gem install ferret | |
Building native extensions. This could take a while... | |
ERROR: Error installing ferret: | |
ERROR: Failed to build gem native extension. | |
/var/lib/jenkins/.rbenv/versions/2.0.0-p195/bin/ruby extconf.rb | |
creating Makefile | |
make | |
compiling STEMMER_stem_ISO_8859_1_dutch.c |
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
Backtrace: | |
On line #20 of app/views/layouts/application.html.erb | |
17: <%= execute_extensions_view_method :head %> | |
18: <%= custom_head_section %> | |
19: </head> | |
20: <% body_tag do %> | |
21: <%= admin_toolbar %> | |
22: <%= header %> | |
23: <% deprecated_doc4 yield(:document_class_for_sidebar) || 'yui-t7' do %> |
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
source 'https://rubygems.org' | |
gem 'sinatra' | |
gem 'ruby-band' |
OlderNewer