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
require 'dry-validation' | |
SCHEMA = Dry::Validation.Schema do | |
configure do | |
config.input_processor = :sanitizer | |
def self.messages | |
Dry::Validation::Messages.default.merge(en: { errors: { unique?: "oops not unique" }}) | |
end |
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
require 'dry-validation' | |
SCHEMA = Dry::Validation.Schema do | |
configure do | |
config.input_processor = :sanitizer | |
def self.messages | |
Dry::Validation::Messages.default.merge(en: { errors: { unique?: "oops not unique" }}) | |
end |
Get boot2docker working with nfs instead of vboxsf.
Tested on:
- Boot2Docker-cli version: v1.6.0
Git commit: 9894ae9
- Boot2Docker-cli version: v1.6.2
Git commit: cb2c3bc
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
require 'transproc/all' | |
require 'addressable/uri' | |
## | |
# Convert string keys to symbols | |
# | |
transform = Transproc(:symbolize_keys) | |
data = { | |
'name' => 'Mark Rickerby', |
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
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source. | |
# Will include all hosts the playbook is run on. | |
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html | |
- name: "Build hosts file" | |
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present | |
when: hostvars[item].ansible_default_ipv4.address is defined | |
with_items: groups['all'] |
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
# rails3_bootstrap.rb | |
# | |
# rails new project --skip-test-unit -m rails3_bootstrap.rb | |
require 'rbconfig' | |
HOST_OS = RbConfig::CONFIG['host_os'] | |
# Limpeza | |
#------------------------------------------------------------------------------- | |
say("Limpando arquivos", :yellow) |