- rack-mini-profiler: Swiss-army knife profiler for rails apps
- flamegraph: Nice and useful timeline visualizer for debugging long methods.
- memory_profiler: Easy to use memory profiler for memory consuming methods.
- heapy: Memory dump analyzer for advanced memory analysis.
- foreman-tracer: great tool for unintrusive tracing by lzap.
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
arel = Nic::Base.arel_table | |
like_ast = arel[:identifier].matches(pattern, InterfaceCleaner::ESCAPE_CHAR, true) | |
Nic::Base.where(like_ast).pluck(:identifier) |
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
class InterfaceCleaner | |
include ActiveRecord::Sanitization | |
ESCAPE_CHAR = '\\' | |
def self.nic_pattern_to_like(nic) | |
sanitize_sql_like(nic, ESCAPE_CHAR).tr('*', '%') | |
end | |
def self.ignored_interface_like_patterns |
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
Nic::Base.where('identifier LIKE ?', pattern) |
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
class ErbStrip | |
ERB_REGEX = /(?<start_tag><%[-=]?)(?<script>([^#]).*?)(?<end_tag>-?%>)/m | |
def initialize(source) | |
@source = source | |
end | |
def strip | |
out = '' | |
current_position = 0 |
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
rubygems = @sources.rubygems_sources.first | |
rubygems.replace_remotes([URI('http://my_new_local_gemsource:8808')]) |
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
diff --git a/Gemfile b/Gemfile | |
index b86d9ec..9eb4275 100644 | |
--- a/Gemfile | |
+++ b/Gemfile | |
@@ -22,6 +22,14 @@ gem 'deep_cloneable', '~> 2.0' | |
gem 'foreigner', '~> 1.4.2' | |
gem 'validates_lengths_from_database', '~> 0.2.0' | |
+gem 'public_suffix', '<= 1.4.6' | |
+gem 'nokogiri', '<= 1.6.8' |
Why do we need indifferent_hash while saving?
"/home/shim/Documents/foreman/dynflow/lib/dynflow/utils.rb:60:in `indifferent_hash'",
"/home/shim/Documents/foreman/dynflow/lib/dynflow/persistence_adapters/sequel.rb:268:in `extract_metadata'",
"/home/shim/Documents/foreman/dynflow/lib/dynflow/persistence_adapters/sequel.rb:226:in `prepare_record'",
"/home/shim/Documents/foreman/dynflow/lib/dynflow/persistence_adapters/sequel.rb:236:in `save'",
"/home/shim/Documents/foreman/dynflow/lib/dynflow/persistence_adapters/sequel.rb:125:in `save_action'",