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 | |
remote: https://rubygems.org/ | |
specs: | |
actionmailer (4.2.0) | |
actionpack (= 4.2.0) | |
actionview (= 4.2.0) | |
activejob (= 4.2.0) | |
mail (~> 2.5, >= 2.5.4) | |
rails-dom-testing (~> 1.0, >= 1.0.5) | |
actionpack (4.2.0) |
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
source 'https://rubygems.org' | |
gem 'rails', '4.2.0' | |
gem 'react-rails', '~> 1.5' | |
gem 'rails-api' | |
gem 'puma' | |
gem 'pg' | |
gem 'oauth' | |
gem 'jwt' | |
gem 'ffaker' |
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 @post.save | |
refirect_to posts_path | |
else | |
render :new | |
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 'rubygems' | |
require 'rest-client' | |
require 'open-uri' | |
#Writeのやり方(How to write) | |
wiki_url = "http://en.wikipedia.org/" | |
wiki_local_filename = "wiki-page.html" | |
#Wikipediaのトップページを取得して、保存するメソッド | |
#"w"が保存をするというアクション。上書きしちゃうよ。 |
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
def redeem_bottles(bottles) | |
redeems_loop = 0 | |
total_redeems = 0 | |
while bottles >= 2 do | |
redeem_bottles = (bottles / 2) | |
redeems_loop += redeem_bottles | |
puts total_redeems += redeems_loop | |
break | |
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
def index(list) | |
empty = Hash.new | |
list.each_char.each_with_index do |letter, index| | |
empty[letter] ||= [] | |
empty[letter] << index | |
end | |
empty | |
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
Last login: Tue Oct 27 10:21:02 on ttys004 | |
MacBook-Pro-2:lighthouse RyujiGanaha$ irb | |
irb(main):001:0> ls | |
NameError: undefined local variable or method `ls' for main:Object | |
from (irb):1 | |
from /Users/RyujiGanaha/.rbenv/versions/2.2.3/bin/irb:11:in `<main>' | |
irb(main):002:0> xit | |
NameError: undefined local variable or method `xit' for main:Object | |
from (irb):2 | |
from /Users/RyujiGanaha/.rbenv/versions/2.2.3/bin/irb:11:in `<main>' |
NewerOlder