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()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p (1..5) === 3 #=> true レシーバは Range クラスのインスタンスだから、=== 演算子は引数が自身の範囲内に含まれるかを判定 | |
p 3 === (1..5) #=> false レシーバは Fixnum クラスのインスタンスだから、=== 演算子は数値として等しいかを判定 | |
p /おつかれ/ === 'おつかれさまです' #=> true レシーバは Regexp クラスのインスタンスだから、=== 演算子は引数の文字列がマッチするか判定 | |
p 'おつかれさまです' === /おつかれ/ #=> false レシーバは String クラスのインスタンスだから、=== 演算子は同値判定 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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('') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
$ bundle config local.GEM_NAME /path/to/local/git/repository
Gemfile
gem 'GEM_NAME', git: '[email protected]:GEM_NAME', branch: 'master'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= simple_form_for(@user, html: { role: 'form' }) do |f| %> | |
<% end %> |
Open http://awspolicygen.s3.amazonaws.com/policygen.html
Select Policy Type
- Select Type of Policy:
S3 Bucket Policy
Step 2: Add Statement(s)
$ grep -v -e '#' -e '^$' filepath
via: http://d.hatena.ne.jp/rx7/20090505/p1 thanks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listen=YES | |
anonymous_enable=NO | |
local_enable=YES | |
write_enable=YES | |
dirmessage_enable=YES | |
use_localtime=YES | |
xferlog_enable=YES | |
connect_from_port_20=YES | |
secure_chroot_dir=/var/run/vsftpd/empty | |
pam_service_name=ftp |