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
GEM | |
remote: https://rubygems.org/ | |
specs: | |
activesupport (4.2.0) | |
i18n (~> 0.7) | |
json (~> 1.7, >= 1.7.7) | |
minitest (~> 5.1) | |
thread_safe (~> 0.3, >= 0.3.4) | |
tzinfo (~> 1.1) | |
faraday (0.9.1) |
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
[general] | |
# Path to a Public key to install on servers. If a usable key has not | |
# been installed on the remote servers the user will be prompted for a | |
# password and this key will be installed so the password will not be | |
# required again | |
# CONFIG_SSH_KEY=/root/.ssh/id_rsa.pub | |
# Set a default password everywhere. The default password will be | |
# overriden by whatever password is set for each individual service or |
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
# 256色対応 | |
set-option -g default-terminal xterm-256color | |
# 設定リロード | |
bind r source-file ~/.tmux.conf \; display-message "Reload Config!!" | |
# デフォルトの Prefix(C-b)を解除 | |
unbind C-b | |
# Prefix を設定 |
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
"---------------------set--------------------- | |
set encoding=utf-8 | |
set fileencoding=utf-8 | |
set fileencodings=utf-8,euc-jp,iso-2022-jp,cp932 | |
set autoindent | |
set smartindent | |
set tabstop=2 | |
set shiftwidth=2 | |
set expandtab | |
set number |
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
#month_hash = {"1"=>31, "2"=>28, "2u"=>29, "3"=>31, "4"=>31, "5"=>31, "6"=>30, "7"=>31, "8"=>31, "9"=>30, "10"=>31, "11"=>30, "12"=>31} | |
#youbi_hash = {"1"=>"Mon", "2"=>"Tue", "3"=>"Wed", "4"=>"Thr", "5"=>"Fri", "6"=>"Sat", "7"=>"Sun"} | |
ad = 1900 | |
month = 1 | |
day = 1 | |
youbi = 1 | |
count = 0 | |
while ad <= 2000 | |
while month <= 12 |
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
num_english = Hash.new | |
num_english = { | |
0 => "", | |
1 => "one", | |
2 => "two", | |
3 => "three", | |
4 => "four", | |
5 => "five", | |
6 => "six", |
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
ans = 0 | |
def fact num | |
(1..num).to_a.inject(1){|prd, n| prd * n} | |
end | |
num_ary = fact(100).to_s.split("").map{|i| i.to_i} | |
ans = num_ary.inject(0){|sum, n| sum + n} | |
p ans |
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
ans = 0 | |
num = (2**1000).to_s.split("").map{|i| i.to_i} | |
ans = num.inject(0){|sum, n| sum + n} | |
p ans |
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
def fact num | |
(1..num).to_a.inject(1){|prd, n| prd * n} | |
end | |
p fact(40) / (fact(20) * fact(20)) |
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
tmp = 0 | |
ary_size = 0 | |
ans = 0 | |
1000000.downto(1) do |num| | |
num_ary = Array.new | |
tmp = num | |
while num != 1 | |
if num % 2 == 0 | |
num = num / 2 |
NewerOlder