- Extending -> record module and
method_missing + bind_call
(confirm that bind call doesn't allocate metaclass). - Single generic Relation class. Stop dynamic method generation.
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
# frozen_string_literal: true | |
require 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'benchmark-ips' | |
end | |
require 'benchmark/ips' |
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 | |
# See: http://osxdaily.com/2015/10/16/fix-wi-fi-problems-mac-os-x-el-capitan/ | |
sudo rm -f /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist com.apple.network.identification.plist | |
sudo rm -f /Library/Preferences/SystemConfiguration/com.apple.wifi.message-tracer.plist | |
sudo rm -f /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist | |
sudo rm -f /Library/Preferences/SystemConfiguration/preferences.plist | |
sudo reboot |
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
RubyVM::InstructionSequence.compile_option = { peephole_optimization: false } | |
class RubyVM::InstructionSequence | |
def self.load_iseq(path) | |
RubyVM::InstructionSequence.compile_file(path) | |
end | |
end | |
# Can be enabled with RUBYOPT="-r /path/to/disable_opt.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
git filter-branch --tree-filter 'git ls-files -z | xargs -0 dos2unix' -- --all |
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
$ ruby -v | |
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin17] | |
$ ruby yield-vs-block.rb | |
Nested yield stack size: 402 | |
Forward block stack size: 202 | |
Warming up -------------------------------------- | |
baseline 82.138k i/100ms | |
nested-yield 16.030k i/100ms | |
forward-block 28.945k i/100ms | |
Calculating ------------------------------------- |
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
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do | |
source "https://rubygems.org" | |
gem "activerecord", "~> 5.2" |
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 SomeObserver | |
extend ActiveSupport::Concern | |
included do | |
after_create :do_something | |
end | |
def do_something | |
# | |
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
byroot@raplh:byroot:$ MISSING_KEY=1 SSHKIT_VERSION=1.10.0 ruby repro-sshkit.rb | |
Fetching gem metadata from https://rubygems.org/ | |
Fetching version metadata from https://rubygems.org/ | |
Resolving dependencies... | |
Using net-ssh 3.2.0 | |
Using bundler 1.12.3 | |
Using net-scp 1.2.1 | |
Using sshkit 1.10.0 | |
INFO [a3263e4e] Running /usr/bin/env echo foo as git@github.com | |
-- Content of known_hosts file: |
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
if Rails::VERSION::MAJOR >= 4 | |
if Rails::VERSION::MINOR > 0 | |
ActiveSupport::Deprecation.warn("This patch is probably not useful anymore. Check if https://github.com/rails/rails/pull/12425 have been released.") | |
end | |
class ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter | |
def type_cast(value, column) | |
case value | |
when TrueClass |
NewerOlder