Skip to content

Instantly share code, notes, and snippets.

View ryujignh's full-sized avatar

Ryuji Ganaha ryujignh

  • San Francisco Bay Area
View GitHub Profile
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)
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'
if @post.save
refirect_to posts_path
else
render :new
end
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"が保存をするというアクション。上書きしちゃうよ。
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
@ryujignh
ryujignh / counting
Last active October 29, 2015 02:07
def index(list)
empty = Hash.new
list.each_char.each_with_index do |letter, index|
empty[letter] ||= []
empty[letter] << index
end
empty
end
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>'