Skip to content

Instantly share code, notes, and snippets.

View takuyan's full-sized avatar
🎯
Focusing

Takuya Kato / katton takuyan

🎯
Focusing
View GitHub Profile
ubuntu@ip-99-999-999-99:~$ sudo passenger-install-nginx-module
Welcome to the Phusion Passenger Nginx module installer, v3.0.19.
This installer will guide you through the entire installation process. It
shouldn't take more than 5 minutes in total.
Here's what you can expect from the installation process:
1. This installer will compile and install Nginx with Passenger support.
2. You'll learn how to configure Passenger in Nginx.
~/rails ‹2.0.0-p0› $ rails new todo -T
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/images/rails.png
create app/assets/javascripts/application.js
~ ‹2.0.0-p0› $ rbenv install 1.9.3-p392
Downloading yaml-0.1.4.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/36c852831d02cf90508c29852361d01b
Installing yaml-0.1.4...
Installed yaml-0.1.4 to /Users/takuyan/.rbenv/versions/1.9.3-p392
Downloading ruby-1.9.3-p392.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz
Installing ruby-1.9.3-p392...
~ ‹1.9.3-p374› $ rbenv install 2.0.0-p0
Downloading openssl-1.0.1e.tar.gz...
-> https://www.openssl.org/source/openssl-1.0.1e.tar.gz
Installing openssl-1.0.1e...
Installed openssl-1.0.1e to /Users/takuyan/.rbenv/versions/2.0.0-p0
Downloading ruby-2.0.0-p0.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
Installing ruby-2.0.0-p0...
Installed ruby-2.0.0-p0 to /Users/takuyan/.rbenv/versions/2.0.0-p0
~ ‹1.9.3-p385› $ rbenv install 1.9.3-p392
Downloading yaml-0.1.4.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/36c852831d02cf90508c29852361d01b
Installing yaml-0.1.4...
Installed yaml-0.1.4 to /Users/takuyan/.rbenv/versions/1.9.3-p392
Downloading ruby-1.9.3-p392.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz
Installing ruby-1.9.3-p392...
@takuyan
takuyan / on.js
Last active December 11, 2015 20:18
$("body")
.on('click', '#binder_open', function(){
$(this).addClass("hide");
$("#binder").addClass("open");
$("html,body").animate({ scrollTop: 0}, 600);
})
.on("click", "#binder .binder_close, #footer_close", function(){
$("#binder_open").removeClass("hide");
$("#binder").removeClass("open");
});
@takuyan
takuyan / live.js
Last active December 11, 2015 20:18
// クリックすると何かが開く程度の認識で良いです
$("#binder_open").live('click', function(){
$(this).addClass("hide");
$("#binder").addClass("open");
$("html,body").animate({ scrollTop: 0}, 600);
});
// クリックすると何かが閉じる程度の認識で良いです
$("#binder .binder_close, #footer_close").live("click", function(){
$("#binder_open").removeClass("hide");
$("#binder").removeClass("open");
# spec/factories/users.rb
include ActionDispatch::TestProcess # 追加
FactoryGirl.define do
factory :user do
name 'Takuya Kato'
avatar { fixture_file_upload("#{Rails.root}/spec/files/rails.png", "image/png") }
end
end
describe User do
it { should have_attached_file(:avatar) }
it { should validate_attachment_presence(:avatar) }
it { should validate_attachment_content_type(:avatar).
allowing('image/png', 'image/gif').
rejecting('text/plain', 'text/xml') }
it { should validate_attachment_size(:avatar).
less_than(2.megabytes) }
end
# spec/spec_helper.rb
require "paperclip/matchers"
RSpec.configure do |config|
#
# etc...
#
# 追加
config.include Paperclip::Shoulda::Matchers