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
if ! $(psql template1 -c 'SHOW SERVER_ENCODING' | grep -q UTF8); then | |
psql postgres -c "update pg_database set datallowconn = TRUE where datname = 'template0';" | |
psql template0 -c "update pg_database set datistemplate = FALSE where datname = 'template1';" | |
psql template0 -c "drop database template1;" | |
psql template0 -c "create database template1 with template = template0 encoding = 'UTF8';" | |
psql template0 -c "update pg_database set datistemplate = TRUE where datname = 'template1';" | |
psql template1 -c "update pg_database set datallowconn = FALSE where datname = 'template0';" | |
fi |
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
en: | |
activemodel: | |
errors: | |
messages: | |
invalid_url: "must be a valid URL" |
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
# Deploy and rollback on Heroku in staging and production | |
namespace :deploy do | |
PRODUCTION_APP = 'YOUR_PRODUCTION_APP' | |
STAGING_APP = 'YOUR_STAGING_APP' | |
REMOTE = ENV["REMOTE_HOST"] || "[email protected]" | |
def heroku_cmd(cmd) | |
Bundler.with_clean_env do | |
sh "heroku #{cmd}" |
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
jQuery ($) -> | |
$("div.control-group").focusout -> | |
$this = $(this) | |
if !$this.hasClass("error") | |
$this.addClass("success") | |
ClientSideValidations.formBuilders['SimpleForm::FormBuilder'].wrappers.bootstrap = | |
add: (element, settings, message) -> | |
wrapper = element.closest(".#{settings.wrapper_class}") | |
if element.data('valid') != false |
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
Rehearsal ------------------------------------------------------------- | |
INSERTION STATIC : Tree 0.334000 0.000000 0.334000 ( 0.334000) | |
INSERTION STATIC : Regexp 0.244000 0.000000 0.244000 ( 0.244000) | |
MATCHING STATIC : Tree 1.297000 0.000000 1.297000 ( 1.297000) | |
MATCHING STATIC : Regexp 13.382000 0.000000 13.382000 ( 13.382000) | |
--------------------------------------------------- total: 15.257000sec | |
user system total real | |
INSERTION STATIC : Tree 0.045000 0.000000 0.045000 ( 0.045000) | |
INSERTION STATIC : Regexp 0.106000 0.000000 0.106000 ( 0.106000) |
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 Address # Our custom, embedded-value type | |
accessor :address => String | |
accessor :address_2 => String | |
accessor :city => String | |
accessor :state => String | |
accessor :zip_code => String | |
orm.map_type do |signature, types| | |
signature.from [self] | |
signature.typecast_left method(:__load__) |