This file contains hidden or 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
#!/bin/bash | |
# It is probably redundant if you set settings mentioned in https://gist.github.com/zekefast/42273658939724ba7c7a . | |
# But anyway it will not hurt anybody (sure if you are not putting your production database to RAM :)). | |
# | |
# Look for more detailed description in follow articles: | |
# - http://blog.vergiss-blackjack.de/2011/02/run-postgresql-in-a-ram-disk/ | |
# | |
# ATTENTION: | |
# DO NOT apply this approach if you store important data in postgresql cluster, because that could cause |
This file contains hidden or 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
# PostgreSQL configuration tuning to improve tests performance of database interactions. | |
# Look for more detailed description in follow articles: | |
# - http://rhaas.blogspot.com/2010/06/postgresql-as-in-memory-only-database_24.html | |
# | |
# ATTENTION: | |
# Before appling those settings ensure that you have no important data in your cluster, because those settings | |
# could cause problems on your production database in case of appliance. | |
# | |
# Ensure follow settings have given values. |
This file contains hidden or 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 Select2Input < SimpleForm::Inputs::CollectionSelectInput | |
def input | |
options[:include_hidden] ||= false | |
options[:include_blanks] ||= false | |
options[:input_html][:id] ||= "#{@builder.options[:as]}_#{attribute_name}" | |
dom_selector = "##{options[:input_html][:id]}" | |
if select2_options = options.delete(:select2) | |
options[:collection] = [] + Array(@builder.object.send(attribute_name)) | |
end |
This file contains hidden or 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
# Allows to run GC less frequently which is significantly speed up specs running. | |
# Look for more detailed description in follow articles: | |
# - http://www.rubyenterpriseedition.com/documentation.html (Chapter 4.2: "Garbage collector performance tuning") | |
# - http://snaprails.tumblr.com/post/241746095/rubys-gc-configuration | |
# Initial number of heap slots. It also represents the minimum number of slots, at all times (default: 10000) | |
#export RUBY_HEAP_MIN_SLOTS=1000000 # for Rubies < 2.1 | |
export RUBY_GC_HEAP_INIT_SLOTS=1000000 # for Rubies >= 2.1.0 | |
# The number of new slots to allocate when all initial slots are used (default: 10000) |