Skip to content

Instantly share code, notes, and snippets.

View ashrafuzzaman's full-sized avatar

A.K.M. Ashrafuzzaman ashrafuzzaman

View GitHub Profile
@ashrafuzzaman
ashrafuzzaman / swarm-create
Last active January 26, 2017 18:09 — forked from prologic/swarm-create
bash script to create docker swarm cluster with docker machine and virtualbox
#!/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)
# 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]