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
## Monkeypatch payload_object like https://github.com/collectiveidea/delayed_job/pull/990 | |
module Delayed | |
module Backend | |
class InvalidPayload | |
ParseObjectFromYaml = %r{\!ruby/\w+\:([^\s]+)} # rubocop:disable ConstantName | |
def initialize(handler, exception) | |
@handler = handler | |
@exception = deserialization_error(exception) | |
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
diff --git a/src/third_party/gperftools-2.0/src/libc_override_osx.h b/src/third_party/gperftools-2.0/src/libc_override_osx.h | |
index 78a0ef2f95..13ec5b8d66 100644 | |
--- a/src/third_party/gperftools-2.0/src/libc_override_osx.h | |
+++ b/src/third_party/gperftools-2.0/src/libc_override_osx.h | |
@@ -205,6 +205,33 @@ extern "C" { | |
size_t malloc_usable_size(void* p) { return tc_malloc_size(p); } | |
} // extern "C" | |
+static malloc_zone_t *get_default_zone() | |
+{ |
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 CallbackTrace | |
def self.included(kls) | |
kls.send :alias_method_chain, :_compile_filter, :trace | |
end | |
def _compile_filter_with_trace(filter) | |
generated_code = _compile_filter_without_trace(filter) | |
return generated_code if filter.is_a?(Array) || @kind == :around || !(@klass.ancestors.include?(ActiveRecord::Base)) | |
"($stdout.print 'Callback: #{@kind} #{@klass.name}##{@raw_filter}'; $stdout.puts self.inspect; #{generated_code})" | |
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
# Monkeypatch to disable connection pooling in ActiveRecord | |
module ActiveRecord | |
module ConnectionAdapters | |
class ConnectionPool | |
def checkout | |
c = ActiveRecord::Base.send(spec.adapter_method, spec.config.dup) | |
c.verify! | |
c | |
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
#!/bin/bash | |
# | |
# pickjdk: provides a shell function that allows you to choose a JDK. | |
# | |
# The function sets JAVA_HOME and PATH On Linux or | |
# Windows, just set the environment variable JDKS_ROOT to the directory | |
# containing multiple versions of the JDK and the function will prompt you to | |
# select one. On OSX, JDKs will be discovered for you. | |
# JDKS_ROOT=/opt/jdk |
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 JRubyRackXSendfile | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
result, headers, body = @app.call(env) | |
if headers['X-Sendfile'] | |
[result, headers, File.new(headers.delete('X-Sendfile'))] | |
else |
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 NoisyStubCollector < BasicObject | |
def method_missing(meth,*args,&blk) | |
@messages ||= [] | |
@messages << [meth,args,blk] | |
self | |
end | |
def inspect | |
(@messages || []).map{|meth,args,blk| "#{meth}#{args.inspect}#{blk.inspect if blk}"}.join(' ') |
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
trap("QUIT") do | |
Thread.list.each do |t| | |
$stderr.puts | |
$stderr.puts t.inspect | |
$stderr.puts t.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
<?xml version='1.0'?> | |
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> | |
<service_bundle type='manifest' name='jenkins/node'> | |
<service name='network/jenkins/node' type='service' version='0'> | |
<create_default_instance enabled='true'/> | |
<single_instance/> | |
<dependency name='fs' grouping='require_all' restart_on='none' type='service'> | |
<service_fmri value='svc:/system/filesystem/local'/> | |
</dependency> | |
<dependency name='net' grouping='require_all' restart_on='none' type='service'> |
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
$ jirb | |
irb(main):001:0> t = Thread.new { sleep } | |
=> #<Thread:0x64e5b2 sleep> | |
irb(main):002:0> require 'jruby' | |
=> true | |
irb(main):003:0> jt = JRuby.reference(t) | |
=> #<Thread:0x64e5b2 sleep> | |
irb(main):004:0> jt.native_thread.name | |
=> "RubyThread-7: (irb):1" | |
irb(main):005:0> jt.native_thread.name = "My Ruby thread" |