Skip to content

Instantly share code, notes, and snippets.

@sutanto
sutanto / install_ruby_2_3_8_bigsur_homebrew.sh
Created November 14, 2020 09:57
Install OpenSSL 1.0.2t and Ruby 2.3.8 on Big Sur and newer Homebrew
# New Homebrew version no longer support direct url installation (like in this script: https://gist.github.com/sutanto/75a778f94edae116aeaa5ec56955ce58)
# We now need to create "custom" local tap that holds the specific version we'd like to install
brew tap-new sutanto/homebrew-versions
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow
brew extract --version 1.0.2t openssl sutanto/homebrew-versions
brew install sutanto/homebrew-versions/openssl@1.0.2t
ruby-install ruby 2.3.8 -- --with-openssl-dir=/usr/local/opt/openssl@1.0.2t
@sutanto
sutanto / ruby_print_super_methods.rb
Created June 16, 2020 02:21
Print all super methods' location
def print_supers(method_ref)
return unless method_ref
puts method_ref.source_location.to_s
print_supers method_ref.super_method
end
print_supers UsersController.new.method(:authenticate_user!)
@sutanto
sutanto / install_ruby_2_3_8_catalina_old_homebrew.sh
Last active November 14, 2020 09:58
Install OpenSSL 1.0.2t and Ruby 2.3.8 on Catalina
# This is for older version of Homebrew which still support the direct URL install
# For newer Homebrew version, use this script: https://gist.github.com/sutanto/999b8ec6cd0e63848a37c7a906acace8
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/8b9d6d688f483a0f33fcfc93d433de501b9c3513/Formula/openssl.rb
brew switch openssl 1.0.2t
ruby-install ruby 2.3.8 -- --with-openssl-dir=/usr/local/opt/openssl
@sutanto
sutanto / install_curb_0.9.3_on_macos_catalina.sh
Last active October 19, 2020 05:27
Install curb 0.9.3 on MacOS Catalina
# You'll probably also need to Install Ruby 2.3.x with OpenSSL 1.0 (on Catalina),
# follow this gist *before* you install curb: https://gist.github.com/sutanto/75a778f94edae116aeaa5ec56955ce58
# Recent Homebrew version no longer allow the `brew install formula` command, we'll need to create our own "custom" tap:
brew tap-new sutanto/homebrew-versions
# make sure that we don't use the "shallow" local homebrew repo
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow
# extract the required curl version

Keybase proof

I hereby claim:

  • I am sutanto on github.
  • I am tanto (https://keybase.io/tanto) on keybase.
  • I have a public key whose fingerprint is 7C5E D3C1 2B77 7B72 65D3 9B01 B247 D7B6 8747 491A

To claim this, I am signing this object: