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
%w( | |
assert | |
assert_block | |
assert_empty | |
assert_equal | |
assert_in_delta | |
assert_in_epsilon | |
assert_includes | |
assert_instance_of | |
assert_kind_of |
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
# basic | |
'class': | |
'prefix': 'class' | |
'body': """ | |
class ${1:name} | |
end | |
""" | |
# meta_pro |
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
#import <Foundation/Foundation.h> | |
@class Fuga; | |
@interface Hoge : NSObject{ | |
Fuga *fugas[4]; | |
} | |
@end |
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
>> w.worker_pids | |
=> ["26275", "26297", "31799"] | |
>> w = Resque::Worker.all.last | |
=> #<Worker u16MBA.local:26275:default> | |
>> w.to_s | |
=> "u16MBA.local:26275:default" | |
>> w.pid | |
=> 32092 | |
>> | |
>> Process.pid |
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
a = %w(a abc abcdef) | |
len = a.map(&:length).max | |
puts a.map {|e| e.rjust(len) } |
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
>> y User.find() | |
ArgumentError: wrong number of arguments (1 for 0) | |
from /Users/u16suzu/.rvm/gems/ruby-1.9.2-p290/gems/mongorilla-0.8.3/lib/mongorilla/cursor.rb:23:in `to_yaml' | |
from /Users/u16suzu/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:55:in `accept' | |
from /Users/u16suzu/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/visitors/yaml_tree.rb:36:in `<<' | |
from /Users/u16suzu/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:178:in `block in dump_stream' | |
from /Users/u16suzu/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:177:in `each' | |
from /Users/u16suzu/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:177:in `dump_stream' | |
from /Users/u16suzu/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/core_ext.rb:34:in `psych_y' | |
from (irb):43 |
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
>> h = {:a => 1, :b => 2, :c => 3} | |
=> {:a=>1, :b=>2, :c=>3} | |
>> y h | |
--- | |
:a: 1 | |
:b: 2 | |
:c: 3 | |
=> nil |
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
source 'http://rubygems.org' | |
group :development, :test do | |
gem 'rspec-rails', ">= 2.0.0.beta" | |
gem 'rspec' | |
gem 'guard-bundler' | |
gem 'guard-rspec' | |
gem 'rb-fsevent' | |
gem 'growl' | |
end |
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
belongs_to | |
Let‘s break out some more monkeys and pirates. | |
### in pirates.yml | |
reginald: | |
id: 1 | |
name: Reginald the Pirate | |
monkey_id: 1 |
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
***each_cons(n){ |n| p n } | |
[1, 2, 3, 4, 5].each_cons(n){ |n| p n } | |
***each_slice(n){ |n| p n } | |
n要素ずつブロックに渡して繰り返す | |
***each_with_index{ |n, index| p n, index } | |
***each_with_object わからない | |
***drop a.drop(3) 3要素取り除いた配列を返す |
NewerOlder