Skip to content

Instantly share code, notes, and snippets.

View jrafanie's full-sized avatar

Joe Rafaniello jrafanie

  • New Jersey
View GitHub Profile
@jrafanie
jrafanie / boot_allocations.rb
Last active November 30, 2016 17:37
Rails boot allocations
def iter(n)
if n > 0
1.times{
iter(n-1)
}
else
# null code
end
end
@jrafanie
jrafanie / profile_amazon_refresh_retained_allocations.diff
Created November 17, 2016 16:29
Trace allocations in amazon provider refresh specs
From 19f131f47fc27939374253a936e10a9d7cbe3a3b Mon Sep 17 00:00:00 2001
From: Joe Rafaniello <jrafanie@redhat.com>
Date: Wed, 16 Nov 2016 14:09:45 -0500
Subject: [PATCH] WIP
---
.../amazon/cloud_manager/refresher_spec.rb | 67 ++++++++++++++++++++--
1 file changed, 63 insertions(+), 4 deletions(-)
diff --git a/spec/models/manageiq/providers/amazon/cloud_manager/refresher_spec.rb b/spec/models/manageiq/providers/amazon/cloud_manager/refresher_spec.rb
@jrafanie
jrafanie / initializers.txt
Created November 10, 2016 17:19
ManageIQ initializer names
initializing set_load_path (16 times)
initializing set_autoload_paths (16 times)
initializing add_routing_paths (16 times)
initializing add_locales (16 times)
initializing add_view_paths (16 times)
initializing load_environment_config (16 times)
initializing load_environment_hook
initializing load_active_support
initializing set_eager_load
initializing initialize_logger
@jrafanie
jrafanie / output.log
Created November 4, 2016 19:42
undefined method `definition' for #<Class:0x00000015145f90> doc formatter
$ bundle exec rake ${TEST_SUITE+test:$TEST_SUITE}
2 processes for 1078 specs, ~ 539 specs per process
[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's 'rails' settings.
/home/travis/build/jrafanie/manageiq/spec/helpers/application_helper/buttons/role_suspend_spec.rb:50: warning: regular expression has ']' without escape
[Coveralls] Set up the SimpleCov formatter.
[Coveralls] Using SimpleCov's 'rails' settings.
Randomized with seed 816
@jrafanie
jrafanie / codeclimate-config.diff
Created October 20, 2016 14:54
codeclimate-config suggestion
diff --git a/.eslintrc b/.eslintrc
index e69de29..9faa375 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -0,0 +1,213 @@
+ecmaFeatures:
+ modules: true
+ jsx: true
+
+env:
@jrafanie
jrafanie / actual_results.log
Last active October 13, 2016 16:24
Output from codeclimate analyze for markdownlint and csslint
== .github/PULL_REQUEST_TEMPLATE.md (7 issues) ==
1: Line length [markdownlint]
4: Lists should be surrounded by blank lines [markdownlint]
5: Line length [markdownlint]
6: Line length [markdownlint]
8: First header should be a h1 header [markdownlint]
11: Bare URL used [markdownlint]
17: Line length [markdownlint]
== CHANGELOG.md (351 issues) ==
@jrafanie
jrafanie / churn_vs_complexity.rb
Last active July 15, 2016 14:58
Generate churn vs. complexity graphs for ManageIQ
require 'yaml'
require 'csv'
require 'parallel'
yml = `churn -d "07/15/15" -y`
changes = YAML.load(yml)[:churn][:changes]
require "csv"
def ignored?(file_path)
@jrafanie
jrafanie / gist:abd10640d31b88f77f7fcaaf6ef48b14
Created June 16, 2016 18:44
Fallout from fix of bundler path gems always causing re-resolve (https://github.com/bundler/bundler/pull/4618)
* Even with no changes to the gemspecs for path based gems, bundler will always
re-resolve.
* After fixing above, the following issues were uncovered because the re-resolve
was masking these problems.
1) When you have a path with multiple gemspecs in subdirectories:
When bundler creates a Bundler::Source::Path object at the toplevel directory,
it creates gem specifications for each gemspec but the path to the gemspec uses
the toplevel path and not the nested path.
@jrafanie
jrafanie / lazy_timestamping_assets.log
Last active June 2, 2016 15:35
Lazy evaluating asset timestamps on sprockets on 3.6.0 https://github.com/rails/sprockets/pull/211
# Using sprockets 3.6.0 with spocket-rails 3.0.4
# 171 - 177 MB of memory used booting rails before
11:24:33 ~/Code/manageiq (master) (2.2.5) + RAILS_ENV=production bin/rails r 'top = `/usr/bin/top -l 1 -pid #{Process.pid} | grep -E "ruby.+M"`; memory = top.split[7].to_i; puts memory'
177
11:24:43 ~/Code/manageiq (master) (2.2.5) + RAILS_ENV=production bin/rails r 'top = `/usr/bin/top -l 1 -pid #{Process.pid} | grep -E "ruby.+M"`; memory = top.split[7].to_i; puts memory'
171
11:25:31 ~/Code/manageiq (master) (2.2.5) + RAILS_ENV=production bin/rails r 'top = `/usr/bin/top -l 1 -pid #{Process.pid} | grep -E "ruby.+M"`; memory = top.split[7].to_i; puts memory'
177
@jrafanie
jrafanie / 0001_inline_test.rb
Last active May 31, 2016 21:09
Rails 5.0.0.rc1 throws NotImplementedError on update if select is missing target column or updated_* columns
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 'rails', '5.0.0.rc1'