Skip to content

Instantly share code, notes, and snippets.

View andre1810's full-sized avatar

André Hester andre1810

View GitHub Profile
@andre1810
andre1810 / paper_trail_issue_594_has_many.rb
Last active December 18, 2017 20:08
Paper Trail Issue 594 reproducer
# https://github.com/airblade/paper_trail/issues/594
# Use this template to report PaperTrail bugs.
# It is based on the ActiveRecord template.
# https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_gem.rb
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
@andre1810
andre1810 / list_vagrant_port_forwardings.rb
Last active April 2, 2021 17:52
List Port Forwardings of vagrant machines
vm_infos = `vboxmanage list vms`
puts 'Port Forwardings:'
puts '---------------------------------'
vm_infos.each_line do |vm_info|
vm_name = vm_info.scan(/\"(.*)\"/)
vm_id = vm_info.scan(/.*{(.*)}/).join('')
vm_detail_info = `vboxmanage showvminfo #{vm_id}`