3月下旬~4月くらいにGit道場を開催したいと思います。
講義メインではなくてなるべく手を動かす時間をたくさんとり、参加者全員が”怖がらずにmerge/rebaseをできるようになる”というのが目標です。
このイベントに実行委員として参加してくれる方は、下記の形式のメールを送信してください。
To: git-dojo_at_qwik.jp
Cc: ayumu.aizawa_at_gmail.com
# stage の操作 | |
git add . # stage に加える | |
git add -p # stage にインタラクティブに加える | |
git add -N . # stage にファイルだけ加える | |
git rm hoge/hoge.rb # stage から消す | |
git rm -f hoge/hoge.rb # stage から無理矢理消す、先にファイルを消してしまった場合 | |
git mv hoge/hoge.rb hoge/hoge2.rb # ファイル名変える | |
# 差とか状態を確認する系 | |
git diff # HEADとunstagedの差分を確認する |
@naoty_k https://gist.github.com/2859031 | |
@june29 https://gist.github.com/2856957 | |
@Kirika_K2 https://gist.github.com/2856695 | |
@r7kamura https://gist.github.com/2856841 | |
@sugamasao https://gist.github.com/2856811 | |
@naoty_k http://gist.github.com/2856817 | |
@kei_s https://gist.github.com/2856767 | |
@tdtds https://gist.github.com/2856767 | |
@ymorimo https://gist.github.com/2856767 | |
@nari3 https://gist.github.com/2856773 |
# Support for Rspec / Capybara subdomain integration testing | |
# Make sure this file is required by spec_helper.rb | |
# | |
# Sample subdomain test: | |
# it "should test subdomain" do | |
# switch_to_subdomain("mysubdomain") | |
# visit root_path | |
# end | |
DEFAULT_HOST = "lvh.me" |
class ActionDispatch::Routing::Mapper | |
def draw(routes_name) | |
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
end | |
end | |
BCX::Application.routes.draw do | |
draw :api | |
draw :account | |
draw :session |
namespace :db do | |
def local_database?(config, &block) | |
if config['host'].in?(['127.0.0.1', 'localhost', '192.168.30.1']) || config['host'].blank? | |
yield | |
else | |
$stderr.puts "This task only modifies local databases. #{config['database']} is on a remote host." | |
end | |
end | |
end |
SPモードメールプロトコル | |
------------------------ | |
< サーバーのレスポンス | |
> クライアントのリクエスト | |
--- | |
< 220 ESMTP Server Ready | |
> EHLO mail.spmode.ne.jp |
.highlight { background-color: #ffffcc } | |
.highlight .c { color: #586E75 } /* Comment */ | |
.highlight .err { color: #93A1A1 } /* Error */ | |
.highlight .g { color: #93A1A1 } /* Generic */ | |
.highlight .k { color: #859900 } /* Keyword */ | |
.highlight .l { color: #93A1A1 } /* Literal */ | |
.highlight .n { color: #93A1A1 } /* Name */ | |
.highlight .o { color: #859900 } /* Operator */ | |
.highlight .x { color: #CB4B16 } /* Other */ | |
.highlight .p { color: #93A1A1 } /* Punctuation */ |
# For Sinatra, put this a the top-level Rakefile directly: | |
namespace :db do | |
desc "Use model properties to auto-migrate" | |
task :automigrate => :environment do | |
Dir[File.expand_path 'app/models/**.rb', File.dirname(__FILE__)].each do |model| | |
require model | |
klass = File.basename(model.sub(/\.rb$/,'')).classify.constantize | |
puts "== Migrating #{klass.name}" | |
klass.auto_upgrade! | |
end |