Skip to content

Instantly share code, notes, and snippets.

View aergonaut's full-sized avatar

Chris Fung aergonaut

View GitHub Profile
GC.start
before = GC.stat(:total_freed_objects)
100_000.times do
foo = "a string"
end
GC.start
after = GC.stat(:total_freed_objects)
puts "(Creating Strings) Objects Freed: #{after - before}"
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
gem "activerecord", "~> 6"
gem "sqlite3"
gem "protected_attributes_continued", "1.6.0"
end
require "bundler/inline"
gemfile(true) do
gem "activerecord", "~> 5.2.0"
gem "sqlite3"
end
require "active_record"
ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "activesupport", "~> 4.2"
end
require "active_support/all"
class Dog
class Foo
private
def initialize
puts "calling initialize"
end
end
foo = Foo.new
--- tmp/with_silence_in_test_mode.txt 2019-08-15 09:37:37.000000000 -0700
+++ tmp/without_silence_in_test_mode.txt 2019-08-15 09:41:09.000000000 -0700
@@ -1,6 +1,9 @@
/Users/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/iconv-1.0.4/lib/iconv/version.rb:1: warning: constant ::Data is deprecated
/Users/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/iconv-1.0.4/lib/iconv.rb:4: warning: constant ::Data is deprecated
Using fake sphinx binaries
+DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from <top (required)> at /Users/chris/src/coupa/coupa_development/config/application.rb:9)
+DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from <top (required)> at /Users/chris/src/coupa/coupa_development/config/application.rb:9)
+DEPRECATION WARNING: alias_method_chain is deprecated. Pleas
3a4,6
> DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from <top (required)> at /Users/chris/src/coupa/coupa_development/config/application.rb:9)
> DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from <top (required)> at /Users/chris/src/coupa/coupa_development/config/application.rb:9)
> DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from block in included at /Users/chris/src/coupa/coupa_development/lib/coupa_lib/thinking_sphinx_extensions/remote_sphinx.rb:72)
21,22c24,25
< W, [2019-08-15T16:35:30.349288 #80110] WARN -- : LegalInvoice: overriding method 'invalid?'!
< W, [2019-08-15T16:35:30.404496 #80110] WARN -- : LegalPaymentReceipt: overriding method 'invalid?'!
---
> W, [
# Configuration for Alacritty, the GPU enhanced terminal emulator
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty it self.
env:
# TERM env customization.
#
# If this property is not set, alacritty will set it to xterm-256color.

Demonstrating behavior of exit in shell scripts.

The desired behavior is that the script b.sh is run in the middle of a.sh or c.sh. a.sh and c.sh only differ in how they call b.sh.

Running a.sh has the following output:

$ ./a.sh
starting a.sh
starting b.sh
# Configuration for Alacritty, the GPU enhanced terminal emulator
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty it self.
env:
# TERM env customization.
#
# If this property is not set, alacritty will set it to xterm-256color.