Skip to content

Instantly share code, notes, and snippets.

Avatar
🌈
It's complicated?

Ryan Davis zenspider

🌈
It's complicated?
View GitHub Profile
View backtrace_cleaner.diff
diff --git a/activesupport/lib/active_support/backtrace_cleaner.rb b/activesupport/lib/active_support/backtrace_cleaner.rb
index 6273012808..f54a56db0a 100644
--- a/activesupport/lib/active_support/backtrace_cleaner.rb
+++ b/activesupport/lib/active_support/backtrace_cleaner.rb
@@ -104,27 +104,33 @@ def add_stdlib_silencer
add_silencer { |line| line.start_with?(RbConfig::CONFIG["rubylibdir"]) }
end
- def filter_backtrace(backtrace)
- @filters.each do |f|
View all_diff.sh
#!/bin/bash
for BRANCH in $(git branch | grep -v master | cut -c3-) ; do
echo "# $BRANCH" 1>&2
git diff master..$BRANCH
echo
done
View all.sh
#!/bin/bash
set -e
set -xv
git checkout master
for BRANCH in $(git branch | grep -v master | cut -c3-) ; do
git checkout $BRANCH
git diff --name-only master.. | xargs sed -i -Ee "$@"
@zenspider
zenspider / params.rb
Last active May 18, 2020
Analyzes all use of `params` to generate `allow_parameters` calls
View params.rb
#!/usr/bin/env ruby -ws
$d ||= false
require "pp" if $d
require "isolate"
# TODO: skip_before_action
Isolate.now! name:"params-2020-05-05" do
View github_unwatch_org.rb
#!/usr/bin/env ruby -ws
$d ||= false
require "isolate"
Isolate.now! name:"github_unwatch" do
gem "octokit"
gem "pry"
end
require "pry" if $d
View output difference
diff -r old/lib/minitest/parallel.rb new/lib/minitest/parallel.rb
--- old/lib/minitest/parallel.rb
+++ new/lib/minitest/parallel.rb
@@ -29,9 +29,14 @@
Thread.current.abort_on_exception = true
while (job = queue.pop)
klass, method, reporter = job
- reporter.synchronize { reporter.prerecord klass, method }
+ v = reporter.reporters.first.options[:verbose] # ugh
+
View wtf.rb
#!/usr/bin/env ruby -w
require "minitest/autorun"
class R
def self.val
(ancestors - Object.ancestors)
.find { |cls| cls.instance_variable_defined?(:@val) } # not fond of this...
&.instance_variable_get(:@val)
end
View update_rubies.rb
#!/usr/bin/env ruby -w
require "open-uri"
require "net/http" # avoid require issues in threads
require "net/https"
base_url = "https://cache.ruby-lang.org/pub/ruby"
versions = ("2.3".."2.7").to_a
View str_diff.patch
diff -r old/lib/minitest/assertions.rb new/lib/minitest/assertions.rb
--- old/lib/minitest/assertions.rb
+++ new/lib/minitest/assertions.rb
@@ -61,12 +61,15 @@
butwas = mu_pp_for_diff act
result = nil
+ e1, e2 = expect.include?("\n"), expect.include?("\\n")
+ b1, b2 = butwas.include?("\n"), butwas.include?("\\n")
+
View keybase.md

Keybase proof

I hereby claim:

  • I am zenspider on github.
  • I am zenspider (https://keybase.io/zenspider) on keybase.
  • I have a public key ASBc6q4tJW1GzOR9OzX_-oNu54XU_EHIZ1RocBTk1ncf-go

To claim this, I am signing this object:

You can’t perform that action at this time.