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
#!/bin/bash | |
# Script para generar entorno simulado de cluster Swarm con 3 nodos | |
# Creación de maquina default (se utilizara como cliente ) | |
# docker-machine create -d virtualbox default | |
eval $(docker-machine env default) | |
# Lanzamos swarm desde maquina default | |
SWARM_TOKEN=$(docker run swarm create) |
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
# File: config/initializers/date.rb | |
# Parse date using Rails I18n or Ruby parse method if it failed. | |
# Reference https://gist.github.com/179712 | |
module DateTimeI18nParser | |
module ClassMethods | |
def _parse_with_i18n(str, format = :default) | |
format ||= :default | |
date = self._strptime(str, I18n.translate("#{self.name.downcase}.formats.#{format}")) || _parse_without_i18n(str) | |
date[:year] += increment_year(date[:year].to_i) if date[:year] |