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
# initializers/factory_bot.rb | |
# This needs to be extended in any factory you want its methods in, e.g.: | |
# factory :my_factory do | |
# extend FactoryBotEnhancements | |
# change_factory_to_find_or_create | |
# end | |
# FactoryBot.create(:my_factory) # creates with default attributes | |
# FactoryBot.create(:my_factory) # finds with the same default attributes |
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
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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
#https://gist.github.com/1351456 | |
#based on http://gist.github.com/1236567.git | |
class BootstrapFormBuilder < ActionView::Helpers::FormBuilder | |
def get_error_text(object, field, options) | |
if object.nil? || options[:hide_errors] | |
"" | |
else | |
errors = object.errors[field.to_sym] | |
if errors.empty? then "" else errors.first 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
var win = Ti.UI.createWindow({ | |
orientationModes:[1,2,3,4] | |
}); | |
var scrollView = Ti.UI.createScrollView({ | |
top:0, | |
bottom:0, | |
right:-1, | |
left:-1, | |
backgroundColor:'blue', |