This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
This file contains hidden or 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
# force UTF-8 on all strings back from YAML. | |
class << YAML::DefaultResolver | |
def node_import_with_utf8(node) | |
val = node_import_without_utf8(node) | |
val.force_encoding("UTF-8") if val.respond_to?(:force_encoding) | |
val | |
end | |
alias_method_chain :node_import, :utf8 |
This file contains hidden or 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
git tag -d 1.4.0 | |
git tag -d 2.2.5 | |
git tag -d rm | |
git tag -d v.1.8.23 | |
git tag -d v0.1.0 | |
git tag -d v0.2.0 | |
git tag -d v1.0.0 | |
git tag -d v1.1.0 | |
git tag -d v1.1.1 | |
git tag -d v1.1.2 |
OlderNewer