Skip to content

Instantly share code, notes, and snippets.

View takuyan's full-sized avatar
🎯
Focusing

Takuya Kato / katton takuyan

🎯
Focusing
View GitHub Profile
# # if Zero
# = switch_if(0) do
# h1
# ...
# # => <div class='zero' id='zero'><h1>...</h1></div>
#
# # if One
# = switch_if(1) do
# h1
# ...
@takuyan
takuyan / application_helper.rb
Created September 25, 2013 05:16
FontAwesomeを使うときは、ApplicationHelperにコレを登録しておくと便利。 どんどんwhen句を増やせば良い。データごとのアイコンを一元管理。 メリット:アイコン名をハードコーディングしなくて済む
module ApplicationHelper
def icon_name_for(name)
sym_name = name.to_sym
case sym_name
when :home
'icon-dashboard'
when :team
'icon-group'
when :content
'icon-pencil'
~ ‹1.9.3-p392› $ gem i capybara
Fetching: capybara-2.1.0.gem (100%)
IMPORTANT! Some of the defaults have changed in Capybara 2.1. If you're experiencing failures,
please revert to the old behaviour by setting:
Capybara.configure do |config|
config.match = :one
config.exact_options = true
config.ignore_hidden_elements = true
config.visible_text_only = true
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");