Skip to content

Instantly share code, notes, and snippets.

Avatar

tatsuo.sakurai tatsuosakurai

View GitHub Profile
@tatsuosakurai
tatsuosakurai / birthday_around_a_week_challenge.rb
Created May 15, 2019
ruby( ActiveSupportあり )で、誕生日の前後一週間かどうかを判定するメソッドを実装してください〜
View birthday_around_a_week_challenge.rb
# 準備
# `gem i activesupport`
# `gem i rspec`
# 実行
# `rspec birthday_around_a_week_challenge.rb`
# 実装
require 'active_support'
require 'active_support/core_ext'
# require 'byebug'
@tatsuosakurai
tatsuosakurai / birthday_test.rb
Last active May 16, 2019
誕生日の前後一週間かどうかを判定したい!
View birthday_test.rb
# 準備
# `gem i activesupport`
# `gem i rspec`
# 実行
# `rspec birthday_test.rb`
# 実装
require 'active_support'
require 'active_support/core_ext'
# require 'byebug'
@tatsuosakurai
tatsuosakurai / first_step_rspec.md
Last active Jun 4, 2019
RSpec 始めの一歩
View first_step_rspec.md

RSpec を使ってみよう ver.20190319

  • ペアでやってる方は、随時、気になってること、気づいたことをお話してください:)
  • $ はコマンドラインでの実行を表現しているだけなので、打たなくでOKです:)
  • rspec https://github.com/rspec/

1歩目

rspec-bird ディレクトリ作成してみる

$ mkdir rspec-bird
View Rails Samples
https://github.com/discourse/discourse
https://github.com/feedbin/feedbin
https://github.com/gitlabhq/gitlabhq
https://github.com/coderwall/coderwall-next
https://github.com/codecation/trailmix
https://github.com/thepracticaldev/dev.to
https://github.com/spree/spree
https://github.com/redmine/redmine
@tatsuosakurai
tatsuosakurai / railsguidesj2e
Created Apr 18, 2018
railsguides.jp → guides.rubyonrails.org
View railsguidesj2e
javascript:var d=document,u=d.URL,en="http://guides.rubyonrails.org",jp="https://railsguides.jp";d.location.href=u.replace(jp,en);
@tatsuosakurai
tatsuosakurai / railsguidesjp2guidesrororg
Last active Jul 8, 2017
Rails guide の日本語ページから英語ページに遷移するブックマークレット
View railsguidesjp2guidesrororg
javascript:var d=document,u=d.URL,en="http://guides.rubyonrails.org",jp="https://railsguides.jp";d.location.href=u.replace(jp,en);
View 積読解消合宿2015夏.md

TODO

  • 宿に21:30くらいに付く予定だけど晩御飯だしてもらえるか確認
  • コメント要確認↓

日程(予定)

  • 9/4金:夜20時東京駅(銀の鈴)集合、新幹線のチケット(20:26発 こだま687号(N700系)(名古屋行)
View title + url bookmarklet
javascript:var d=document,t=d.title,u=d.URL,i=d.createElement('input');i.value='['+t+']('+u+' )';d.body.appendChild(i);i.focus();i.select();
View gist:8f87ffe58a71ee0c5176
<% repo = Grit::Repo.new(Rails.root).head.name rescue nil %>
development:
adapter: mysql2
encoding: utf8
database: hoge_development<%= "_#{repo}" %>
@tatsuosakurai
tatsuosakurai / application.js
Last active Aug 29, 2015
JavaScript Setting for Rails Controller
View application.js
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD