$ bundle config local.GEM_NAME /path/to/local/git/repository
Gemfile
gem 'GEM_NAME', git: '[email protected]:GEM_NAME', branch: 'master'
<%= simple_form_for(@user, html: { role: 'form' }) do |f| %> | |
<% end %> |
$ bundle config local.GEM_NAME /path/to/local/git/repository
Gemfile
gem 'GEM_NAME', git: '[email protected]:GEM_NAME', branch: 'master'
class C1 | |
def method | |
protected_method | |
self.protected_method | |
C1.new.protected_method | |
private_method | |
self.private_method rescue puts "ERROR self.private_method #{self.class.name}" | |
C1.new.private_method rescue puts "ERROR C1.new.private_method #{self.class.name}" | |
end |
Python 3.4.0 (default, Mar 26 2014, 11:08:39)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from time import time
>>> time()
1403076335.497517
>>> time() == time()
False
>>> time() is time()
showKonami = -> | |
alert 'KONAMI' | |
inputs = [] | |
input = (e) -> | |
inputs.push(e.keyCode) | |
if e.keyCode is 65 | |
len = inputs.length | |
if inputs[len - 10] is 38 and inputs[len - 1] is 65 | |
if [38, 38, 40, 40, 37, 39, 37, 39, 66, 65].join('') is inputs.slice(len - 10, len).join('') |
<!DOCTYPE html> | |
<script> | |
function trackEvent(self, category, action, label) { | |
var href = self.href; | |
ga('send', 'event', category, action, label, { 'hitCallback': | |
function() { | |
if (href) { | |
document.location = href; | |
} |
p (1..5) === 3 #=> true レシーバは Range クラスのインスタンスだから、=== 演算子は引数が自身の範囲内に含まれるかを判定 | |
p 3 === (1..5) #=> false レシーバは Fixnum クラスのインスタンスだから、=== 演算子は数値として等しいかを判定 | |
p /おつかれ/ === 'おつかれさまです' #=> true レシーバは Regexp クラスのインスタンスだから、=== 演算子は引数の文字列がマッチするか判定 | |
p 'おつかれさまです' === /おつかれ/ #=> false レシーバは String クラスのインスタンスだから、=== 演算子は同値判定 |
require 'rack' | |
class HelloRack | |
def call(env) | |
[200, { 'Content-Type' => 'text/html' }, ['Hello Rack!']] | |
end | |
end | |
run HelloRack.new |
require 'rubygems' | |
require 'rails' | |
require 'active_support/railtie' | |
require 'action_dispatch/railtie' | |
require 'action_controller/railtie' | |
class SingleFile < Rails::Application | |
config.eager_load = true | |
config.cache_classes = true |
def case1 | |
i = 1 | |
case i | |
when 1 | |
5 | |
end + 10 | |
end | |
def case2 |