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
diff --git a/test/test_arhp.rb b/test/test_arhp.rb | |
index afdd783..fcea9da 100644 | |
--- a/test/test_arhp.rb | |
+++ b/test/test_arhp.rb | |
@@ -97,7 +97,7 @@ class ActiveRecordHostPoolTest < Test::Unit::TestCase | |
# now, disable our auto-switching and trigger a mysql reconnect | |
switch_to_klass.connection.unproxied.stubs(:_switch_connection).returns(true) | |
- switch_to_klass.connection.execute("KILL #{thread_id}") | |
+ Test3.connection.execute("KILL #{thread_id}") |
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
[maxscale] | |
threads=4 | |
log_debug=1 | |
[top service] | |
type=service | |
router=readconnroute | |
servers=master,slave | |
user=admin | |
passwd=123456 |
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 verification_link(account, user) | |
token = user.identities.first.verification_tokens.first || user.identities.first.verification_tokens.create | |
link = "#{account.url(:mapped => false)}/verification/email/#{token.value}" | |
end | |
account = nil | |
ActiveRecord::Base.on_shard(2) do | |
account = Account.new(:name => "Number Four", :size => 1, :time_zone => "Copenhagen") { |a| | |
a.subdomain = "shardly#{rand(150)}" | |
a.help_desk_size = "5-20" |
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/bash | |
if [[ `git branch | grep '*' | awk '{print $2}'` != 'production' ]] ; then | |
echo "Only on checked out production branch, plz" | |
exit | |
fi | |
git fetch --tags origin | |
RUBY=$(cat <<endruby | |
require 'pp' | |
tags = [] |
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
$j.ajax( | |
{ | |
type: 'POST', | |
url: '/proxy/direct', | |
data: | |
{ | |
url: "http://www.outbound.com", | |
body: $j.param({a: "bar", b: "buz"}), | |
contenttype: "application/x-www-form-urlencoded" | |
} |
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
diff --git a/scripting/engine_spidermonkey.cpp b/scripting/engine_spidermonkey.cpp | |
index 88f48e3..0f36817 100644 | |
--- a/scripting/engine_spidermonkey.cpp | |
+++ b/scripting/engine_spidermonkey.cpp | |
@@ -662,6 +662,9 @@ namespace mongo { | |
case CodeWScope: { | |
JSFunction * func = compileFunction( e.codeWScopeCode() ); | |
+ if ( !func ) | |
+ return JSVAL_NULL; |
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 Module | |
def wrap_methods(*args) | |
methods = args | |
feature = args.pop | |
wrapper = "_#{feature}_wrapper" | |
methods.each do |method| | |
alias_method_chain(method, feature) do |aliased_target, punctuation| | |
original_method = "#{aliased_target}_without_#{feature}#{punctuation}" | |
class_eval <<-EOL | |
def #{aliased_target}_with_#{feature}#{punctuation}(*args, &block) |
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 ActiveSupport::TestCase | |
def self.mark_19_incompat | |
@marked_19_incompat = true | |
end | |
def self.ruby_19_compatible? | |
!@marked_19_incompat | |
end | |
def run_with_19(*args, &block) |
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
1.8.7 :001 > ["asdf"].to_s | |
=> "asdf" | |
1.9.3p125 :001 > ["asdf"].to_s | |
=> "[\"asdf\"]" | |
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 Marshal | |
class << self | |
def load_with_utf8_enforcement(object, other_proc=nil) | |
@utf8_proc ||= Proc.new do |o| | |
o.force_encoding("UTF-8") if o.is_a?(String) | |
other_proc.call(o) if other_proc | |
o | |
end | |
load_without_utf8_enforcement(object, @utf8_proc) | |
end |
OlderNewer