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
{ | |
"color_scheme": "Packages/Theme - Flatland/Flatland Monokai.tmTheme", | |
"draw_white_space": "all", | |
"flatland_sidebar_tree_xsmall": true, | |
"flatland_square_tabs": true, | |
"highlight_line": true, | |
"highlight_modified_tabs": true, | |
"highlight_trailing_spaces_color_name": "invalid", | |
"ignored_packages": | |
[ |
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
{ | |
"installed_packages": | |
[ | |
"Abacus", | |
"BracketHighlighter", | |
"Creation Platform - KL Language Support", | |
"Gist", | |
"GitGutter", | |
"Package Control", | |
"rbenv", |
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
# display remote_branch | |
gir branch -r | |
# clone remote_branch on local | |
git checkout 'branch_name' origin/'branch_name' |
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
describe vs. context in rspec | |
http://lmws.net/describe-vs-context-in-rspec | |
In Rspec world, you often see people using both “describe” blocks and “context” blocks together, like this | |
describe "launch the rocket" do | |
context "all ready" do | |
end | |
context "not ready" do |
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
bundle exec guard | |
01:12:33 - INFO - Guard is using TerminalTitle to send notifications. | |
01:12:33 - INFO - Guard::RSpec is running | |
01:12:33 - INFO - Guard is now watching at '/Users/kyuden/Test' | |
[1] guard(main)> | |
01:12:34 - INFO - Run all | |
01:12:34 - INFO - Running all specs | |
WARN: Unresolved specs during Gem::Specification.reset: | |
rspec-expectations (~> 2.14.0) | |
rspec-mocks (~> 2.14.0) |
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 sample Guardfile | |
# More info at https://github.com/guard/guard#readme | |
guard 'livereload' do | |
watch(%r{app/views/.+\.(erb|haml|slim)$}) | |
watch(%r{app/helpers/.+\.rb}) | |
watch(%r{public/.+\.(css|js|html)}) | |
watch(%r{config/locales/.+\.yml}) | |
# Rails Assets Pipeline | |
watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html|png|jpg))).*}) { |m| "/assets/#{m[3]}" } |
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
numbers = [1, 2, 3, 4, 5, 6] | |
result1 = [] | |
numbers.each do |num| | |
result1 << num * 2 if num % 2 == 0 | |
end | |
p result1 # => [4, 8, 12] |
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
# 02 | |
message = "hello" | |
if message.length > 1 | |
alert message | |
# 03 | |
s = "hello | |
safdaf | |
asdf | |
asfdfda" |
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
# []があるから範囲指定の文字列抽出用途では価値ない | |
"2012-08-01".slice(0..2) | |
"2012-08-01"[0..2] | |
# 正規表現で抽出文字列を絞り込めるはおおきな利点 | |
"2012-08-01".slice(/-(.+)-/) # => "-08-" | |
# ちなみにdeleteは削除後の文字列を返却するのが違い | |
"2012-08-01".delete(/-(.+)-/) # => "201201" |
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
# map(collect) | |
### 特徴 | |
レシーバの配列の要素、1つずつに対して処理を行う | |
一つずつというのが重要で、処理前と処理後の配列のsizeは結局同じ | |
### 使い所 | |
配列→配列の場合に使う | |
配列内容の要素すべてを1つずつ同様の処理を行うのに便利 | |
例えば |