# coding: utf-8
require 'benchmark'
module IncludeMethod
##
# other instance method include your class
def include_instance_method_org(instance, method_names)
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
$ docker-machine create -d virtualbox --virtualbox-import-boot2docker-vm boot2docker-vm docker-vm |
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
$ git log --graph |
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
$ git flow init | |
Branch name for production releases: [master] | |
Branch name for "next release" development: [develop] | |
Feature branches? [feature/] | |
Release branches? [release/] | |
Hotfix branches? [hotfix/] | |
Support branches? [support/] | |
Version tag prefix? [] v1 |
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
array = [1, 2, 3] | |
# The `*` is interpreted as a splat operator but it could possibly be | |
# a `*` method invocation (i.e. `do_something.*(array)`). | |
do_something *array | |
# With parentheses, there's no ambiguity. | |
do_something(*array) |
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
# coding: utf-8 | |
require 'logger' | |
require 'json' | |
ENV["TZ"] = "Asia/Tokyo" | |
## | |
# 自作logger class | |
class MyLogger < Logger |
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
# yum groupinstall "Development Tools" |
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
# coding: utf-8 | |
require 'singleton' | |
module CustomStrategy | |
class AutoIncrement | |
include Singleton |
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
module FactoryGirl | |
module Strategy | |
class Build | |
def association(runner) | |
runner.run | |
end | |
def result(evaluation) | |
evaluation.object.tap do |instance| | |
evaluation.notify(:after_build, instance) |
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
result = model_module.import instance_arr | |
if !result.failed_instances.blank? | |
logger.warn(result.failed_instances) | |
end |