cd 作業ディレクトリ
mkdir hmrb
cd hmrb
vagrant init
# centosのboxが無い場合インストール
vagrant box install http://centos6.4x86_64(適当) centos6.4x86_64 <- コマンドうろ覚え・・・
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 FibonacciNumber | |
| def get x | |
| case x | |
| when 0, 1 | |
| return 1 | |
| else | |
| get(x - 2) + get(x - 1) | |
| end | |
| end | |
| end |
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
| module ValidInvalid | |
| extend ActiveSupport::Concern | |
| included do | |
| # validメソッドが存在したら、その結果を反転させて返す | |
| def method_missing(method, *args) | |
| if method =~ /invalid?/ | |
| name_str = method.to_s |
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
| =begin | |
| itamaeについて | |
| http://qiita.com/toritori0318/items/00ea2a75c8321aaf9ef6 | |
| ドキュメント | |
| http://itamae.kitchen/docs.html#execute-resource | |
| wiki | |
| https://github.com/itamae-kitchen/itamae/wiki |
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
| #include <netdb.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <errno.h> | |
| #define CANARY "in_the_coal_mine" | |
| struct { | |
| char buffer[1024]; |
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
| # yuto-ogi [11:53:22] | |
| $ npm install bower -g | |
| npm ERR! Darwin 14.0.0 | |
| npm ERR! argv "node" "/usr/local/bin/npm" "install" "bower" "-g" | |
| npm ERR! node v0.10.36 | |
| npm ERR! npm v2.3.0 | |
| npm ERR! path /Users/yuto-ogi/.npm/graceful-fs/3.0.5 | |
| npm ERR! code EACCES | |
| npm ERR! errno 3 |
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
| <td><%= link_to 'Edit', edit_user_path(user) %></td> | |
| ↓ | |
| <td><%= link_to 'Edit', users_path(id: user.id) %></td> |
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
| # line 259 | |
| def destroy | |
| clear | |
| save | |
| end |
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
| gem "qiita-markdown" |
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
| require "pp" | |
| require "yaml" | |
| list = [ | |
| {name: "server105", domain: "server105.frsrv.jp" , ssh: "sample ssh key"}, | |
| {name: "server104", domain: "server104.frsrv.jp" , ssh: "sample ssh key"}, | |
| {name: "server102", domain: "server102.frsrv.jp" , ssh: "sample ssh key"} ] | |
| data = YAML.load(str) |