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 Sample | |
| attr_accessor :method | |
| def initialize | |
| @method = :get | |
| end | |
| def self.get | |
| new.perform | |
| end | |
| def perform | |
| send("perform_#{method}") |
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
| mkdir ~/.vim | |
| cd ~/.vim/ | |
| git clone http://github.com/tpope/vim-pathogen.git | |
| # need following in .vimrc | |
| # call pathogen#runtime_append_all_bundles() | |
| mv ./vim-pathogen/* ./ | |
| rm -rf ./vim-pathogen/ | |
| mkdir ~/.vim/bundle | |
| cd ~/.vim/bundle | |
| git clone http://github.com/Shougo/vimproc.git |
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 Array | |
| def with_header(header) | |
| Hash[*header.zip(self).flatten] | |
| 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 YMD | |
| def year | |
| self.split("-")[0] | |
| end | |
| def month | |
| self.split("-")[1] | |
| end | |
| def day | |
| self.split("-")[2] | |
| 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
| require 'openssl' | |
| require 'uri' | |
| require 'net/http' | |
| require 'yaml' | |
| require 'pp' | |
| def random_str | |
| a = ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a | |
| (Array.new(16){a[rand(a.size)]}).join | |
| 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
| require 'openssl' | |
| require 'uri' | |
| require 'net/http' | |
| require 'yaml' | |
| require 'pp' | |
| app_info = YAML.load_file 'consumer_info.yml' | |
| CONSUMER_KEY = app_info['consumer_key'] | |
| CONSUMER_SECRET = app_info['consumer_secret'] | |
| OAUTH_TOKEN = app_info['oauth_token'] |
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
| call pathogen#runtime_append_all_bundles() |
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
| Host gate.com | |
| ForwardAgent yes | |
| IdentityFile ~/.ssh/id_rsa | |
| User test | |
| Host host | |
| ForwardAgent yes | |
| IdentityFile ~/.ssh/id_rsa | |
| ProxyCommand ssh -A gate.com nc -w 10 %h %p |
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
| [user] | |
| name = username | |
| email = emailaddress | |
| [core] | |
| editor = vim | |
| [color] | |
| ui = true | |
| [alias] | |
| st = status | |
| co = checkout |
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
| if [ -f ~/.bashrc ]; then | |
| . ~/.bashrc | |
| fi | |
| export LANG=ja_JP.UTF-8 |
OlderNewer